Add_Int_Timeval static struct timeval Add_Int_Timeval(int inc, struct timeval t){ struct timeval r; r.tv_usec = t.tv_usec + (inc % 1000); r.tv_sec = t.tv_sec + inc / 1000; if(r.tv_usec > 999){ r.tv_usec -= 1000; r.tv_sec++; } return(r); } Add_Timeval_Int static struct timeval Add_Timeval_Int(struct timeval t, int inc){ struct timeval r; r.tv_usec = t.tv_usec + (inc % 1000); r.tv_sec = t.tv_sec + inc / 1000; if(r.tv_usec > 999){ r.tv_usec -= 1000; r.tv_sec++; } return(r); } Subtract_Timeval_Int static struct timeval Subtract_Timeval_Int(struct timeval t, int inc){ struct timeval r; r.tv_usec = t.tv_usec - (inc % 1000); r.tv_sec = t.tv_sec - inc / 1000; if(r.tv_usec < 0){ r.tv_usec += 1000; r.tv_sec--; } return(r); } Divide_Timeval_Int static struct timeval Divide_Timeval_Int(struct timeval t, int d){ struct timeval r; r.tv_sec = t.tv_sec / d; r.tv_usec = (t.tv_usec + 1000*( t.tv_sec % d )) / d; return(r); } Subtract_Timeval_Timeval static int Subtract_Timeval_Timeval(struct timeval t1, struct timeval t2){ return(1000*(t1.tv_sec - t2.tv_sec) + (t1.tv_usec - t2.tv_usec) ); } Compare_Timeval static int Compare_Timeval(struct timeval t1, struct timeval t2){ return( t1.tv_sec != t2.tv_sec ? t1.tv_sec - t2.tv_sec : t1.tv_usec - t2.tv_usec ); } Timeval_Constructor static struct timeval Timeval_Constructor(int s, int m){ struct timeval r; r.tv_sec = s; r.tv_usec = m; return(r); } String_Constructor static struct gs_string String_Constructor(char *l){ struct gs_string s; s.data = l; s.owner = NULL; s.length = 0; while(l[s.length] != '\0') s.length++; return(s); } Compare_String str_assign_with_copy str_assign_with_copy_in_tuple str_replace str_length str_destroy