/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/utils.c

  • Committer: Gustav Hartvigsson
  • Date: 2016-09-08 13:10:20 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160908131020-sljicwzlrlhjvxgq
* fiddeled with the test macros to make them easyer to read
* Fixed spelling mistakes in utils.h
* Added s_current_time_full ()

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
  return ret_val;
73
73
}
74
74
 
 
75
schar *
 
76
s_current_time_full (void) {
 
77
   schar * ret_val = s_malloc (32);
 
78
   schar fmt[32];
 
79
   time_t t = time (NULL);
 
80
   struct timeval tv;
 
81
   gettimeofday (&tv, NULL);
 
82
   strftime (fmt, 50,"%Y-%m-%d %H:%M:%S.%%06uZ%z", localtime (&t));
 
83
   snprintf(ret_val, 50, fmt, tv.tv_usec);
 
84
   return ret_val;
 
85
}
 
86
 
75
87
sboolean
76
88
s_string_is_equal (const schar * a, const schar * b) {
77
89
  if (strcmp (a, b)){