AString
0.2
A Lightweight C Language String Library
|
宏定义 | |
#define | a_new(type, size) (type *)malloc(sizeof(type) * (size)) |
#define | a_free(point) do{free(point);point = NULL;}while(0) |
#define | P(lock) while(lock++){--lock;} |
#define | V(lock) --lock; |
#define | A_WARING(msg) do{fprintf(stderr, "[WARING] %s: [%s():%d] %s\n", __FILE__, __func__, __LINE__, msg);}while(0) |
#define | A_WARNING_NOT_STRING_LIST A_WARING("A_IS_STRING_LIST Check falt!") |
#define | A_WARNING_NOT_STRING A_WARING("A_IS_STRING Check falt!") |
函数 | |
AStringList * | a_string_list_new (void) |
Create a new AStringList with none string. | |
AStringList * | a_string_list_assign (AStringList *list, AString *string) |
Copies string from an AString into an AStringList, destroying any previous contents. It alias a_string_list_set_text;. | |
AStringList * | a_string_list_assign_split (AStringList *list, AString *string, AString *split) |
It's like assign,but,split will be . | |
AStringList * | a_string_list_load_from_file (const char *filename) |
Create an AStringList from a file. | |
AStringList * | a_string_list_append (AStringList *list, AStringList *list2) |
Append AStringList to exists AStringList. | |
AStringList * | a_string_list_prepend (AStringList *list, AStringList *list2) |
Prepend AStringList to exists AStringList. | |
AStringList * | a_string_list_add (AStringList *list, AString *string) |
Add an AString to the end of AStringList. | |
AStringList * | a_string_list_insert (AStringList *list, asize index, AString *string) |
Insert an AString to AStringList. | |
AStringList * | a_string_list_delete (AStringList *list, asize index) |
Delete an AString from an AStringList. | |
AStringList * | a_string_list_clear (AStringList *list) |
Clear the AStringList. | |
AStringList * | a_string_list_exchange (AStringList *list, asize index1, asize index2) |
Exchange two lines in an AStringList. | |
asize | a_string_list_find (AStringList *list, AString *string, asize index) |
Find an AString from an AStringList. | |
asize | a_string_list_find_name (AStringList *list, AString *string, asize index) |
Find a key from an AStringList When the stringlist is like key=value, find the key in the list. | |
AString * | a_string_list_get_value (AStringList *list, asize index) |
Get a value from an AStringList When the stringlist is like key=value, get the value from a string. | |
AString * | a_string_list_get_index (AStringList *list, asize index) |
Get a AString from an AStringList. | |
AStringList * | a_string_list_sort (AStringList *list) |
Sort the StringList. | |
AStringList * | a_string_list_sort_custom (AStringList *list, A_CMP cmp) |
Sort the StringList by a custom function. | |
aboolean | a_string_list_sorted (AStringList *list) |
Check the StringList is sorted. | |
aboolean | a_string_list_sorted_custom (AStringList *list, A_CMP cmp) |
Check the StringList is sorted. | |
AStringList * | a_string_list_dup (AStringList *list) |
duplicate the AStringList | |
AString * | a_string_list_get_text (AStringList *list, auchar returnchar) |
export an AStringList to an AString | |
aboolean | a_string_list_save_to_file (AStringList *list, const char *filename, auchar returnchar) |
export an AStringList to a file | |
aboolean | a_string_list_equal (AStringList *list1, AStringList *list2) |
compare the two AStringLists | |
void | a_string_list_free (AStringList *list) |
Frees the memory allocated for the AStringList. |
#define a_free | ( | point | ) | do{free(point);point = NULL;}while(0) |
#define a_new | ( | type, | |
size | |||
) | (type *)malloc(sizeof(type) * (size)) |
#define A_WARING | ( | msg | ) | do{fprintf(stderr, "[WARING] %s: [%s():%d] %s\n", __FILE__, __func__, __LINE__, msg);}while(0) |
#define A_WARNING_NOT_STRING A_WARING("A_IS_STRING Check falt!") |
#define A_WARNING_NOT_STRING_LIST A_WARING("A_IS_STRING_LIST Check falt!") |
#define P | ( | lock | ) | while(lock++){--lock;} |
#define V | ( | lock | ) | --lock; |
AStringList* a_string_list_add | ( | AStringList * | list, |
AString * | string | ||
) |
Add an AString to the end of AStringList.
list | the destination AStringList |
string | the string you want to add |
AStringList* a_string_list_append | ( | AStringList * | list, |
AStringList * | list2 | ||
) |
Append AStringList to exists AStringList.
list | the destination AStringList |
list2 | the list you want to append |
AStringList* a_string_list_assign | ( | AStringList * | list, |
AString * | string | ||
) |
Copies string from an AString into an AStringList, destroying any previous contents. It alias a_string_list_set_text;.
list | the AStringList to opera |
string | the AString to assign |
AStringList* a_string_list_assign_split | ( | AStringList * | list, |
AString * | string, | ||
AString * | split | ||
) |
It's like assign,but,split will be
.
list | the AStringList to opera |
string | the AString to assign |
split | the split string |
AStringList* a_string_list_clear | ( | AStringList * | list | ) |
Clear the AStringList.
list | the AStringList you want to clear |
AStringList* a_string_list_delete | ( | AStringList * | list, |
asize | index | ||
) |
Delete an AString from an AStringList.
list | the destination AStringList |
index | the position you want to delete |
AStringList* a_string_list_dup | ( | AStringList * | list | ) |
duplicate the AStringList
list | An AStringList |
aboolean a_string_list_equal | ( | AStringList * | list1, |
AStringList * | list2 | ||
) |
compare the two AStringLists
list | the first AStringList |
list2 | the second AStringList |
AStringList* a_string_list_exchange | ( | AStringList * | list, |
asize | index1, | ||
asize | index2 | ||
) |
Exchange two lines in an AStringList.
list | the destination AStringList |
index1 | the first position |
index2 | the second position |
asize a_string_list_find | ( | AStringList * | list, |
AString * | string, | ||
asize | index | ||
) |
Find an AString from an AStringList.
list | An AStringList |
string | the string to find |
index | the position you want to find start |
asize a_string_list_find_name | ( | AStringList * | list, |
AString * | string, | ||
asize | index | ||
) |
Find a key from an AStringList When the stringlist is like key=value, find the key in the list.
list | An AStringList |
string | the string to find |
index | the position you want to find start |
void a_string_list_free | ( | AStringList * | list | ) |
Frees the memory allocated for the AStringList.
string | the AStringList you want to free |
AString* a_string_list_get_index | ( | AStringList * | list, |
asize | index | ||
) |
Get a AString from an AStringList.
list | An AStringList |
index | the position you want to get |
AString* a_string_list_get_text | ( | AStringList * | list, |
auchar | returnchar | ||
) |
export an AStringList to an AString
list | An AStringList |
returnchar | the return char, 0:' ', 1:'', 2:"\r\n" |
AString* a_string_list_get_value | ( | AStringList * | list, |
asize | index | ||
) |
Get a value from an AStringList When the stringlist is like key=value, get the value from a string.
list | An AStringList |
index | the position you want to get value |
AStringList* a_string_list_insert | ( | AStringList * | list, |
asize | index, | ||
AString * | string | ||
) |
Insert an AString to AStringList.
list | the destination AStringList |
index | the position you want to insert |
string | the string you want to insert |
AStringList* a_string_list_load_from_file | ( | const char * | filename | ) |
Create an AStringList from a file.
filename | the filename you want to load |
AStringList* a_string_list_new | ( | void | ) |
Create a new AStringList with none string.
AStringList* a_string_list_prepend | ( | AStringList * | list, |
AStringList * | list2 | ||
) |
Prepend AStringList to exists AStringList.
list | the destination AStringList |
list2 | the list you want to prepend |
aboolean a_string_list_save_to_file | ( | AStringList * | list, |
const char * | filename, | ||
auchar | returnchar | ||
) |
export an AStringList to a file
list | An AStringList |
filename | the file you want to export |
returnchar | the return char, 0:' ', 1:'', 2:"\r\n" |
AStringList* a_string_list_sort | ( | AStringList * | list | ) |
Sort the StringList.
list | An AStringList |
AStringList* a_string_list_sort_custom | ( | AStringList * | list, |
A_CMP | cmp | ||
) |
Sort the StringList by a custom function.
list | An AStringList |
cmp | An Compare function |
aboolean a_string_list_sorted | ( | AStringList * | list | ) |
Check the StringList is sorted.
list | An AStringList |
aboolean a_string_list_sorted_custom | ( | AStringList * | list, |
A_CMP | cmp | ||
) |
Check the StringList is sorted.
list | An AStringList |
cmp | An Compare function |