EPICS Base  7.0.8.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
epicsString.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2009 Helmholtz-Zentrum Berlin fuer Materialien und Energie.
3 * Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
4 * National Laboratory.
5 * Copyright (c) 2002 The Regents of the University of California, as
6 * Operator of Los Alamos National Laboratory.
7 * SPDX-License-Identifier: EPICS
8 * EPICS BASE is distributed subject to a Software License Agreement found
9 * in file LICENSE that is included with this distribution.
10 \*************************************************************************/
11 
12 /* Authors: Jun-ichi Odagiri, Marty Kraimer, Eric Norum,
13  * Mark Rivers, Andrew Johnson, Ralph Lange
14  */
15 
22 #ifndef INC_epicsString_H
23 #define INC_epicsString_H
24 
25 #include <stdio.h>
26 #include "epicsTypes.h"
27 #include "libComAPI.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
48 LIBCOM_API int epicsStrnRawFromEscaped(char *outbuf, size_t outsize,
49  const char *inbuf, size_t inlen);
50 
72 LIBCOM_API int epicsStrnEscapedFromRaw(char *outbuf, size_t outsize,
73  const char *inbuf, size_t inlen);
74 
88 LIBCOM_API size_t epicsStrnEscapedFromRawSize(const char *buf, size_t len);
89 
94 LIBCOM_API int epicsStrCaseCmp(const char *s1, const char *s2);
95 
100 LIBCOM_API int epicsStrnCaseCmp(const char *s1, const char *s2, size_t len);
101 
106 LIBCOM_API char * epicsStrDup(const char *s);
107 
112 LIBCOM_API char * epicsStrnDup(const char *s, size_t len);
113 
123 LIBCOM_API int epicsStrPrintEscaped(FILE *fp, const char *s, size_t n);
124 
125 #define epicsStrSnPrintEscaped epicsStrnEscapedFromRaw
126 
131 LIBCOM_API size_t epicsStrnLen(const char *s, size_t maxlen);
132 
143 LIBCOM_API int epicsStrGlobMatch(const char *str, const char *pattern);
144 
154 LIBCOM_API int epicsStrnGlobMatch(const char *str, size_t len, const char *pattern);
155 
160 LIBCOM_API char * epicsStrtok_r(char *s, const char *delim, char **lasts);
161 
173 LIBCOM_API unsigned int epicsStrHash(const char *str, unsigned int seed);
174 
187 LIBCOM_API unsigned int epicsMemHash(const char *str, size_t length,
188  unsigned int seed);
198 LIBCOM_API double epicsStrSimilarity(const char *A, const char *B);
199 
203 LIBCOM_API int dbTranslateEscape(char *s, const char *ct);
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #endif /* INC_epicsString_H */
LIBCOM_API int epicsStrnEscapedFromRaw(char *outbuf, size_t outsize, const char *inbuf, size_t inlen)
Converts non-printable characters into C-style escape sequences.
LIBCOM_API size_t epicsStrnLen(const char *s, size_t maxlen)
Calculates length of string.
LIBCOM_API int epicsStrnGlobMatch(const char *str, size_t len, const char *pattern)
Matches a string against a pattern.
LIBCOM_API int dbTranslateEscape(char *s, const char *ct)
DEPRECATED.
LIBCOM_API size_t epicsStrnEscapedFromRawSize(const char *buf, size_t len)
Scans string and returns size of output buffer needed to escape that string.
The core data types used by epics.
LIBCOM_API int epicsStrPrintEscaped(FILE *fp, const char *s, size_t n)
Prints escaped version of string.
LIBCOM_API int epicsStrnRawFromEscaped(char *outbuf, size_t outsize, const char *inbuf, size_t inlen)
Converts C-style escape sequences to their binary form.
LIBCOM_API int epicsStrGlobMatch(const char *str, const char *pattern)
Matches a string against a pattern.
LIBCOM_API char * epicsStrtok_r(char *s, const char *delim, char **lasts)
Extract tokens from string.
LIBCOM_API unsigned int epicsMemHash(const char *str, size_t length, unsigned int seed)
Calculates a hash of a memory buffer.
LIBCOM_API char * epicsStrnDup(const char *s, size_t len)
Duplicates a string.
LIBCOM_API char * epicsStrDup(const char *s)
Duplicates a string.
LIBCOM_API int epicsStrCaseCmp(const char *s1, const char *s2)
Does case-insensitive comparison of two strings.
LIBCOM_API double epicsStrSimilarity(const char *A, const char *B)
Compare two strings and return a number in the range [0.0, 1.0] or -1.0 on error. ...
LIBCOM_API int epicsStrnCaseCmp(const char *s1, const char *s2, size_t len)
Does case-insensitive comparision of two strings.
LIBCOM_API unsigned int epicsStrHash(const char *str, unsigned int seed)
Calculates a hash of a null-terminated string.