# oxs_buffer.h

Go to the documentation of this file.

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    00016  */
    00017
    00018 #ifndef OXS_BUFFER_H
    00019 #define OXS_BUFFER_H
    00020
    00021
    00027 #include <axis2_defines.h>
    00028 #include <axutil_env.h>
    00029 #include <axis2_util.h>
    00030 #include <oxs_axiom.h>
    00031 #include <oxs_error.h>
    00032 #include <oxs_constants.h>
    00033 #include <stdio.h>
    00034
    00035 #ifdef __cplusplus
    00036 extern "C"
    00037 {
    00038 #endif
    00039
    00045 #define OXS_BUFFER_INITIAL_SIZE 1024
    00046
    00052     typedef enum {
    00053         oxs_alloc_mode_exact = 0,
    00054         oxs_alloc_mode_double
    00055     } oxs_AllocMode;
    00056
    00057
    00059     typedef struct oxs_buffer oxs_buffer_t;
    00060
    00067     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00068     oxs_buffer_free(
    00069         oxs_buffer_t *buffer,
    00070         const axutil_env_t *env
    00071     );
    00079     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00080     oxs_buffer_remove_head(
    00081         oxs_buffer_t *buffer,
    00082         const axutil_env_t *env,
    00083         int size
    00084     );
    00092     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00093     oxs_buffer_remove_tail(
    00094         oxs_buffer_t *buffer,
    00095         const axutil_env_t *env,
    00096         int size
    00097     );
    00106     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00107     oxs_buffer_populate(
    00108         oxs_buffer_t *buffer,
    00109         const axutil_env_t *env,
    00110         unsigned char *data,
    00111         int size
    00112     );
    00121     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00122     oxs_buffer_append(
    00123         oxs_buffer_t *buffer,
    00124         const axutil_env_t *env,
    00125         unsigned char *data,
    00126         int size
    00127     );
    00136     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00137     oxs_buffer_prepend(
    00138         oxs_buffer_t *buffer,
    00139         const axutil_env_t *env,
    00140         unsigned char *data,
    00141         int size
    00142     );
    00150     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00151     oxs_buffer_read_file(
    00152         oxs_buffer_t *buffer,
    00153         const axutil_env_t *env,
    00154         const axis2_char_t *filename
    00155     );
    00163     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00164     oxs_buffer_set_size(
    00165         oxs_buffer_t *buffer,
    00166         const axutil_env_t *env,
    00167         int size
    00168     );
    00176     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00177     oxs_buffer_set_max_size(
    00178         oxs_buffer_t *buffer,
    00179         const axutil_env_t *env,
    00180         int size
    00181     );
    00188     AXIS2_EXTERN unsigned char* AXIS2_CALL
    00189     oxs_buffer_get_data(
    00190         oxs_buffer_t *buffer,
    00191         const axutil_env_t *env
    00192     );
    00199     AXIS2_EXTERN int AXIS2_CALL
    00200     oxs_buffer_get_size(
    00201         oxs_buffer_t *buffer,
    00202         const axutil_env_t *env
    00203     );
    00210     AXIS2_EXTERN int AXIS2_CALL
    00211     oxs_buffer_get_max_size(
    00212         oxs_buffer_t *buffer,
    00213         const axutil_env_t *env
    00214     );
    00215
    00216     AXIS2_EXTERN oxs_buffer_t *AXIS2_CALL
    00217     oxs_buffer_dup(oxs_buffer_t *buffer, const axutil_env_t *env);
    00218
    00219     AXIS2_EXTERN oxs_buffer_t *AXIS2_CALL
    00220     oxs_buffer_create(const axutil_env_t *env);
    00221
    00222
    00224 #ifdef __cplusplus
    00225 }
    00226 #endif
    00227
    00228 #endif                          /* OXS_BUFFER_H */