FACT++  1.0
int dis_get_n_clients ( unsigned  service_id)

Definition at line 1685 of file dis_old.c.

References DIM_ERROR, DIMSVCINVAL, dll_get_next(), error_handler(), serv::id, id_get_ptr(), serv::request_head, service_id, sprintf(), SRC_DIS, and str.

1686 {
1687  register REQUEST *reqp;
1688  register SERVICE *servp;
1689  register int found = 0;
1690  char str[128];
1691 
1692  DISABLE_AST
1693  if(!service_id)
1694  {
1695  sprintf(str, "Service Has Clients- Invalid service id");
1697  ENABLE_AST
1698  return(found);
1699  }
1700  servp = (SERVICE *)id_get_ptr(service_id, SRC_DIS);
1701  if(!servp)
1702  {
1703  ENABLE_AST
1704  return(found);
1705  }
1706  if(servp->id != (int)service_id)
1707  {
1708  ENABLE_AST
1709  return(found);
1710  }
1711  reqp = servp->request_head;
1712  while( (reqp = (REQUEST *) dll_get_next((DLL *)servp->request_head,
1713  (DLL *) reqp)) )
1714  {
1715  found++;
1716  }
1717  ENABLE_AST
1718  return found;
1719 }
unsigned service_id
Definition: db_dim_client.c:22
char str[80]
Definition: test_client.c:7
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
Definition: dim.h:530
Definition: dis.c:69
REQUEST * request_head
Definition: dis.c:86
#define DIMSVCINVAL
Definition: dim_common.h:290
static void error_handler(int conn_id, int severity, int errcode, char *reason)
Definition: dis_old.c:2827
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
Definition: dis.c:52
sprintf(name1,"NewService%d", i)
int id
Definition: dis.c:73

+ Here is the call graph for this function: