FACT++  1.0
int id_get ( void *  ptr,
SRC_TYPES  type 
)

Definition at line 152 of file conn_handler.c.

References Curr_id, Curr_N_Ids, i, id, id_arr_create(), id_arr_increase(), ID_BLOCK, id_item::ptr, and id_item::type.

Referenced by dis_insert_request(), dis_start_serving_dns(), dna_write(), do_dis_add_cmnd_dns(), do_dis_add_service_dns(), and insert_service().

153 {
154  register int i, id;
155  register ID_ITEM *idp;
156 
157  DISABLE_AST
158  if(!Curr_N_Ids)
159  {
160  id_arr_create();
161  }
162  for( i = Curr_id, idp = &Id_arr[Curr_id]; i < Curr_N_Ids; i++, idp++ )
163  {
164  if( !idp->type )
165  {
166  idp->ptr = ptr;
167  idp->type = type;
168  Curr_id = i;
169  ENABLE_AST
170  return(i);
171  }
172  }
173  Id_arr = id_arr_increase( Id_arr, sizeof(ID_ITEM), Curr_N_Ids + ID_BLOCK );
174  id = Curr_N_Ids;
175  idp = &Id_arr[id];
176  idp->ptr = ptr;
177  idp->type = type;
178  Curr_N_Ids += ID_BLOCK;
179  Curr_id = id;
180  ENABLE_AST
181  return(id);
182 }
static int Curr_N_Ids
Definition: conn_handler.c:46
static int Curr_id
Definition: conn_handler.c:47
static ID_ITEM * Id_arr
Definition: conn_handler.c:42
int i
Definition: db_dim_client.c:21
char id[4]
Definition: FITS.h:71
SRC_TYPES type
Definition: conn_handler.c:39
#define ID_BLOCK
Definition: dim.h:164
int type
void * id_arr_increase(void *id_ptr, int id_size, int n_ids)
Definition: conn_handler.c:143
void id_arr_create()
Definition: conn_handler.c:135
void * ptr
Definition: conn_handler.c:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function: