Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=83f9514a0705ff3cec153e53fee0fc9d950cd0ee

commit 83f9514a0705ff3cec153e53fee0fc9d950cd0ee
Author: Michel Hermier <[email protected]>
Date:   Tue Dec 10 13:49:23 2013 +0100

libpacman: Rename time funtions to the flib namespace.

diff --git a/lib/libpacman/db.c b/lib/libpacman/db.c
index 53312fa..30a3132 100644
--- a/lib/libpacman/db.c
+++ b/lib/libpacman/db.c
@@ -209,7 +209,7 @@ int _pacman_db_gettimestamp(pmdb_t *db, time_t *timestamp)
}
}

-/* A NULL timestamp means now per _pacman_localtime definition.
+/* A NULL timestamp means now per f_localtime definition.
*/
int _pacman_db_settimestamp(pmdb_t *db, const time_t *timestamp)
{
diff --git a/lib/libpacman/io/ftp.c b/lib/libpacman/io/ftp.c
index a4e8333..b263f48 100644
--- a/lib/libpacman/io/ftp.c
+++ b/lib/libpacman/io/ftp.c
@@ -32,7 +32,7 @@

size_t _pacman_ftp_strfmdtm(char *s, size_t max, const time_t *time)
{
-       return strftime(s, max, PM_FTP_MDTM_FORMAT, _pacman_localtime(time));
+       return strftime(s, max, PM_FTP_MDTM_FORMAT, f_localtime(time));
}

char *_pacman_ftp_strpmdtm(const char *s, time_t *time)
diff --git a/lib/libpacman/util/log.c b/lib/libpacman/util/log.c
index 4694058..417c8ec 100644
--- a/lib/libpacman/util/log.c
+++ b/lib/libpacman/util/log.c
@@ -73,7 +73,7 @@ void _pacman_vlogaction(unsigned char usesyslog, FILE *f, 
const char *format, va
if(f) {
struct tm *tm;

-               tm = _pacman_localtime(NULL);
+               tm = f_localtime(NULL);
fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n",
tm->tm_mon+1, tm->tm_mday, tm->tm_year-100,
tm->tm_hour, tm->tm_min,
diff --git a/lib/libpacman/util/time.c b/lib/libpacman/util/time.c
index bd51514..ad9b056 100644
--- a/lib/libpacman/util/time.c
+++ b/lib/libpacman/util/time.c
@@ -35,7 +35,7 @@
/* Return the C locale
*/
static
-locale_t _pacman_locale_c(void)
+locale_t f_locale_c(void)
{
static locale_t locale_c = NULL;

@@ -46,7 +46,7 @@ locale_t _pacman_locale_c(void)
return locale_c;
}

-struct tm *_pacman_localtime(const time_t *timep)
+struct tm *f_localtime(const time_t *timep)
{
time_t now;

@@ -57,14 +57,14 @@ struct tm *_pacman_localtime(const time_t *timep)
return localtime(timep);
}

-size_t _pacman_strftime_lc(char *s, size_t max, const char *format, const 
struct tm *tm)
+size_t f_strftime_lc(char *s, size_t max, const char *format, const struct tm 
*tm)
{
-       return strftime_l(s, max, format, tm, _pacman_locale_c());
+       return strftime_l(s, max, format, tm, f_locale_c());
}

-char *_pacman_strptime_lc(const char *s, const char *format, struct tm *tm)
+char *f_strptime_lc(const char *s, const char *format, struct tm *tm)
{
-       return strptime_l(s, format, tm, _pacman_locale_c());
+       return strptime_l(s, format, tm, f_locale_c());
}

/* vim: set ts=2 sw=2 noet: */
diff --git a/lib/libpacman/util/time.h b/lib/libpacman/util/time.h
index dc46630..8418407 100644
--- a/lib/libpacman/util/time.h
+++ b/lib/libpacman/util/time.h
@@ -34,15 +34,15 @@ double f_difftimeval(struct timeval timeval1, struct 
timeval timeval2)

/* Return the localtime for timep. If timep is NULL, return the conversion for 
time(NULL) (libc returns NULL instead).
*/
-struct tm *_pacman_localtime(const time_t *timep);
+struct tm *f_localtime(const time_t *timep);

/* _lc means localised C */
-size_t _pacman_strftime_lc(char *s, size_t max, const char *format, const 
struct tm *tm);
-char *_pacman_strptime_lc(const char *s, const char *format, struct tm *tm);
+size_t f_strftime_lc(char *s, size_t max, const char *format, const struct tm 
*tm);
+char *f_strptime_lc(const char *s, const char *format, struct tm *tm);

-#define PM_RFC1123_FORMAT "%a, %d %b %Y %H:%M:%S %z"
-#define _pacman_strftime_rfc1123_lc(s, max, tm) _pacman_strftime_lc((s), 
(max), PM_RFC1123_FORMAT, (tm))
-#define _pacman_strptime_rfc1123_lc(s, tm) _pacman_strptime_lc((s), 
PM_RFC1123_FORMAT, (tm))
+#define F_RFC1123_FORMAT "%a, %d %b %Y %H:%M:%S %z"
+#define f_strftime_rfc1123_lc(s, max, tm) f_strftime_lc((s), (max), 
F_RFC1123_FORMAT, (tm))
+#define f_strptime_rfc1123_lc(s, tm) f_strptime_lc((s), F_RFC1123_FORMAT, (tm))

#endif /* _PACMAN_TIME_H */
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to