-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstr.h
37 lines (28 loc) · 901 Bytes
/
str.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// Created by lklake on 2019/7/21.
//
#ifndef DHT_STR_H
#define DHT_STR_H
typedef struct _string string;
void l_enlarge(string* this);
void string_init(string* this,char* data,int length);
void string_append(string* this,char chr);
void string_nappend(string* this,string* that,int n);
void string_extend(string* this,string* that);
char string_i(string* this,int pos);
string* string_ii(string* this,int pos1,int pos2);
void string_destroy(string* this);
void string_print(string* this);
struct _string{
char* data;
int length;
int max;
void (*destroy)(string* this);
char (*i)(string* this,int pos);
string* (*ii)(string* this,int pos1,int pos2);
void (*append)(string* this,char data);
void (*nappend)(string* this,string* that,int n);
void (*extend)(struct _string* this,struct _string* that);
void (*print)(string* this);
};
#endif //DHT_STR_H