Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move http_date_snprint into separate httpdate.[ch]
git-svn-id: http://svn.kfish.org/fastphoto/trunk@142 9c49b5d1-7df3-0310-bce2-b7278e68f44c
- Loading branch information
conrad
committed
Feb 16, 2006
1 parent
c11e5f7
commit 6386249
Showing
4 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "config.h" | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <time.h> | ||
|
||
static char * wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; | ||
static char * months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", | ||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; | ||
|
||
int | ||
http_date_snprint (char * buf, int n, time_t mtime) | ||
{ | ||
struct tm * g; | ||
|
||
g = gmtime (&mtime); | ||
|
||
return snprintf (buf, n, "%s, %02d %s %4d %2d:%02d:%02d GMT", | ||
wdays[g->tm_wday], g->tm_mday, months[g->tm_mon], | ||
g->tm_year + 1900, g->tm_hour, g->tm_min, g->tm_sec); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef __HTTPDATE_H__ | ||
#define __HTTPDATE_H__ | ||
|
||
int http_date_snprint (char * buf, int n, time_t mtime); | ||
|
||
|
||
#endif /* __HTTPDATE_H__ */ |