#include <j2k/Fred/fast_alloc.c>
Go to the source code of this file.
Compounds | |
struct | _JString_t |
struct | _JSubString_t |
Defines | |
#define | JSTRING_SIZE ( sizeof( JString_t ) ) |
#define | JSUBSTRING_SIZE ( sizeof( JSubString_t ) ) |
#define | JSTRING_INIT { 0, 0, 1, 0, { 0 } } |
#define | JSUBSTRING_INIT { 0, 0, 0, 0 } |
Typedefs | |
typedef _JString_t | JString_t |
typedef _JSubString_t | JSubString_t |
Functions | |
JString_t * | JString_malloc (register size_t buffer_size) |
JString_t * | JString_calloc (register size_t buffer_size) |
void | JString_free (JString_t *this) |
JString_t * | JString_create (const char *str, register size_t length, register size_t buffer_size) |
JString_t * | JString_safe_create (const char *str) |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 59 of file JString.c. Referenced by JString_create().
|
|
Definition at line 78 of file JString.c. Referenced by JString_safe_create().
00079 { 00080 /* Make sure the buffer size is at least the length */ 00081 if ( buffer_size < length ) 00082 { 00083 buffer_size = length; 00084 } 00085 00086 JString_t* s = JString_calloc( buffer_size ); 00087 00088 if ( str != NULL ) 00089 { 00090 memcpy( s->data, str, length ); 00091 } 00092 00093 return s; 00094 } |
|
Definition at line 68 of file JString.c. 00069 { 00070 /* delete if not used and unlock */ 00071 if( --this->nbRefs <= 0 && this->lock == 0 ) 00072 { 00073 free( this ); 00074 } 00075 } |
|
Definition at line 53 of file JString.c. 00054 { 00055 buffer_size += sizeof( JString_t ); 00056 return (JString_t*)fast_malloc( buffer_size ); 00057 } |
|
Definition at line 96 of file JString.c. 00097 { 00098 return JString_create( str, strlen( str ), 80 ); 00099 } |