Changeset 88


Ignore:
Timestamp:
Jun 3, 2009, 9:52:48 PM (5 years ago)
Author:
simon
Message:

replace the global string storage by the memphis-data-pool singleton.

Location:
branches/client-library-split
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/client-library-split/SConstruct

    r87 r88  
    4040    'ruleset.c', 
    4141    'textpath.c', 
    42     'mlib.c' 
     42    'mlib.c', 
     43    'memphis-data-pool.c' 
    4344] 
    4445 
  • branches/client-library-split/main.c

    r87 r88  
    3535 
    3636#include "memphis.h" 
    37  
    38 // Global Vars 
    39 GStringChunk *stringChunk; 
    40 GTree        *stringTree; 
    4137 
    4238/* Renderer Options */ 
     
    162158    g_option_context_free(optctx); 
    163159 
    164     stringChunk = g_string_chunk_new(265); 
    165     stringTree = g_tree_new(m_tree_strcmp); 
    166  
    167160    banner(); 
    168161 
     
    175168        return(-1); 
    176169 
    177     g_tree_destroy(stringTree); 
    178  
    179170    renderCairo(ruleset, osm); 
    180171 
    181172    osmFree(osm); 
    182173    rulesetFree(ruleset); 
    183  
    184     g_string_chunk_free(stringChunk); 
    185174 
    186175    return(0); 
  • branches/client-library-split/osm05.c

    r87 r88  
    2929#include "mlib.h" 
    3030#include "osm05.h" 
     31#include "memphis-data-pool.h" 
    3132 
    3233#define BUFFSIZE 1024 
    33  
    34 // External Vars 
    35 extern GStringChunk *stringChunk; 
    36 extern GTree        *stringTree; 
    3734 
    3835typedef struct mapUserData_ mapUserData; 
     
    4239  osmNode *cNode; 
    4340  osmWay *cWay; 
     41  MemphisDataPool *pool; 
    4442  // Collected Data 
    4543  osmFile *osm; 
     
    6260    mapUserData *data = (mapUserData *) userData; 
    6361    osmFile *osm = data->osm; 
     62    GStringChunk *stringChunk = data->pool->stringChunk; 
     63    GTree *stringTree = data->pool->stringTree; 
    6464    gint8 debug_level = data->debug_level; 
    6565     
     
    232232osmEndElement(void *userData, const char *name) { 
    233233    mapUserData *data = (mapUserData *) userData; 
    234     int debug_level = data->debug_level; 
     234    gint8 debug_level = data->debug_level; 
    235235     
    236236    if (debug_level > 1) 
     
    265265    data->cntTag = 0; 
    266266    data->cntNd = 0; 
     267    data->pool = memphis_data_pool_new (); 
    267268    data->debug_level = debug_level; 
    268269     
  • branches/client-library-split/osm05.h

    r87 r88  
    2222 
    2323#include <glib.h> 
    24 #include "memphis-map.h" 
    2524 
    2625typedef struct osmTag_ osmTag; 
  • branches/client-library-split/renderer.c

    r84 r88  
    3636// External Vars 
    3737extern memphisOpt   *opts; 
    38 //extern GTree        *keyStrings; 
    39 //extern GTree        *valStrings; 
    4038 
    4139/* 
  • branches/client-library-split/ruleset.c

    r87 r88  
    2828#include "ruleset.h" 
    2929#include "mlib.h" 
     30#include "memphis-data-pool.h" 
    3031 
    3132#define BUFFSIZE 1024 
    3233#define MAXDEPTH 20 
    3334#define MAXSTACK 20 
    34  
    35 // External Vars 
    36 extern GStringChunk *stringChunk; 
    37 extern GTree        *stringTree; 
    3835 
    3936typedef struct rulesUserData_ rulesUserData; 
     
    4340  cfgRule *ruleStack[MAXSTACK]; 
    4441  char **stringStack; 
     42  MemphisDataPool *pool; 
    4543  // Collected Data 
    4644  cfgRules *ruleset; 
     
    6159    rulesUserData *data = (rulesUserData *)userData; 
    6260    cfgRules *ruleset = data->ruleset; 
     61    GStringChunk *stringChunk = data->pool->stringChunk; 
     62    GTree *stringTree = data->pool->stringTree; 
    6363    gint8 debug_level = data->debug_level; 
    64      
     64 
    6565    if (debug_level > 1) 
    6666        fprintf(stdout,"cfgStartElement\n"); 
     
    268268    ruleset->cntElse = 0; 
    269269    data->ruleset = ruleset; 
     270    data->pool = memphis_data_pool_new (); 
    270271    data->debug_level = debug_level; 
    271272 
Note: See TracChangeset for help on using the changeset viewer.