1 .TH "KDB Backends :: Internal Helper for Elektra" 3 "30 Jun 2009" "Elektra Projekt" \" -*- nroff -*-
5 KDB Backends :: Internal Helper for Elektra \- Internal Methods for Elektra and Backends.
12 .RI "int \fBkdbiStrCaseCmp\fP (const char *s1, const char *s2)"
15 .RI "int \fBkdbiRealloc\fP (void **buffer, size_t size)"
18 .RI "void \fBkdbiFree\fP (void *ptr)"
21 .RI "char * \fBkdbiStrDup\fP (const char *s)"
24 .RI "size_t \fBkdbiStrLen\fP (const char *s)"
27 .SH "Detailed Description"
29 Internal Methods for Elektra and Backends.
34 #include <kdbbackend.h>
39 There are some areas where libraries have to reimplement some basic functions to archive support for non-standard systems, for testing purposes or to provide a little more convenience.
40 .SH "Function Documentation"
42 .SS "void kdbiFree (void * ptr)"
44 Free memory of elektra or its backends.
48 \fIptr\fP the pointer to free
57 .SS "int kdbiRealloc (void ** buffer, size_t size)"
59 Reallocate Storage in a save way.
63 if (kdbiRealloc ((void **) & buffer, new_length) < 0) {
64 // here comes the failure handler
65 // you can still use the old buffer
67 fprintf (stderr, 'Reallocation error\n');
79 \fIbuffer\fP is a pointer to a malloc
81 \fIsize\fP is the new size for the memory
92 .SS "int kdbiStrCaseCmp (const char * s1, const char * s2)"
94 Compare Strings ignoring case.
98 \fIs1\fP The first string to be compared
100 \fIs2\fP The second string to be compared
105 a negative number if s1 is less than s2
109 a positive number if s1 is greater than s2
113 .SS "char* kdbiStrDup (const char * s)"
115 Copy string into new allocated memory.
117 You need to free the memory yourself.
121 \fIs\fP the null-terminated string to duplicate
132 .SS "size_t kdbiStrLen (const char * s)"
134 Calculates the length in bytes of a string.
136 This function differs from strlen() because it is Unicode and multibyte chars safe. While strlen() counts characters and ignores the final NULL, \fBkdbiStrLen()\fP count bytes including the ending NULL.
140 \fIs\fP the string to get the length from
145 number of bytes used by the string, including the final NULL.