XenevaOS
Loading...
Searching...
No Matches
string.h
Go to the documentation of this file.
1//
2// string.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014 R. Stange <rsta2@o2online.de>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20#ifndef _uspi_string_h
21#define _uspi_string_h
22
23#include "uspi/stdarg.h"
24#include "uspi/types.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30
31typedef struct TString
32{
33 char *m_pBuffer;
34 unsigned m_nSize;
35 char *m_pInPtr;
36}
38
39void String (TString *pThis);
40void String2 (TString *pThis, const char *pString);
41void _String (TString *pThis);
42
43const char *StringGet (TString *pThis);
44const char *StringSet (TString *pThis, const char *pString);
45
46size_t StringGetLength (TString *pThis);
47
48void StringAppend (TString *pThis, const char *pString);
49int StringCompare (TString *pThis, const char *pString);
50int StringFind (TString *pThis, char chChar); // returns index or -1 if not found
51
52void StringFormat (TString *pThis, const char *pFormat, ...); // supports only a small subset of printf(3)
53void StringFormatV (TString *pThis, const char *pFormat, va_list Args);
54
55#ifdef __cplusplus
56}
57#endif
58
59#endif
int StringCompare(TString *pThis, const char *pString)
Definition string.c:132
void _String(TString *pThis)
Definition string.c:51
void String2(TString *pThis, const char *pString)
Definition string.c:40
int StringFind(TString *pThis, char chChar)
Definition string.c:139
const char * StringSet(TString *pThis, const char *pString)
Definition string.c:74
void StringAppend(TString *pThis, const char *pString)
Definition string.c:104
const char * StringGet(TString *pThis)
Definition string.c:62
void String(TString *pThis)
Definition string.c:33
void StringFormatV(TString *pThis, const char *pFormat, va_list Args)
Definition string.c:174
void StringFormat(TString *pThis, const char *pFormat,...)
Definition string.c:159
size_t StringGetLength(TString *pThis)
Definition string.c:92
char ** Args
Definition acdebug.h:451
char * va_list
Definition acmsvcex.h:186
Definition string.h:32
char * m_pInPtr
Definition string.h:35
char * m_pBuffer
Definition string.h:33
unsigned m_nSize
Definition string.h:34