OpenSync
0.22
|
Some helper functions. More...
Functions | |
osync_bool | _osync_open_xml_file (xmlDocPtr *doc, xmlNodePtr *cur, const char *path, const char *topentry, OSyncError **error) |
Opens a xml document. More... | |
osync_bool | osync_file_write (const char *filename, const char *data, int size, int mode, OSyncError **oserror) |
Writes data to a file. More... | |
osync_bool | osync_file_read (const char *filename, char **data, int *size, OSyncError **oserror) |
Reads a file. More... | |
const char * | osync_get_version (void) |
Returns the version of opensync. More... | |
void * | osync_try_malloc0 (unsigned int size, OSyncError **error) |
Safely tries to malloc memory. More... | |
char * | osync_strreplace (const char *input, const char *delimiter, const char *replacement) |
Some helper functions.
osync_bool _osync_open_xml_file | ( | xmlDocPtr * | doc, |
xmlNodePtr * | cur, | ||
const char * | path, | ||
const char * | topentry, | ||
OSyncError ** | error | ||
) |
Opens a xml document.
Opens a xml document
doc | Pointer to a xmldoc |
cur | The pointer to the first node |
path | The path of the document |
topentry | the name of the top node |
error | Pointer to a error struct |
Definition at line 652 of file opensync_env.c.
Referenced by osync_group_load(), and osync_member_load().
osync_bool osync_file_write | ( | const char * | filename, |
const char * | data, | ||
int | size, | ||
int | mode, | ||
OSyncError ** | oserror | ||
) |
Writes data to a file.
Writes data to a file
filename | Where to save the data |
data | Pointer to the data |
size | Size of the data |
mode | The mode to set on the file |
oserror | Pointer to a error struct |
Definition at line 700 of file opensync_env.c.
Referenced by osync_member_save().
osync_bool osync_file_read | ( | const char * | filename, |
char ** | data, | ||
int * | size, | ||
OSyncError ** | oserror | ||
) |
Reads a file.
Reads a file
filename | Where to read the data from |
data | Pointer to the data |
size | Size of the data |
oserror | Pointer to a error struct |
Definition at line 743 of file opensync_env.c.
Referenced by osync_member_get_config(), and osync_member_get_config_or_default().
const char* osync_get_version | ( | void | ) |
Returns the version of opensync.
Returns a string identifying the major and minor version of opensync (something like "0.11")
Definition at line 781 of file opensync_env.c.
void* osync_try_malloc0 | ( | unsigned int | size, |
OSyncError ** | error | ||
) |
Safely tries to malloc memory.
Tries to malloc memory but returns an error in an OOM situation instead of aborting
size | The size in bytes to malloc |
error | The error which will hold the info in case of an error |
Definition at line 796 of file opensync_env.c.
Referenced by osync_message_new(), osync_queue_get_message(), osync_queue_new(), osync_try_malloc0(), and osync_user_new().