MCPcopy Index your code
hub / github.com/MapServer/MapServer / loadHashTable

Function loadHashTable

mapfile.c:2208–2236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2206}
2207
2208int loadHashTable(hashTableObj *ptable)
2209{
2210 char *key=NULL, *data=NULL;
2211
2212 if (!ptable) ptable = msCreateHashTable();
2213
2214 for(;;) {
2215 switch(msyylex()) {
2216 case(EOF):
2217 msSetError(MS_EOFERR, NULL, "loadHashTable()");
2218 return(MS_FAILURE);
2219 case(END):
2220 return(MS_SUCCESS);
2221 case(MS_STRING):
2222 key = msStrdup(msyystring_buffer); /* the key is *always* a string */
2223 if(getString(&data) == MS_FAILURE) return(MS_FAILURE);
2224 msInsertHashTable(ptable, key, data);
2225
2226 free(key);
2227 free(data); data=NULL;
2228 break;
2229 default:
2230 msSetError(MS_IDENTERR, "Parsing error near (%s):(line %d)", "loadHashTable()", msyystring_buffer, msyylineno );
2231 return(MS_FAILURE);
2232 }
2233 }
2234
2235 return(MS_SUCCESS);
2236}
2237
2238static void writeHashTable(FILE *stream, int indent, const char *title, hashTableObj *table) {
2239 struct hashObj *tp;

Callers 3

loadClassFunction · 0.85
loadLayerFunction · 0.85
loadWebFunction · 0.85

Calls 5

msCreateHashTableFunction · 0.85
msSetErrorFunction · 0.85
msStrdupFunction · 0.85
getStringFunction · 0.85
msInsertHashTableFunction · 0.85

Tested by

no test coverage detected