liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
struct | a_str |
instance structure for basic string More... | |
Macros | |
#define | A_STR_INIT {A_NULL, 0, 0} |
Typedefs | |
typedef struct a_str | a_str |
instance structure for basic string | |
Functions | |
char * | a_str_ptr (a_str const *ctx) |
string for a pointer to string structure | |
size_t | a_str_len (a_str const *ctx) |
length for a pointer to string structure | |
size_t | a_str_mem (a_str const *ctx) |
memory for a pointer to string structure | |
char | a_str_at_ (a_str const *ctx, size_t idx) |
access specified character for a pointer to string structure | |
char | a_str_at (a_str const *ctx, size_t idx) |
access specified character for a pointer to string structure | |
char | a_str_idx (a_str const *ctx, ptrdiff_t idx) |
access specified character for a pointer to string structure | |
void | a_str_setlen_ (a_str *ctx, size_t num) |
set length for a pointer to string structure | |
int | a_str_setlen (a_str *ctx, size_t num) |
set length for a pointer to string structure | |
void | a_str_drop (a_str *ctx) |
drop all characters for a pointer to string structure | |
a_str * | a_str_new (void) |
allocate a pointer to string structure from memory | |
void | a_str_die (a_str *ctx) |
deallocate a pointer to string structure | |
void | a_str_ctor (a_str *ctx) |
constructor for string structure | |
void | a_str_dtor (a_str *ctx) |
destructor for string structure | |
int | a_str_copy (a_str *ctx, a_str const *obj) |
initialize a pointer to string structure by copying | |
void | a_str_move (a_str *ctx, a_str *obj) |
initialize a pointer to string structure by moving | |
char * | a_str_exit (a_str *ctx) |
terminate a pointer to string structure | |
int | a_str_alloc (a_str *ctx, size_t mem) |
allocate memory for a pointer to string structure | |
int | a_str_alloc_ (a_str *ctx, size_t mem) |
int | a_str_cmp_ (void const *p0, size_t n0, void const *p1, size_t n1) |
compare the memory block 0 with the memory block 1 | |
int | a_str_cmp (a_str const *lhs, a_str const *rhs) |
compare the string lhs with the string rhs | |
int | a_str_cmpn (a_str const *ctx, void const *pdata, size_t nbyte) |
compare the string ctx with the memory block | |
int | a_str_cmps (a_str const *ctx, void const *str) |
compare the string ctx with the C string str | |
int | a_str_getc (a_str *ctx) |
get character for a pointer to string structure | |
int | a_str_getc_ (a_str *ctx) |
int | a_str_putc (a_str *ctx, int c) |
put character to a pointer to string structure | |
int | a_str_putc_ (a_str *ctx, int c) |
size_t | a_str_getn (a_str *ctx, void *pdata, size_t nbyte) |
get memory block to a pointer to string structure | |
size_t | a_str_getn_ (a_str *ctx, void *pdata, size_t nbyte) |
int | a_str_setn (a_str *ctx, void const *pdata, size_t nbyte) |
set memory block to a pointer to string structure | |
int | a_str_setn_ (a_str *ctx, void const *pdata, size_t nbyte) |
int | a_str_putn (a_str *ctx, void const *pdata, size_t nbyte) |
put memory block to a pointer to string structure | |
int | a_str_putn_ (a_str *ctx, void const *pdata, size_t nbyte) |
int | a_str_sets (a_str *ctx, void const *str) |
set C string to a pointer to string structure | |
int | a_str_sets_ (a_str *ctx, void const *str) |
int | a_str_puts (a_str *ctx, void const *str) |
put C string to a pointer to string structure | |
int | a_str_puts_ (a_str *ctx, void const *str) |
int | a_str_setv (a_str *ctx, char const *fmt, va_list va) |
format string to a pointer to string structure via va_list | |
int | a_str_putv (a_str *ctx, char const *fmt, va_list va) |
format string append to a pointer to string structure via va_list | |
int | a_str_setf (a_str *ctx, char const *fmt,...) |
format string to a pointer to string structure | |
int | a_str_putf (a_str *ctx, char const *fmt,...) |
format string append to a pointer to string structure | |
int | a_str_set (a_str *ctx, a_str const *obj) |
set the string structure obj to the string structure ctx | |
int | a_str_set_ (a_str *ctx, a_str const *obj) |
int | a_str_put (a_str *ctx, a_str const *obj) |
put the string structure obj to the string structure ctx | |
int | a_str_put_ (a_str *ctx, a_str const *obj) |
size_t | a_str_utflen (a_str const *ctx) |
length for a pointer to string structure using UTF-8 | |
int a_str_alloc | ( | a_str * | ctx, |
size_t | mem ) |
allocate memory for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | mem | new memory capacity of string |
0 | success |
1 | failure |
char a_str_at | ( | a_str const * | ctx, |
size_t | idx ) |
access specified character for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | idx | index of character less than length |
0 | out of bounds |
char a_str_at_ | ( | a_str const * | ctx, |
size_t | idx ) |
access specified character for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | idx | index of character less than memory |
compare the string lhs
with the string rhs
[in] | lhs | string structure to be compared |
[in] | rhs | string structure to be compared |
<0 | string lhs < string rhs |
>0 | string lhs > string rhs |
0 | string lhs == string rhs |
int a_str_cmp_ | ( | void const * | p0, |
size_t | n0, | ||
void const * | p1, | ||
size_t | n1 ) |
compare the memory block 0 with the memory block 1
[in] | p0 | points to memory block 0 to be compared |
[in] | n0 | length of memory block 0 to be compared |
[in] | p1 | points to memory block 1 to be compared |
[in] | n1 | length of memory block 1 to be compared |
<0 | memory block 0 < memory block 1 |
>0 | memory block 0 > memory block 1 |
0 | memory block 0 == memory block 1 |
int a_str_cmpn | ( | a_str const * | ctx, |
void const * | pdata, | ||
size_t | nbyte ) |
compare the string ctx
with the memory block
[in] | ctx | points to an instance of string structure |
[in] | pdata | points to memory block to be compared |
[in] | nbyte | length of memory block to be compared |
<0 | string ctx < memory block |
>0 | string ctx > memory block |
0 | string ctx == memory block |
int a_str_cmps | ( | a_str const * | ctx, |
void const * | str ) |
compare the string ctx
with the C string str
[in] | ctx | points to an instance of string structure |
[in] | str | string terminated with a null character |
<0 | string ctx < C string str |
>0 | string ctx > C string str |
0 | string ctx == C string str |
initialize a pointer to string structure by copying
[in] | ctx | points to an instance of string structure |
[in] | obj | input source pointing to an instance |
0 | success |
1 | failure |
void a_str_ctor | ( | a_str * | ctx | ) |
constructor for string structure
[in] | ctx | points to an instance of string structure |
void a_str_die | ( | a_str * | ctx | ) |
deallocate a pointer to string structure
[in] | ctx | points to an instance of string structure |
void a_str_drop | ( | a_str * | ctx | ) |
drop all characters for a pointer to string structure
[in] | ctx | points to an instance of string structure |
void a_str_dtor | ( | a_str * | ctx | ) |
destructor for string structure
[in] | ctx | points to an instance of string structure |
char * a_str_exit | ( | a_str * | ctx | ) |
terminate a pointer to string structure
[in] | ctx | points to an instance of string structure |
int a_str_getc | ( | a_str * | ctx | ) |
get character for a pointer to string structure
[in] | ctx | points to an instance of string structure |
~0 | failure |
size_t a_str_getn | ( | a_str * | ctx, |
void * | pdata, | ||
size_t | nbyte ) |
get memory block to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | pdata | points to memory block to get |
[in] | nbyte | length of memory block to get |
char a_str_idx | ( | a_str const * | ctx, |
ptrdiff_t | idx ) |
access specified character for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | idx | index of character -length < idx < length |
0 | out of bounds |
size_t a_str_len | ( | a_str const * | ctx | ) |
length for a pointer to string structure
[in] | ctx | points to an instance of string structure |
size_t a_str_mem | ( | a_str const * | ctx | ) |
memory for a pointer to string structure
[in] | ctx | points to an instance of string structure |
initialize a pointer to string structure by moving
[in] | ctx | points to an instance of string structure |
[in] | obj | input source pointing to an instance |
char * a_str_ptr | ( | a_str const * | ctx | ) |
string for a pointer to string structure
[in] | ctx | points to an instance of string structure |
put the string structure obj to the string structure ctx
[in] | ctx | points to an instance of string structure |
[in] | obj | input source pointing to an instance |
0 | success |
1 | failure |
int a_str_putc | ( | a_str * | ctx, |
int | c ) |
put character to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | c | character to be parsed |
~0 | failure |
int a_str_putf | ( | a_str * | ctx, |
char const * | fmt, | ||
... ) |
format string append to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | fmt | format of string to be parsed |
int a_str_putn | ( | a_str * | ctx, |
void const * | pdata, | ||
size_t | nbyte ) |
put memory block to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | pdata | points to memory block to put |
[in] | nbyte | length of memory block to put |
0 | success |
1 | failure |
int a_str_puts | ( | a_str * | ctx, |
void const * | str ) |
put C string to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | str | string terminated with a null character |
0 | success |
1 | failure |
int a_str_putv | ( | a_str * | ctx, |
char const * | fmt, | ||
va_list | va ) |
format string append to a pointer to string structure via va_list
[in] | ctx | points to an instance of string structure |
[in] | fmt | format of string to be parsed |
[in] | va | instance of variable argument |
set the string structure obj to the string structure ctx
[in] | ctx | points to an instance of string structure |
[in] | obj | input source pointing to an instance |
0 | success |
1 | failure |
int a_str_setf | ( | a_str * | ctx, |
char const * | fmt, | ||
... ) |
format string to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | fmt | format of string to be parsed |
int a_str_setlen | ( | a_str * | ctx, |
size_t | num ) |
set length for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | num | new length for a pointer to string structure |
0 | success |
1 | failure |
void a_str_setlen_ | ( | a_str * | ctx, |
size_t | num ) |
set length for a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | num | new length for a pointer to string structure |
int a_str_setn | ( | a_str * | ctx, |
void const * | pdata, | ||
size_t | nbyte ) |
set memory block to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | pdata | points to memory block to set |
[in] | nbyte | length of memory block to set |
0 | success |
1 | failure |
int a_str_sets | ( | a_str * | ctx, |
void const * | str ) |
set C string to a pointer to string structure
[in] | ctx | points to an instance of string structure |
[in] | str | string terminated with a null character |
0 | success |
1 | failure |
int a_str_setv | ( | a_str * | ctx, |
char const * | fmt, | ||
va_list | va ) |
format string to a pointer to string structure via va_list
[in] | ctx | points to an instance of string structure |
[in] | fmt | format of string to be parsed |
[in] | va | instance of variable argument |
size_t a_str_utflen | ( | a_str const * | ctx | ) |
length for a pointer to string structure using UTF-8
[in] | ctx | points to an instance of string structure |