|
libsyncml
0.5.4
|
Support functions used by libsyncml. More...
|
Data Structures | |
| struct | SmlThreadFunctionContext |
Typedefs | |
| typedef struct SmlThreadFunctionContext | SmlThreadFunctionContext |
Functions | |
| char * | smlRandStr (int maxlength, SmlBool exact) |
| Creates a random string. | |
| void * | smlTryMalloc0 (long n_bytes, SmlError **error) |
| Safely mallocs. | |
| const char * | smlGetVersion (void) |
| Gets the version of libsyncml as string. | |
| SmlThread * | smlThreadNew (GMainContext *context, SmlError **error) |
| void | smlThreadFree (SmlThread *thread) |
| void | smlThreadStart (SmlThread *thread) |
| void | smlThreadStop (SmlThread *thread) |
| gboolean | smlThreadCallFunctionCallback (gpointer data) |
| SmlBool | smlThreadCallFunction (SmlThread *thread, SmlThreadCallFunctionType func, gpointer data, SmlError **error) |
| void | smlSafeFree (gpointer *address) |
| void | smlSafeCFree (char **address) |
| const char * | smlGetLibraryVersion () |
| const char * | smlGetLibrarySoName () |
Support functions used by libsyncml.
| typedef struct SmlThreadFunctionContext SmlThreadFunctionContext |
This context is used to cache the environment for direct function calls within a special thread. Please see smlThreadCallFunction for more details.
| char* smlRandStr | ( | int | maxlength, |
| SmlBool | exact | ||
| ) |
Creates a random string.
Creates a random string of given length or less
| maxlength | The maximum length of the string |
Definition at line 302 of file sml_support.c.
| void* smlTryMalloc0 | ( | long | n_bytes, |
| SmlError ** | error | ||
| ) |
Safely mallocs.
Mallocs or returns an error if OOM
| n_bytes | The size in bytes to malloc |
| error | Pointer to a error struct |
Definition at line 335 of file sml_support.c.
Referenced by smlAssemblerNew(), smlManagerObjectRegister(), smlParserNew(), smlQueueNew(), smlSessionEnd(), smlSessionEndCommand(), smlSessionFlush(), smlSessionNew(), smlSessionSendReply(), smlSessionStartCommand(), smlThreadCallFunction(), smlTransportNew(), and smlXmlAssemblerNew().

| const char* smlGetVersion | ( | void | ) |
Gets the version of libsyncml as string.
Definition at line 364 of file sml_support.c.
| gboolean smlThreadCallFunctionCallback | ( | gpointer | data | ) |
This callback is used to call a function within a special thread. Please see smlThreadCallFunction for more details.
Definition at line 534 of file sml_support.c.
Referenced by smlThreadCallFunction().

| SmlBool smlThreadCallFunction | ( | SmlThread * | thread, |
| SmlThreadCallFunctionType | func, | ||
| gpointer | data, | ||
| SmlError ** | error | ||
| ) |
This function can be used to execute a function in a special thread. Some libraries are designed for single-threaded applications. They require that a set of commands is only executed in one thread. These applications use g_main_loop too. So the functions must be executed in this loop. This will be done synchronously by this function.
Please note: This function is blocking. Please note: The glib source priority is IDLE.
Definition at line 561 of file sml_support.c.
Referenced by smlTransportFinalize().

1.8.1.1