Subversion Repositories public

Rev

Rev 93 | Rev 246 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 93 Rev 136
Line 104... Line 104...
104
    if ( l == NULL ) l = garmin_alloc_list();
104
    if ( l == NULL ) l = garmin_alloc_list();
105
    n = malloc(sizeof(garmin_list_node));
105
    n = malloc(sizeof(garmin_list_node));
106
 
106
 
107
    n->data = data;
107
    n->data = data;
108
    n->next = NULL;
108
    n->next = NULL;
109
    
109
 
110
    if ( l->head == NULL ) l->head = n;
110
    if ( l->head == NULL ) l->head = n;
111
    if ( l->tail != NULL ) l->tail->next = n;
111
    if ( l->tail != NULL ) l->tail->next = n;
112
    l->tail = n;
112
    l->tail = n;
113
    
113
 
114
    l->elements++;
114
    l->elements++;
115
  }
115
  }
116
 
116
 
117
  return l;
117
  return l;
118
}
118
}
Line 275... Line 275...
275
garmin_data_size ( garmin_data * d )
275
garmin_data_size ( garmin_data * d )
276
{
276
{
277
  garmin_list *       list;
277
  garmin_list *       list;
278
  garmin_list_node *  node;
278
  garmin_list_node *  node;
279
  uint32              bytes = 0;
279
  uint32              bytes = 0;
-
 
280
  char                hv0[256];
280
 
281
 
281
  /* 
282
  /* 
282
     The number of bytes needed in order to serialize a Garmin data structure
283
     The number of bytes needed in order to serialize a Garmin data structure
283
     is almost equal to the size of its data structure - but not quite.  If
284
     is almost equal to the size of its data structure - but not quite.  If
284
     we have variable length strings, we need to add their string lengths
285
     we have variable length strings, we need to add their string lengths
Line 412... Line 413...
412
	DATASIZE0(1011);
413
	DATASIZE0(1011);
413
	DATASIZE0(1012);
414
	DATASIZE0(1012);
414
	DATASIZE0(1013);
415
	DATASIZE0(1013);
415
	DATASIZE0(1015);
416
	DATASIZE0(1015);
416
	default:
417
	default:
417
	  printf("garmin_data_size: data type %d not supported\n",d->type);
418
	  sprintf(hv0, "garmin_data_size: data type %d not supported!",d->type);
-
 
419
	  garmin_queue_error(hv0, err_warning);
418
	  break;
420
	  break;
419
	}
421
	}
420
      }
422
      }
421
    }
423
    }
422
  }
424
  }