FACT++  1.0
int conn_get ( )

Definition at line 79 of file conn_handler.c.

References arr_increase(), DNA_CONNECTION::busy, CONN_BLOCK, Curr_N_Conns, Dic_conns, Dna_conns, Dns_conns, i, My_type, Net_conns, SRC_DIC, SRC_DNS, and TRUE.

Referenced by ast_conn_h(), dna_open_client(), dna_open_server(), main(), and web_open_server().

80 {
81  register DNA_CONNECTION *dna_connp;
82  int i, n_conns, conn_id;
83 
84  DISABLE_AST
85  for( i = 1, dna_connp = &Dna_conns[1]; i < Curr_N_Conns; i++, dna_connp++ )
86  {
87  if( !dna_connp->busy )
88  {
89  dna_connp->busy = TRUE;
90  ENABLE_AST
91  return(i);
92  }
93  }
94  n_conns = Curr_N_Conns + CONN_BLOCK;
95  Dna_conns = arr_increase( Dna_conns, sizeof(DNA_CONNECTION), n_conns );
96  Net_conns = arr_increase( Net_conns, sizeof(NET_CONNECTION), n_conns );
97  switch(My_type)
98  {
99  case SRC_DIC :
101  n_conns );
102  break;
103  case SRC_DNS :
105  n_conns );
106  break;
107  default:
108  break;
109  }
110  conn_id = Curr_N_Conns;
111  Curr_N_Conns = n_conns;
112  Dna_conns[conn_id].busy = TRUE;
113  ENABLE_AST
114  return(conn_id);
115 }
void * arr_increase(void *conn_ptr, int conn_size, int n_conns)
Definition: conn_handler.c:126
int i
Definition: db_dim_client.c:21
#define TRUE
Definition: dim.h:135
int busy
Definition: dim.h:381
DllExp DIM_NOSHARE int Curr_N_Conns
Definition: conn_handler.c:33
DllExp DIM_NOSHARE DNS_CONNECTION * Dns_conns
Definition: conn_handler.c:29
static SRC_TYPES My_type
Definition: conn_handler.c:20
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
#define CONN_BLOCK
Definition: dim.h:162
DIM_NOSHARE DIC_CONNECTION * Dic_conns
Definition: conn_handler.c:30
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function: