The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

newstr.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

char * copystr (char *s)
void donestr ()
void freestr (char *s)
char * newstr (char *string)


Function Documentation

char* copystr char *  s  ) 
 

Definition at line 125 of file newstr.c.

Referenced by actions_new(), add_hash_key(), add_module_name(), add_rule_name(), call_bind_rule(), compile_foreach(), copytarget(), list_copy(), list_sublist(), make1list(), make1settings(), and var_expand().

00126 {
00127         return s;
00128 }

void donestr  ) 
 

Definition at line 144 of file newstr.c.

References hashdone(), n, strblock::next, strblock_chain, strhash, and strtotal.

Referenced by main().

00145 {
00146     /* Reclaim string blocks */
00147     while ( strblock_chain != 0 )
00148     {
00149         strblock* n = strblock_chain->next;
00150         free(strblock_chain);
00151         strblock_chain = n;
00152     }
00153     
00154     hashdone( strhash );
00155     
00156     if( DEBUG_MEM )
00157         printf( "%dK in strings\n", strtotal / 1024 );
00158 }

Here is the call graph for this function:

void freestr char *  s  ) 
 

Definition at line 135 of file newstr.c.

Referenced by actions_free(), call_bind_rule(), delete_var_(), freesettings(), global_rule(), list_new(), parse_free(), and rule_free().

00136 {
00137 }

char* newstr char *  string  ) 
 

Definition at line 98 of file newstr.c.

References allocate(), HASHDATA, hashenter, hashinit(), m, s, strhash, string, STRING, and strtotal.

Referenced by addsettings(), bindmodule(), bindtarget(), builtin_backtrace(), builtin_calc(), builtin_caller_module(), builtin_glob_back(), builtin_match(), builtin_normalize_path(), builtin_subst(), builtin_update(), class_module_name(), compile_eval(), downcase_list(), enter_rule(), global_rule_name(), headers1(), lol_build(), macro_headers(), main(), make1cmds(), new_module_str(), pwd(), search(), search_for_target(), time_enter(), timestamp(), var_defines(), var_enter(), var_expand(), and var_expand_unit_test().

00099 {
00100         STRING str, *s = &str;
00101 
00102         if( !strhash )
00103             strhash = hashinit( sizeof( STRING ), "strings" );
00104 
00105         *s = string;
00106 
00107         if( hashenter( strhash, (HASHDATA **)&s ) )
00108         {
00109             int l = strlen( string );
00110             char *m = (char *)allocate( l + 1 );
00111 
00112             strtotal += l + 1;
00113             memcpy( m, string, l + 1 );
00114             *s = m;
00115         }
00116 
00117         return *s;
00118 }

Here is the call graph for this function:


Generated on Mon Nov 8 17:08:15 2004 for MPT by  doxygen 1.3.9.1