Author: biurrun Date: Thu Nov 26 17:48:44 2009 New Revision: 1832 Log: Remove unused function compare_time_strings(). Modified: trunk/pairing/common.c trunk/pairing/common.h Modified: trunk/pairing/common.c ============================================================================== --- trunk/pairing/common.c Thu Nov 26 17:44:42 2009 (r1831) +++ trunk/pairing/common.c Thu Nov 26 17:48:44 2009 (r1832) @@ -148,40 +148,6 @@ } -/** - * Compares two time strings with the date format EXPIRATION_DATE_FORMAT - * and returns the difference in seconds. - * - * @param time1 The first time string - * @param time2 The second time string - * - * @return time2 - time1 - */ -int compare_time_strings(const char *time1,const char *time2) -{ - struct tm tm_time1,tm_time2; - char *c; - - // Date format: yyyy-mm-dd hh:mm:ss (24 hour clock) - c = strptime(time1, EXPIRATION_DATE_FORMAT, &tm_time1); - if ((c == NULL) || (*c != 0)) // If c does not point to the terminating character of the string - { // then strptime did not make it all of the way through the string. - DEBUG("Could not parse time-and-date string."); - return 0; - } - - // Date format: dd-mm-yyyy hh:mm:ss (24 hour clock) - c = strptime(time2, EXPIRATION_DATE_FORMAT, &tm_time2); - if ((c == NULL) || (*c != 0)) // If c does not point to the terminating character of the string - { // then strptime did not make it all of the way through the string. - DEBUG("Could not parse time-and-date string."); - return 0; - } - - return difftime(mktime(&tm_time1),mktime(&tm_time2)); - -} - /** Converts a date in human-readable format to its time in seconds. * * @param expiration_date Pointer to the string containing the human-readable version. Modified: trunk/pairing/common.h ============================================================================== --- trunk/pairing/common.h Thu Nov 26 17:44:42 2009 (r1831) +++ trunk/pairing/common.h Thu Nov 26 17:48:44 2009 (r1832) @@ -29,7 +29,6 @@ int get_default_expiration(char *buffer); int get_default_expiration_from_config(char *buffer,const char *filename); int valid_date_string(const char *expiration_date,struct tm *tm_expiration); -int compare_time_strings(const char *time1,const char *time2); int convert_time_t_to_formatted_string(time_t *time,char *buffer); int get_expiration_time(char *expiration_duration, long int *expiration_seconds);