DS3 C SDK  5.0.0
Provides access to the Spectra S3 API with C
ds3_string.h
Go to the documentation of this file.
1 /*
2  * ******************************************************************************
3  * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved.
4  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5  * this file except in compliance with the License. A copy of the License is located at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * or in the "license" file accompanying this file.
10  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11  * CONDITIONS OF ANY KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations under the License.
13  * ****************************************************************************
14  */
15 
16 #ifndef __DS3_STRING__
17 #define __DS3_STRING__
18 
19 #include <stdlib.h>
20 #include "ds3_library_exports.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 typedef struct{
27  char* value;
28  size_t size;
29 }ds3_str;
30 
31 LIBRARY_API ds3_str* ds3_str_init(const char* string);
32 LIBRARY_API ds3_str* ds3_str_init_with_size(const char* string, size_t size);
33 LIBRARY_API char* ds3_str_value(const ds3_str* string);
34 LIBRARY_API size_t ds3_str_size(const ds3_str* string);
35 LIBRARY_API ds3_str* ds3_str_dup(const ds3_str* string);
36 LIBRARY_API void ds3_str_free(ds3_str* string);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 #endif
size_t size
Definition: ds3_string.h:28
LIBRARY_API ds3_str * ds3_str_init_with_size(const char *string, size_t size)
Definition: ds3_string.c:25
LIBRARY_API size_t ds3_str_size(const ds3_str *string)
Definition: ds3_string.c:46
LIBRARY_API ds3_str * ds3_str_init(const char *string)
Definition: ds3_string.c:20
#define LIBRARY_API
LIBRARY_API ds3_str * ds3_str_dup(const ds3_str *string)
Definition: ds3_string.c:32
LIBRARY_API void ds3_str_free(ds3_str *string)
Definition: ds3_string.c:50
LIBRARY_API char * ds3_str_value(const ds3_str *string)
Definition: ds3_string.c:42
char * value
Definition: ds3_string.h:27