Exemplo n.º 1
0
RoadMapHash *roadmap_hash_new (const char *name, int size) {

   int i;
   RoadMapHash *hash = malloc (sizeof(RoadMapHash));

   roadmap_check_allocated(hash);

   hash->name = name;

   for (i = 0; i < ROADMAP_HASH_MODULO; i++) {
      hash->head[i] = -1;
   }

   hash->size = size;
   hash->next = malloc (size * sizeof(int));
   hash->values = NULL;

   roadmap_check_allocated(hash->next);

   for (i = 0; i < size; i++) {
      hash->next[i] = -1;
   }

   hash->next_hash = HashLast;
   HashLast = hash;

   return hash;
}
Exemplo n.º 2
0
static void roadmap_path_list_create(const char *name,
                            const char *items[],
                            const char *preferred)
{
   int i;
   int count;
   RoadMapPathList new_path;

   for (count = 0; items[count] != NULL; ++count) ;

   new_path = malloc (sizeof(struct RoadMapPathRecord));
   roadmap_check_allocated(new_path);

   new_path->next  = RoadMapPaths;
   new_path->name  = strdup(name);
   new_path->count = count;

   new_path->items = calloc (count, sizeof(char *));
   roadmap_check_allocated(new_path->items);

   for (i = 0; i < count; ++i) {
      new_path->items[i] = roadmap_path_expand (items[i], strlen(items[i]));
   }
   new_path->preferred  = roadmap_path_expand (preferred, strlen(preferred));

   RoadMapPaths = new_path;
}
Exemplo n.º 3
0
RoadMapPen roadmap_canvas_create_pen (const char *name)
{
   struct roadmap_canvas_pen *pen;

   for (pen = RoadMapPenList; pen != NULL; pen = pen->next) {
      if (strcmp(pen->name, name) == 0) break;
   }

   if (pen == NULL) {

      pen = new roadmap_canvas_pen();
      roadmap_check_allocated(pen);

      pen->name = strdup (name);
      pen->color = agg::rgba8(0, 0, 0);
      pen->thickness = 1;
      pen->next = RoadMapPenList;

      RoadMapPenList = pen;
   }

   roadmap_canvas_select_pen (pen);
   roadmap_canvas_set_thickness (pen->thickness);

   return pen;
}
Exemplo n.º 4
0
static int roadmap_db_call_map (roadmap_db_database *database) {

   roadmap_db_model *model;
   int res = 1;
   
   for (model = database->model;
   	  model != NULL;
   	  model = model->next) {
   
  		void *handler_context = NULL;
		roadmap_db_context *context;
  		
   	if (roadmap_db_sector_size (&(database->data), &model->sector)) {
   	   		
   		handler_context = model->handler->map (&database->data);
   		if (!handler_context) res = 0;
   	}
   	
		context = (roadmap_db_context *) malloc (sizeof (roadmap_db_context));	
		roadmap_check_allocated (context);
			
		context->model = model;
		context->next = database->context;
		context->handler_context = handler_context;
	
      database->context = context;
   }

   return res;
}
Exemplo n.º 5
0
void roadmap_hash_resize (RoadMapHash *hash, int size) {

   int i;

   hash->next = realloc (hash->next, size * sizeof(int));
   roadmap_check_allocated(hash->next);

   if (hash->values != NULL) {
      hash->values = realloc (hash->values, size * sizeof(void *));
      roadmap_check_allocated(hash->values);
   }

   for (i = hash->size; i < size; i++) {
      hash->next[i] = -1;
   }
   hash->size = size;
}
Exemplo n.º 6
0
SsdWidget ssd_dialog_new (const char *name, const char *title,
                          PFN_ON_DIALOG_CLOSED on_dialog_closed, int flags)
{
   SsdDialog   dialog;

   int width   = SSD_MAX_SIZE;
   int height  = SSD_MAX_SIZE;

   dialog = (SsdDialog)calloc( sizeof( struct ssd_dialog_item), 1);
   roadmap_check_allocated(dialog);

   dialog->name                  = strdup(name);
   dialog->on_dialog_closed      = on_dialog_closed;
   dialog->in_focus              = NULL;
   dialog->tab_order_sorted      = FALSE;
   dialog->gui_tab_order_sorted  = FALSE;
   dialog->use_gui_tab_order     = (SSD_DIALOG_GUI_TAB_ORDER & flags)? TRUE: FALSE;
   dialog->ntv_kb_action = _ntv_kb_action_hide;
   memset( &dialog->ntv_kb_params, 0, sizeof( RMNativeKBParams ) );

   if (flags & SSD_DIALOG_FLOAT) {
      if (flags & SSD_DIALOG_VERTICAL)
         width = SSD_MIN_SIZE;
      else
         width = SSD_MAX_SIZE;
      height = SSD_MIN_SIZE;
   }

   if (flags & SSD_DIALOG_NO_SCROLL) {
      flags &= ~SSD_DIALOG_NO_SCROLL;
      dialog->scroll = FALSE;
   }
   else{
      dialog->scroll = TRUE;
   }

   dialog->container = ssd_container_new (name, title, width, height, flags);
   dialog->next      = RoadMapDialogWindows;

   if (!(flags & SSD_DIALOG_FLOAT)){
      dialog->scroll_container = ssd_container_new (name, title, width, SSD_MIN_SIZE, 0);
      ssd_widget_set_color(dialog->scroll_container, NULL, NULL);
      ssd_widget_add(dialog->container, dialog->scroll_container);
      dialog->stop_offset = 0;
   }

   RoadMapDialogWindows = dialog;

   ssd_widget_set_right_softkey_text(dialog->container, roadmap_lang_get("Back_key"));
   ssd_widget_set_left_softkey_text (dialog->container, roadmap_lang_get("Exit_key"));

   if (!(flags & SSD_DIALOG_FLOAT))
      return dialog->scroll_container;
   else
      return dialog->container;
}
Exemplo n.º 7
0
static AtlasNode *create_new_node(void) {
   AtlasNode *n = (AtlasNode *)malloc(sizeof(AtlasNode));
   roadmap_check_allocated(n);
   
   n->image = NULL;
   n->child[0] = NULL;
   n->child[1] = NULL;   

   return n;   
}
Exemplo n.º 8
0
static char *roadmap_bar_object_string (const char *data, int length) {

    char *p = malloc (length+1);

    roadmap_check_allocated(p);

    strncpy (p, data, length);
    p[length] = 0;

    return p;
}
Exemplo n.º 9
0
static char *roadmap_path_cat (const char *s1, const char *s2)
{
   char *result = malloc (strlen(s1) + strlen(s2) + 4);

   roadmap_check_allocated (result);

   strcpy (result, s1);
   strcat (result, "\\");
   strcat (result, s2);

   return result;
}
Exemplo n.º 10
0
int roadmap_ssl_open ( RoadMapSocket s, void *data, RoadMapNetSslConnectCallback callback )
{
   static BOOL initialized = FALSE;
   const SSL_METHOD *method;
   SSL_CTX *ctx;
   SSL *ssl;

   // Initialize the library
   if ( !initialized )
   {
      SSL_library_init();
   }
   /*
    * Initialize the ssl context
    */
   OpenSSL_add_all_algorithms();      /* Load cryptos, et.al. */
   SSL_load_error_strings();          /* Bring in and register error messages */
   method = SSLv23_client_method();    /* Create new client-method instance */
   ctx = SSL_CTX_new( method );       /* Create new context */
   if ( ctx == NULL )
   {
      roadmap_log( ROADMAP_ERROR, "Error obtaining ssl context: %s !!", last_err_string() );
      return 0;
   }

   ssl = SSL_new( ctx );                /* SSL connection state */
   SSL_set_fd( ssl, roadmap_net_get_fd( s ) );             /* Attach the socket */

   /*
    * Initialize the io context
    */

   RoadMapSslIO ssl_io_ctx = malloc( sizeof( struct roadmap_ssl_io_t ) );
   roadmap_check_allocated( ssl_io_ctx );

   ssl_io_ctx->ctx = ctx;
   ssl_io_ctx->ssl = ssl;
   ssl_io_ctx->s = s;
   ssl_io_ctx->data = data;
   ssl_io_ctx->on_connect = callback;

   if ( SSL_connect(ssl) == -1 )       /* perform the connection */
   {
      roadmap_log( ROADMAP_ERROR, "Error connecting ssl!!" );
      log_ssl();
      callback( s, data, ssl_io_ctx, err_net_failed );
      return 0;
   }

   callback( s, data, ssl_io_ctx, succeeded );

   return 1;
}
Exemplo n.º 11
0
SsdWidget ssd_widget_new (const char *name,
                          CB_OnWidgetKeyPressed pfn_on_key_pressed,
                          int flags) {

   static int tab_order_sequence = 0;

   SsdWidget w;

 //  	if (widget_cache == NULL)
	//{
	//	widget_cache = roadmap_hash_new ("widget_cache", 500);
	//}

   w = (SsdWidget) calloc (1, sizeof (*w));

   roadmap_check_allocated(w);

 //  	int hash = roadmap_hash_string (name);
	//roadmap_hash_add (widget_cache, hash, widget_index);
	//roadmap_hash_set_value (widget_cache, widget_index++, w);

   w->name           = strdup(name);
   w->size.height    = SSD_MIN_SIZE;
   w->size.width     = SSD_MIN_SIZE;
   w->in_focus       = FALSE;
   w->focus_highlight = TRUE;
   w->default_widget = (SSD_WS_DEFWIDGET  & flags)? TRUE: FALSE;
   w->tab_stop       = (SSD_WS_TABSTOP & flags)? TRUE: FALSE;
   w->prev_tabstop   = NULL;
   w->next_tabstop   = NULL;
   w->tabstop_left   = NULL;
   w->tabstop_right  = NULL;
   w->tabstop_above  = NULL;
   w->tabstop_below  = NULL;
   w->parent_dialog  = NULL;
   w->get_input_type = NULL;
   w->pointer_down   = NULL;
   w->pointer_up     = NULL;
   w->release = NULL;
   w->tab_sequence   = tab_order_sequence++;
   w->force_click  = FALSE;

   memset( &w->click_offsets, 0, sizeof( SsdClickOffsets ) );

   if( pfn_on_key_pressed)
      w->key_pressed = pfn_on_key_pressed;
   else
      w->key_pressed = ssd_widget_default_on_key_pressed;

   w->cached_size.height = w->cached_size.width = -1;

   return w;
}
Exemplo n.º 12
0
static BarObject *roadmap_bar_new
          (int argc, const char **argv, int *argl) {

   BarObject *object = calloc(sizeof(*object), 1);

   roadmap_check_allocated(object);

   object->name = roadmap_bar_object_string (argv[1], argl[1]);
   object->text_alling = -1;
   object->text_color = NULL;

   return object;
}
Exemplo n.º 13
0
static void *roadmap_square_map (const roadmap_db_data_file *file) {

   RoadMapSquareContext *context;

   int i;

	roadmap_city_init ();

   context = malloc(sizeof(RoadMapSquareContext));
   roadmap_check_allocated(context);

	RoadMapSquareActive = context;

   context->type = RoadMapSquareType;

   if (!roadmap_db_get_data (file,
   								  model__county_global_data,
   								  sizeof (RoadMapGlobal),
   								  (void**)&(context->SquareGlobal),
   								  NULL)) {
      roadmap_log (ROADMAP_FATAL, "invalid global/data structure");
   }

   context->Square = calloc (ROADMAP_SQUARE_CACHE_SIZE, sizeof (RoadMapSquareData *));
   roadmap_check_allocated(context->Square);

	for (i = 0; i <= ROADMAP_SQUARE_CACHE_SIZE; i++) {
		context->SquareCache[i].square = -1;
		context->SquareCache[i].next = (i + 1) % (ROADMAP_SQUARE_CACHE_SIZE + 1);
		context->SquareCache[i].prev = (i + ROADMAP_SQUARE_CACHE_SIZE) % (ROADMAP_SQUARE_CACHE_SIZE + 1);
	}

	context->SquareHash = roadmap_hash_new ("tiles", ROADMAP_SQUARE_CACHE_SIZE);

   RoadMapSquareCurrent = -2;

   RoadMapSquareActive = NULL;
   return context;
}
Exemplo n.º 14
0
//static int TotalSquares = 0;
static void *roadmap_square_map_one (const roadmap_db_data_file *file) {

   RoadMapSquareData *context;

   int j;
   int index;
   int slot;

   context = malloc(sizeof(RoadMapSquareData));
   roadmap_check_allocated(context);

   if (!roadmap_db_get_data (file,
   								  model__tile_square_data,
   								  sizeof (RoadMapSquare),
   								  (void**)&(context->square),
   								  NULL)) {
      roadmap_log (ROADMAP_FATAL, "invalid square/data structure");
   }

	index = context->square->square_id;
	roadmap_tile_edges (index,
							  &context->edges.west,
							  &context->edges.east,
							  &context->edges.south,
							  &context->edges.north);

	RoadMapSquareCurrent = index;
    slot = roadmap_square_cache (index);
	RoadMapSquareActive->Square[slot] = context;
	RoadMapSquareCurrentSlot = slot;

	//printf ("roadmap_square_map_one: slot %d tile %d\n", RoadMapSquareCurrentSlot, RoadMapSquareCurrent);

	roadmap_hash_add (RoadMapSquareActive->SquareHash, index, slot);


   for (j = 0; j < NUM_SUB_HANDLERS; j++) {
   	if (roadmap_db_exists (file, &(SquareHandlers[j].sector))) {

         context->subs[j] = SquareHandlers[j].handler->map(file);
			SquareHandlers[j].handler->activate (context->subs[j]);
      } else {
         context->subs[j] = NULL;
      }
   }

	context->attributes = 0;

   //printf ("Loaded square %d, total squares = %d\n", index, ++TotalSquares);
   return context;
}
Exemplo n.º 15
0
static RoadMapScreenObj roadmap_screen_obj_new
          (int argc, const char **argv, int *argl) {

   RoadMapScreenObj object = calloc(sizeof(*object), 1);

   roadmap_check_allocated(object);

   object->name = roadmap_object_string (argv[1], argl[1]);

   object->next = RoadMapObjectList;
   RoadMapObjectList = object;

   return object;
}
Exemplo n.º 16
0
static struct dictionary_volume *
         roadmap_dictionary_initialize_one (const roadmap_db_data_file *file,
         											  unsigned int id,
         											  const char *name,
         											  struct dictionary_volume *first) {

   struct dictionary_volume *dictionary;
   void *data;
   int size;

   if (!roadmap_db_get_data (file,
   								  id,
   								  sizeof (char),
   								  &data,
   								  &size)) {

   	roadmap_log (ROADMAP_ERROR, "invalid dictionary structure");
   	return first;
   }

   if (!data) return first;


   /* Retrieve all the database sections: */

   dictionary = malloc (sizeof(struct dictionary_volume));

   roadmap_check_allocated(dictionary);

   dictionary->name = name;

   dictionary->data = data;
   dictionary->size = size;

   dictionary->tree = NULL;
   dictionary->tree_count = 0;

   dictionary->reference = NULL;
   dictionary->reference_count = 0;

   dictionary->string_index = NULL;
   dictionary->string_count = 0;

   dictionary->subtrees = NULL;
   dictionary->subtrees_count = 0;

	dictionary->next = first;

   return dictionary;
}
Exemplo n.º 17
0
void  roadmap_hash_set_value (RoadMapHash *hash, int index, void *value) {

   if ((index < 0) || (index > hash->size)) {
      roadmap_log (ROADMAP_FATAL, "invalid index %d in hash table %s",
                         index, hash->name);
   }

   if (hash->values == NULL) {
      hash->values = calloc (hash->size, sizeof(void *));
      roadmap_check_allocated(hash->values);
   }

   hash->values[index] = value;
}
Exemplo n.º 18
0
char *roadmap_path_remove_extension (const char *name)
{
   char *result;
   char *p;


   result = strdup(name);
   roadmap_check_allocated(result);

   p = roadmap_path_skip_directories (result);
   p = strrchr (p, '.');
   if (p != NULL) *p = 0;

   return result;
}
Exemplo n.º 19
0
roadmap_db_model *roadmap_db_register
                      (roadmap_db_model *model,
                       const roadmap_db_sector *sector,
                       roadmap_db_handler *handler) {

   roadmap_db_model *registered;

   registered = malloc (sizeof(roadmap_db_model));

   roadmap_check_allocated(registered);

   registered->sector  = *sector;
   registered->handler = handler;
   registered->next    = model;

   return registered;
}
Exemplo n.º 20
0
/*  Name        : download_url( const char* voice_id )
 *  Purpose     : Returns the url constructed from the given voice id
 *
 */
static char* get_download_url( const char* voice_id )
{
    char* url;
    const char* url_prefix;

    url_prefix = roadmap_config_get ( &RMCfgRecorderVoiceUrlPrefix );

    // Size of prefix +  size of voice id + '\0'
    url = malloc( strlen( url_prefix ) + strlen( voice_id ) + 1 );

    roadmap_check_allocated( url );

    strcpy( url, url_prefix );
    strcat( url, voice_id );

    return url;
}
Exemplo n.º 21
0
static void roadmap_locator_configure (void) {

   roadmap_config_declare
       ("preferences", &RoadMapConfigStaticCounty, "0", NULL);

   if (RoadMapCountyCache == NULL) {

		roadmap_db_sector sector_global = {model__county_global_first, model__county_global_last};
		roadmap_db_sector sector_square = {model__tile_square_first, model__tile_square_last};
		
      RoadMapCountyModel =
         roadmap_db_register
            (RoadMapCountyModel, &sector_global, &RoadMapSquareHandler);
/*
      RoadMapUsModel =
         roadmap_db_register
            (RoadMapUsModel, "county", &RoadMapCountyHandler);
*/
      RoadMapTileModel =
         roadmap_db_register
            (RoadMapTileModel, &sector_square, &RoadMapSquareOneHandler);

      RoadMapCountyCacheSize = roadmap_option_cache ();
      if (RoadMapCountyCacheSize < ROADMAP_CACHE_SIZE) {
         RoadMapCountyCacheSize = ROADMAP_CACHE_SIZE;
      }
      RoadMapCountyCache = (struct roadmap_cache_entry *)
         calloc (RoadMapCountyCacheSize, sizeof(struct roadmap_cache_entry));
      roadmap_check_allocated (RoadMapCountyCache);
   }

   if (roadmap_config_get_integer(&RoadMapConfigStaticCounty) != 0) return;
/*
   if (!RoadMapUsdirActive) {
      if (! roadmap_db_open ("usdir", NULL, RoadMapUsModel, "r")) {
         roadmap_log (ROADMAP_ERROR, "cannot open directory database (usdir)");
         return;
      }

      RoadMapUsCityDictionary   = roadmap_dictionary_open ("city");
      RoadMapUsStateDictionary  = roadmap_dictionary_open ("state");

      RoadMapUsdirActive = 1;
   }
*/
}
Exemplo n.º 22
0
int roadmap_db_open (int fips, int tile_index, roadmap_db_model *model,
                     const char* mode) {

   void *base = NULL;
   size_t size = 0;

   roadmap_db_database *database = roadmap_db_find (fips, tile_index);

   if (database) {

      roadmap_db_call_activate (database);
      return 1; /* Already open. */
   }

   if (roadmap_tile_load(fips, tile_index, &base, &size) != 0) {
   
	  return 0;
   }

   roadmap_log (ROADMAP_INFO, "Opening database file fips:%d, index:%d", fips, tile_index);
   database = malloc(sizeof(*database));
   roadmap_check_allocated(database);

   database->fips = fips;
   database->tile_index = tile_index;
	
	if (!roadmap_db_fill_data (database, base, (unsigned int) size)) {
	      
	   roadmap_log (ROADMAP_INFO, "tile %d (fips %d) has invalid format", tile_index, fips);
	   free (base);
      free (database);
      roadmap_tile_remove (fips, tile_index);
      return 0;
	}
	
#ifndef NO_MAP_COMPRESSION
   // we use the base pointer as there's no compression.
   free(base);
#endif

   database->model = model;
   database->context = NULL;

   return add_db_and_map(database);
}
Exemplo n.º 23
0
static RoadMapSprite roadmap_sprite_new
          (int argc, const char **argv, int *argl) {

   RoadMapSprite sprite = malloc(sizeof(*sprite));

   roadmap_check_allocated(sprite);

   memset (sprite, 0, sizeof(*sprite));

   sprite->name = roadmap_sprite_string (argv[1], argl[1]);

   sprite->first.pen = roadmap_canvas_create_pen ("Black");

   sprite->next = RoadMapSpriteList;
   RoadMapSpriteList = sprite;

   return sprite;
}
Exemplo n.º 24
0
RoadMapHttpCompCtx roadmap_http_comp_init (void) {

   int res;
   RoadMapHttpCompCtx ctx = (RoadMapHttpCompCtx) calloc(1, sizeof(struct roadmap_http_comp_t));

   roadmap_check_allocated(ctx);

   if ((res = inflateInit2( &ctx->stream, -1 * ZLIB_WIN_SIZE )) != Z_OK) {
      roadmap_log(ROADMAP_ERROR, "Error initializing deflate - %d\n", res);
      inflateEnd(&ctx->stream);
      free(ctx);
      return NULL;
   }

   ctx->state = STATE_READ_HEADERS;

   return ctx;
}
Exemplo n.º 25
0
static void *roadmap_shape_map (const roadmap_db_data_file *file) {

   RoadMapShapeContext *context;

   context = malloc(sizeof(RoadMapShapeContext));
   roadmap_check_allocated(context);

   context->type = RoadMapShapeType;

   if (!roadmap_db_get_data (file,
   								  model__tile_shape_data,
   								  sizeof (RoadMapShape),
   								  (void**)&(context->Shape),
   								  &(context->ShapeCount))) {
      roadmap_log (ROADMAP_FATAL, "invalid shape/data structure");
   }

   return context;
}
Exemplo n.º 26
0
static int roadmap_locator_allocate (int **fips) {

   int count;

   roadmap_locator_configure();

   if (roadmap_config_get_integer(&RoadMapConfigStaticCounty) != 0) {
      count = 1;
   } else {
      count = roadmap_county_count();
   }

   if (*fips == NULL) {
      *fips = calloc (count, sizeof(int));
      roadmap_check_allocated(*fips);
   }

   return count;
}
Exemplo n.º 27
0
static AtlasRoot create_new_root (const char *hint, int min_filter, int mag_filter) {
   AtlasRoot root;
   GLuint texture;
   GLubyte* temp_buf;
   int i, j;
   
#ifdef ANDROID
   // Should be reduced when stable AGA
   roadmap_log (ROADMAP_WARNING, "roadmap_canvas_atlas - creating new root for hint '%s'", hint);
#else
   roadmap_log (ROADMAP_DEBUG, "roadmap_canvas_atlas - creating new root for hint '%s'", hint);
#endif

   glGenTextures( 1, &texture);
   roadmap_canvas_bind(texture);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
   check_gl_error();
   temp_buf= malloc(4 * CANVAS_ATLAS_TEX_SIZE * CANVAS_ATLAS_TEX_SIZE);
   roadmap_check_allocated (temp_buf);
   for( j = 0; j < CANVAS_ATLAS_TEX_SIZE; j++) {
      for( i = 0; i < CANVAS_ATLAS_TEX_SIZE; i++){
         temp_buf[4*(i+j*CANVAS_ATLAS_TEX_SIZE)] = 255;
         temp_buf[4*(i+j*CANVAS_ATLAS_TEX_SIZE) +1] = 255;
         temp_buf[4*(i+j*CANVAS_ATLAS_TEX_SIZE) +2] = 255;
         temp_buf[4*(i+j*CANVAS_ATLAS_TEX_SIZE) +3] = 0;
      }
   }

   glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, CANVAS_ATLAS_TEX_SIZE, CANVAS_ATLAS_TEX_SIZE, 0,
                GL_RGBA, GL_UNSIGNED_BYTE, temp_buf );
   check_gl_error();
   free(temp_buf);
   
   root.root_node = create_new_node();
   root.root_node->rect.minx = root.root_node->rect.miny = 0;
   root.root_node->rect.maxx = root.root_node->rect.maxy = CANVAS_ATLAS_TEX_SIZE - 1;
   root.texture = texture;
   strncpy_safe (root.hint, hint, sizeof(root.hint));
   
   return root;
}
Exemplo n.º 28
0
void roadmap_layer_initialize (void) {

    if (RoadMapCategory != NULL) return;


    RoadMapCategoryCount =
       sizeof(RoadMapDefaultCategoryTable) / sizeof(char *);

    RoadMapCategory =
        calloc (RoadMapCategoryCount + 1, sizeof(*RoadMapCategory));

    roadmap_check_allocated(RoadMapCategory);

    roadmap_config_declare_enumeration
       ("preferences", &RoadMapConfigStylePretty, NULL, "yes", "no", NULL);

    // TODO : Add Boolean that says if we use pen or pen new
    roadmap_layer_reload_internal();
    roadmap_skin_register(roadmap_layer_reset);
    roadmap_skin_register (roadmap_layer_reload);
}
Exemplo n.º 29
0
/*  Name        : get_upload_url( void )
 *  Purpose     : Returns the url constructed from the server and session id
 *
 */
static char* get_upload_url( void )
{
    char* url;
    const char* url_prefix;
    int size;

    url_prefix = roadmap_config_get ( &RMCfgRecorderVoiceServer );

    // Size of prefix +  size of session id + cookie '\0'
    size = strlen( url_prefix ) + 50 + strlen (Realtime_GetServerCookie()) + 1;
    url = malloc( size );

    roadmap_check_allocated( url );

    snprintf(url, size, "%s?sessionid=%d&cookie=%s",
             url_prefix,
             Realtime_GetServerId(),
             Realtime_GetServerCookie());

    return url;
}
Exemplo n.º 30
0
RoadMapDynamicString roadmap_string_new_in_collection
                          (const char *value,
                           RoadMapDynamicStringCollection *collection) {

   RoadMapDynamicString item = roadmap_string_new (value);

   while (collection->next != NULL) collection = collection->next;

   if (collection->count >= ROADMAP_STRING_COLLECTION_BLOCK) {

      collection->next = malloc (sizeof(RoadMapDynamicStringCollection));
      roadmap_check_allocated(collection->next);

      collection = collection->next;
      collection->count = 0;
   }

   collection->element[collection->count++] = item;

   return item;
}