S2OPC OPCUA Toolkit
sopc_helper_string.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef SOPC_HELPER_STRING_H_
21 #define SOPC_HELPER_STRING_H_
22 
23 #include <inttypes.h>
24 #include <stdbool.h>
25 #include <stddef.h>
26 
27 #include "sopc_enums.h"
28 
41 int SOPC_strncmp_ignore_case(const char* s1, const char* s2, size_t size);
42 
53 int SOPC_strcmp_ignore_case(const char* s1, const char* s2);
54 
67 int SOPC_strcmp_ignore_case_alt_end(const char* s1, const char* s2, char endCharacter);
68 
80 SOPC_ReturnStatus SOPC_strtouint8_t(const char* sz, uint8_t* n, int base, char cEnd);
81 
93 SOPC_ReturnStatus SOPC_strtouint16_t(const char* sz, uint16_t* n, int base, char cEnd);
94 
106 SOPC_ReturnStatus SOPC_strtouint32_t(const char* sz, uint32_t* n, int base, char cEnd);
107 
118 bool SOPC_strtoint(const char* data, size_t len, uint8_t width, void* dest);
119 
130 bool SOPC_strtouint(const char* data, size_t len, uint8_t width, void* dest);
131 
143 bool SOPC_strtodouble(const char* data, size_t len, uint8_t width, void* dest);
144 
152 char* SOPC_strdup(const char* s);
153 
163 SOPC_ReturnStatus SOPC_StrConcat(const char* left, const char* right, char** str);
164 
165 #endif /* SOPC_HELPER_STRING_H_ */
SOPC_strtouint32_t
SOPC_ReturnStatus SOPC_strtouint32_t(const char *sz, uint32_t *n, int base, char cEnd)
Read a uint32_t from the string with strtoul.
SOPC_strtouint
bool SOPC_strtouint(const char *data, size_t len, uint8_t width, void *dest)
Read an unsigned integer from the string with strtoull.
SOPC_strdup
char * SOPC_strdup(const char *s)
Duplicate the given C string and return copy.
sopc_enums.h
SOPC_strcmp_ignore_case_alt_end
int SOPC_strcmp_ignore_case_alt_end(const char *s1, const char *s2, char endCharacter)
Compare 2 string in a case-insensitive manner until endCharacter or '\0' character found....
SOPC_strtodouble
bool SOPC_strtodouble(const char *data, size_t len, uint8_t width, void *dest)
Read a double from the string with strtod.
SOPC_StrConcat
SOPC_ReturnStatus SOPC_StrConcat(const char *left, const char *right, char **str)
Concatenates the two given C strings.
SOPC_strncmp_ignore_case
int SOPC_strncmp_ignore_case(const char *s1, const char *s2, size_t size)
Compare 2 string in a case-insensitive manner. Comparison returns 0 if size characters were considere...
SOPC_strtouint16_t
SOPC_ReturnStatus SOPC_strtouint16_t(const char *sz, uint16_t *n, int base, char cEnd)
Read a uint16_t from the string with strtoul.
SOPC_strtoint
bool SOPC_strtoint(const char *data, size_t len, uint8_t width, void *dest)
Read a signed integer from the string with strtoll.
SOPC_strtouint8_t
SOPC_ReturnStatus SOPC_strtouint8_t(const char *sz, uint8_t *n, int base, char cEnd)
Read a uint8_t from the string with strtoul.
SOPC_strcmp_ignore_case
int SOPC_strcmp_ignore_case(const char *s1, const char *s2)
Compare 2 string in a case-insensitive manner. Comparison returns 0 if all characters are identical.
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:64