# axutil_duration.h

    00001
    00002 /*
    00003  * Licensed to the Apache Software Foundation (ASF) under one or more
    00004  * contributor license agreements.  See the NOTICE file distributed with
    00005  * this work for additional information regarding copyright ownership.
    00006  * The ASF licenses this file to You under the Apache License, Version 2.0
    00007  * (the "License"); you may not use this file except in compliance
    00008  * with the License.  You may obtain a copy of the License at
    00009  *
    00010  *      http://www.apache.org/licenses/LICENSE-2.0
    00011  *
    00012  * Unless required by applicable law or agreed to in writing, software
    00013  * distributed under the License is distributed on an "AS IS" BASIS,
    00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00015  * See the License for the specific language governing permissions and
    00016  * limitations under the License.
    00017  */
    00018
    00019 #ifndef AXUTIL_DURATION_H
    00020 #define AXUTIL_DURATION_H
    00021
    00022 #include <axutil_utils_defines.h>
    00023 #include <axutil_env.h>
    00024
    00025 #ifdef __cplusplus
    00026 extern "C"
    00027 {
    00028 #endif
    00029
    00036     typedef struct axutil_duration axutil_duration_t;
    00037
    00043     AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
    00044     axutil_duration_create(
    00045         axutil_env_t * env);
    00046
    00047     AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
    00048
    00049     axutil_duration_create_from_values(
    00050         const axutil_env_t * env,
    00051         axis2_bool_t negative,
    00052         int years,
    00053         int months,
    00054         int days,
    00055         int hours,
    00056         int minutes,
    00057         double seconds);
    00058
    00059     AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
    00060
    00061     axutil_duration_create_from_string(
    00062         const axutil_env_t * env,
    00063         const axis2_char_t * duration_str);
    00064
    00065     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00066     axutil_duration_free(
    00067         axutil_duration_t * duration,
    00068         const axutil_env_t * env);
    00069
    00070     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00071
    00072     axutil_duration_deserialize_duration(
    00073         axutil_duration_t * duration,
    00074         const axutil_env_t * env,
    00075         const char *duration_str);
    00076
    00077     AXIS2_EXTERN char *AXIS2_CALL
    00078     axutil_duration_serialize_duration(
    00079         axutil_duration_t * duration,
    00080         const axutil_env_t * env);
    00081
    00082     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00083     axutil_duration_set_duration(
    00084         axutil_duration_t * duration,
    00085         const axutil_env_t * env,
    00086         axis2_bool_t negative,
    00087         int years,
    00088         int months,
    00089         int days,
    00090         int hours,
    00091         int mins,
    00092         double seconds);
    00093
    00094     AXIS2_EXTERN int AXIS2_CALL
    00095     axutil_duration_get_years(
    00096         axutil_duration_t * duration,
    00097         const axutil_env_t * env);
    00098
    00099     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00100     axutil_duration_set_years(
    00101         axutil_duration_t * duration,
    00102         const axutil_env_t * env,
    00103         int years);
    00104
    00105     AXIS2_EXTERN int AXIS2_CALL
    00106     axutil_duration_get_months(
    00107         axutil_duration_t * duration,
    00108         const axutil_env_t * env);
    00109
    00110     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00111     axutil_duration_set_months(
    00112         axutil_duration_t * duration,
    00113         const axutil_env_t * env,
    00114         int months);
    00115
    00116     AXIS2_EXTERN int AXIS2_CALL
    00117     axutil_duration_get_days(
    00118         axutil_duration_t * duration,
    00119         const axutil_env_t * env);
    00120
    00121     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00122     axutil_duration_set_days(
    00123         axutil_duration_t * duration,
    00124         const axutil_env_t * env,
    00125         int days);
    00126
    00127     AXIS2_EXTERN int AXIS2_CALL
    00128     axutil_duration_get_hours(
    00129         axutil_duration_t * duration,
    00130         const axutil_env_t * env);
    00131
    00132     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00133     axutil_duration_set_hours(
    00134         axutil_duration_t * duration,
    00135         const axutil_env_t * env,
    00136         int hours);
    00137
    00138     AXIS2_EXTERN int AXIS2_CALL
    00139     axutil_duration_get_mins(
    00140         axutil_duration_t * duration,
    00141         const axutil_env_t * env);
    00142
    00143     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00144     axutil_duration_set_mins(
    00145         axutil_duration_t * duration,
    00146         const axutil_env_t * env,
    00147         int mins);
    00148
    00149     AXIS2_EXTERN double AXIS2_CALL
    00150     axutil_duration_get_seconds(
    00151         axutil_duration_t * duration,
    00152         const axutil_env_t * env);
    00153
    00154     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00155     axutil_duration_set_seconds(
    00156         axutil_duration_t * duration,
    00157         const axutil_env_t * env,
    00158         double seconds);
    00159
    00160     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
    00161     axutil_duration_get_is_negative(
    00162         axutil_duration_t * duration,
    00163         const axutil_env_t * env);
    00164
    00165     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00166     axutil_duration_set_is_negative(
    00167         axutil_duration_t * duration,
    00168         const axutil_env_t * env,
    00169         axis2_bool_t is_negative);
    00170
    00171     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
    00172     axutil_duration_compare(
    00173         axutil_duration_t * duration_one,
    00174         axutil_duration_t * duration_two,
    00175         axutil_env_t * env);
    00176
    00177 #ifdef __cplusplus
    00178 }
    00179 #endif
    00180
    00181 #endif                          /* AXIS2_DURATION_H */