Lines Matching refs:s

42 http_date_parse_RFC_850 (const char *s, struct tm * const tm)  in http_date_parse_RFC_850()  argument
79 if (s[0] == p[0] && s[1] == p[1] && s[2] == p[2]) break; in http_date_parse_RFC_850()
84 s += 3; in http_date_parse_RFC_850()
85 while (*s != ',' && *s != '\0') ++s; in http_date_parse_RFC_850()
87 if (s[0] != ',' || s[1] != ' ' in http_date_parse_RFC_850()
88 || !light_isdigit(s[2]) || !light_isdigit(s[3])) in http_date_parse_RFC_850()
90 tm->tm_mday = tens[(s[2]-'0')] + (s[3]-'0'); in http_date_parse_RFC_850()
92 if ( s[4] != '-') return NULL; in http_date_parse_RFC_850()
95 if (s[5] == p[0] && s[6] == p[1] && s[7] == p[2]) break; in http_date_parse_RFC_850()
100 if (s[8] != '-' || !light_isdigit(s[9]) || !light_isdigit(s[10])) in http_date_parse_RFC_850()
102 tm->tm_year = tens[(s[9]-'0')] + (s[10]-'0') + tm_year_base; in http_date_parse_RFC_850()
105 if (s[11] != ' ' || !light_isdigit(s[12]) || !light_isdigit(s[13])) in http_date_parse_RFC_850()
107 tm->tm_hour = tens[(s[12]-'0')] + (s[13]-'0'); in http_date_parse_RFC_850()
109 if (s[14] != ':' || !light_isdigit(s[15]) || !light_isdigit(s[16])) in http_date_parse_RFC_850()
111 tm->tm_min = tens[(s[15]-'0')] + (s[16]-'0'); in http_date_parse_RFC_850()
113 if (s[17] != ':' || !light_isdigit(s[18]) || !light_isdigit(s[19])) in http_date_parse_RFC_850()
115 tm->tm_sec = tens[(s[18]-'0')] + (s[19]-'0'); in http_date_parse_RFC_850()
117 if (s[20] != ' ' || s[21] != 'G' || s[22] != 'M' || s[23] != 'T') in http_date_parse_RFC_850()
120 return s+24; /*(24 chars from ',' following the variable len wday)*/ in http_date_parse_RFC_850()
126 http_date_parse_asctime (const char * const s, struct tm * const tm) in http_date_parse_asctime() argument
140 if (s[0] == p[0] && s[1] == p[1] && s[2] == p[2]) break; in http_date_parse_asctime()
145 if (s[3] != ' ') return NULL; in http_date_parse_asctime()
148 if (s[4] == p[0] && s[5] == p[1] && s[6] == p[2]) break; in http_date_parse_asctime()
153 if (s[7] != ' ' || (s[8] != ' ' && !light_isdigit(s[8])) in http_date_parse_asctime()
154 || !light_isdigit(s[9])) in http_date_parse_asctime()
156 tm->tm_mday = (s[8] == ' ' ? 0 : tens[(s[8]-'0')]) + (s[9]-'0'); in http_date_parse_asctime()
158 if (s[10] != ' ' || !light_isdigit(s[11]) || !light_isdigit(s[12])) in http_date_parse_asctime()
160 tm->tm_hour = tens[(s[11]-'0')] + (s[12]-'0'); in http_date_parse_asctime()
162 if (s[13] != ':' || !light_isdigit(s[14]) || !light_isdigit(s[15])) in http_date_parse_asctime()
164 tm->tm_min = tens[(s[14]-'0')] + (s[15]-'0'); in http_date_parse_asctime()
166 if (s[16] != ':' || !light_isdigit(s[17]) || !light_isdigit(s[18])) in http_date_parse_asctime()
168 tm->tm_sec = tens[(s[17]-'0')] + (s[18]-'0'); in http_date_parse_asctime()
170 if (s[19] != ' ' || !light_isdigit(s[20]) || !light_isdigit(s[21]) in http_date_parse_asctime()
171 || !light_isdigit(s[22]) || !light_isdigit(s[23])) return NULL; in http_date_parse_asctime()
172 tm->tm_year =(tens[(s[20]-'0')] + (s[21]-'0'))*100 in http_date_parse_asctime()
173 + tens[(s[22]-'0')] + (s[23]-'0') - 1900; in http_date_parse_asctime()
175 return s+24; in http_date_parse_asctime()
180 http_date_parse_IMF_fixdate (const char * const s, struct tm * const tm) in http_date_parse_IMF_fixdate() argument
194 if (s[0] == p[0] && s[1] == p[1] && s[2] == p[2]) break; in http_date_parse_IMF_fixdate()
199 if (s[3] != ',' || s[4] != ' ' in http_date_parse_IMF_fixdate()
200 || !light_isdigit(s[5]) || !light_isdigit(s[6])) in http_date_parse_IMF_fixdate()
202 tm->tm_mday = tens[(s[5]-'0')] + (s[6]-'0'); in http_date_parse_IMF_fixdate()
204 if ( s[7] != ' ') return NULL; in http_date_parse_IMF_fixdate()
207 if (s[8] == p[0] && s[9] == p[1] && s[10] == p[2]) break; in http_date_parse_IMF_fixdate()
212 if (s[11] != ' ' || !light_isdigit(s[12]) || !light_isdigit(s[13]) in http_date_parse_IMF_fixdate()
213 || !light_isdigit(s[14]) || !light_isdigit(s[15])) return NULL; in http_date_parse_IMF_fixdate()
214 tm->tm_year =(tens[(s[12]-'0')] + (s[13]-'0'))*100 in http_date_parse_IMF_fixdate()
215 + tens[(s[14]-'0')] + (s[15]-'0') - 1900; in http_date_parse_IMF_fixdate()
217 if (s[16] != ' ' || !light_isdigit(s[17]) || !light_isdigit(s[18])) in http_date_parse_IMF_fixdate()
219 tm->tm_hour = tens[(s[17]-'0')] + (s[18]-'0'); in http_date_parse_IMF_fixdate()
221 if (s[19] != ':' || !light_isdigit(s[20]) || !light_isdigit(s[21])) in http_date_parse_IMF_fixdate()
223 tm->tm_min = tens[(s[20]-'0')] + (s[21]-'0'); in http_date_parse_IMF_fixdate()
225 if (s[22] != ':' || !light_isdigit(s[23]) || !light_isdigit(s[24])) in http_date_parse_IMF_fixdate()
227 tm->tm_sec = tens[(s[23]-'0')] + (s[24]-'0'); in http_date_parse_IMF_fixdate()
229 if (s[25] != ' ' || s[26] != 'G' || s[27] != 'M' || s[28] != 'T') in http_date_parse_IMF_fixdate()
232 return s+29; in http_date_parse_IMF_fixdate()
237 http_date_str_to_tm (const char * const s, const uint32_t len, in http_date_str_to_tm() argument
259 return http_date_parse_IMF_fixdate(s, tm); in http_date_str_to_tm()
261 return http_date_parse_RFC_850(s, tm); in http_date_str_to_tm()
263 return http_date_parse_asctime(s, tm); in http_date_str_to_tm()
268 http_date_time_to_str (char * const s, const size_t sz, const unix_time64_t t) in http_date_time_to_str() argument
274 ? (uint32_t)strftime(s, sz, fmt, &tm) in http_date_time_to_str()