Atrinik Server  4.0
Macros | Functions
loader.h File Reference

Go to the source code of this file.

Macros

#define LL_EOF   0
 End of file reached.
 
#define LL_MORE   1
 Object has more parts that need loading.
 
#define LL_NORMAL   2
 Object was successfully loaded.
 
#define LL_ERROR   3
 Error loading.
 
#define LO_REPEAT   0
 
#define LO_LINEMODE   1
 
#define LO_NEWFILE   2
 
#define LO_NOREAD   3
 
#define LO_MEMORYMODE   4
 

Functions

void free_object_loader (void)
 
void delete_loader_buffer (void *buffer)
 
void * create_loader_buffer (FILE *fp)
 
int load_object (const char *str, object *op, int map_flags)
 
int load_object_fp (FILE *fp, object *op, int map_flags)
 
int load_object_buffer (void *buffer, object *op, int map_flags)
 
int set_variable (object *op, const char *buf)
 
void get_ob_diff (StringBuffer *sb, const object *op, const object *op2)
 

Detailed Description

Defines for lexical loaders.

Definition in file loader.h.

Function Documentation

void free_object_loader ( void  )

Frees all memory allocated by the object loader.

Definition at line 48436 of file object.c.

void get_ob_diff ( StringBuffer *  sb,
const object op,
const object op2 
)

Get difference between two objects, and save it in a StringBuffer instance.

This function is typically used to dump objects (op2 = empty object), or to save objects (op2 is the objects original archetype).

Parameters
sbString buffer to modify.
opWhat object the different values will be taken from.
op2Object's original archetype.

Definition at line 48732 of file object.c.

int load_object ( const char *  str,
object op,
int  map_flags 
)

Loads an object from the given string.

Variables will be read, parsed and patched into the object until the string "end" is reached, or the end of the string.

Parameters
strString to load from.
opObject to load into.
map_flagsLoad flags.
Returns
One of Lexical loader return codes.

Definition at line 48527 of file object.c.

int load_object_buffer ( void *  buffer,
object op,
int  map_flags 
)

Loads an object from the given flex buffer.

Variables will be read, parsed and patched into the object until the string "end" is reached, or the end of the file.

Parameters
bufferBuffer to load from.
opObject to load into.
map_flagsLoad flags.
Returns
One of Lexical loader return codes.

Definition at line 48633 of file object.c.

int load_object_fp ( FILE *  fp,
object op,
int  map_flags 
)

Loads an object from the given file pointer.

Variables will be read, parsed and patched into the object until the string "end" is reached, or the end of the file.

Parameters
fpFile to load from.
opObject to load into.
map_flagsLoad flags.
Returns
One of Lexical loader return codes.

Definition at line 48576 of file object.c.

int set_variable ( object op,
const char *  buf 
)

This takes a buffer, scans it for variables, and sets those variables as appropriate in op.

Parameters
opObject to alter.
bufModifications to apply.

Definition at line 48663 of file object.c.