FACT++  1.0
int dis_get_timestamp ( unsigned  serv_id,
int *  secs,
int *  millisecs 
)

Definition at line 2011 of file dis.c.

References DIM_ERROR, DIMSVCINVAL, error_handler(), serv::id, id_get_ptr(), serv_id, sprintf(), SRC_DIS, str, serv::user_millisecs, and serv::user_secs.

Referenced by dis_hash_print().

2012 {
2013  register SERVICE *servp;
2014  char str[128];
2015 
2016  DISABLE_AST
2017  *secs = 0;
2018  *millisecs = 0;
2019  if(!serv_id)
2020  {
2021  sprintf(str,"Get Timestamp - Invalid service id");
2022  error_handler(0, DIM_ERROR, DIMSVCINVAL, str, -1);
2023  ENABLE_AST
2024  return(0);
2025  }
2026  servp = (SERVICE *)id_get_ptr(serv_id, SRC_DIS);
2027  if(!servp)
2028  {
2029  ENABLE_AST
2030  return(0);
2031  }
2032  if(servp->id != (int)serv_id)
2033  {
2034  ENABLE_AST
2035  return(0);
2036  }
2037  if(servp->user_secs)
2038  {
2039  *secs = servp->user_secs;
2040  *millisecs = servp->user_millisecs;
2041  }
2042 /*
2043  else
2044  {
2045  *secs = 0;
2046  *millisecs = 0;
2047  }
2048 */
2049  ENABLE_AST
2050  return(1);
2051 }
int user_millisecs
Definition: dis.c:84
static void error_handler(int conn_id, int severity, int errcode, char *reason, int exit)
Definition: dis.c:3199
char str[80]
Definition: test_client.c:7
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
Definition: dis.c:69
int user_secs
Definition: dis.c:83
#define DIMSVCINVAL
Definition: dim_common.h:290
int serv_id
Definition: demo_server.c:5
sprintf(name1,"NewService%d", i)
int id
Definition: dis.c:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function: