#include <dballe/core/error.h>
Go to the source code of this file.
Typedefs | |
| typedef struct _dba_querybuf * | dba_querybuf |
| Efficient string buffer for composing database queries. | |
Functions | |
| dba_err | dba_querybuf_create (int maxsize, dba_querybuf *buf) |
| Create a query buffer. | |
| void | dba_querybuf_delete (dba_querybuf buf) |
| Delete a dba_querybuf. | |
| void | dba_querybuf_reset (dba_querybuf buf) |
| Reset the querybuf to contain the empty string. | |
| const char * | dba_querybuf_get (dba_querybuf buf) |
| Get the string created so far. | |
| int | dba_querybuf_size (dba_querybuf buf) |
| Get the size of the string created so far. | |
| dba_err | dba_querybuf_start_list (dba_querybuf buf, const char *sep) |
| Begin a list of items separated by the given separator. | |
| dba_err | dba_querybuf_append (dba_querybuf buf, const char *str) |
| Append a string to the querybuf. | |
| dba_err | dba_querybuf_appendf (dba_querybuf buf, const char *fmt,...) |
| Append a formatted string to the querybuf. | |
| dba_err | dba_querybuf_append_list (dba_querybuf buf, const char *str) |
| Append a string to the querybuf, as part of a list. | |
| dba_err dba_querybuf_append | ( | dba_querybuf | buf, | |
| const char * | str | |||
| ) |
Append a string to the querybuf.
| buf | The buffer to operate on | |
| str | The string to append |
References dba_error_consistency.
| dba_err dba_querybuf_append_list | ( | dba_querybuf | buf, | |
| const char * | str | |||
| ) |
Append a string to the querybuf, as part of a list.
This function will prepend str with the current list separator, unless it is the first item added to the list.
| buf | The buffer to operate on | |
| str | The string to append |
References DBA_RUN_OR_RETURN.
| dba_err dba_querybuf_appendf | ( | dba_querybuf | buf, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Append a formatted string to the querybuf.
| buf | The buffer to operate on | |
| fmt | The string to append, which will be formatted in printf style |
References dba_error_consistency.
| dba_err dba_querybuf_create | ( | int | maxsize, | |
| dba_querybuf * | buf | |||
| ) |
Create a query buffer.
| maxsize | The maximum size of the query string. Since dba_querybuf does not do dynamic resize of the buffer, it needs the maximum size specified upfront |
| buf | The query buffer |
References dba_error_consistency.
| void dba_querybuf_delete | ( | dba_querybuf | buf | ) |
Delete a dba_querybuf.
| buf | The querybuf to delete |
| const char* dba_querybuf_get | ( | dba_querybuf | buf | ) |
Get the string created so far.
| buf | The buffer to operate on |
| void dba_querybuf_reset | ( | dba_querybuf | buf | ) |
Reset the querybuf to contain the empty string.
| buf | The buffer to operate on |
| int dba_querybuf_size | ( | dba_querybuf | buf | ) |
Get the size of the string created so far.
| buf | The buffer to operate on |
| dba_err dba_querybuf_start_list | ( | dba_querybuf | buf, | |
| const char * | sep | |||
| ) |
Begin a list of items separated by the given separator.
Items are added using dba_querybuf_append_list().
| buf | The buffer to operate on | |
| sep | The separator to add between every list item |
1.5.5