📄 tstring.h
字号:
//---------------------------------------------------------
/*
File name: Tstring.h
Comments: This file contains the definitions needed to
use the text_string type.
*/
//---------------------------------------------------------
#ifndef TSTRING_H
#define TSTRING_H
//---------------------------------------------------------
// Enumerated types
typedef enum
{
TSE_NO_ERROR = 0,
TSE_CANT_ALLOCATE_STRING
} text_string_error;
// End enumerated types
//---------------------------------------------------------
//---------------------------------------------------------
// Type definitions
typedef struct
{
char *charArray;
int charsAllocated;
} text_string;
// End type definitions
//---------------------------------------------------------
//---------------------------------------------------------
// Prototypes
/* The TextStringInitString function must be called on a
text_string variable before it is used.*/
void TextStringInitString(text_string *theString);
text_string_error TextStringSetFromCharArray(
text_string *destinationString,
const char * const charArray);
text_string_error TextStringSetFromTextString(
text_string *destinationString,
const text_string * const sourceString);
void TextStringSetCharacter(text_string *theString,
char theCharacter,
int characterIndex);
char TextStringGetCharacter(const text_string * const theString,
int characterIndex);
text_string_error TextStringAppendCharacter(
text_string *theString,
char theCharacter);
int TextStringPrintString(const text_string * const theString);
int TextStringScanString(text_string *theString);
int TextStringGetLength(const text_string * const theString);
void TextStringFree(text_string *theString);
char *TextStringToCharPointer(const text_string *theString);
// End prototypes
//---------------------------------------------------------
#endif
// End Tstring.h
//---------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -