Lines Matching refs:s

33 # define strtoll(s, f, b) _atoi64(s)  argument
36 # define strtoll(s, f, b) atoll(s) argument
38 # define strtoll(s, f, b) strtol(s, f, b) argument
54 #define YYLIMIT s->lim
55 #define YYMARKER s->ptr
58 #define RET(i) {s->cur = cursor; return i;}
62 #define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
66 #define DEBUG_OUTPUT(s) printf("%s\n", s); argument
67 #define YYDEBUG(s,c) { if (s != -1) { printf("state: %d ", s); printf("[%c]\n", c); } } argument
69 #define DEBUG_OUTPUT(s) argument
70 #define YYDEBUG(s,c) argument
91 static void add_error(Scanner *s, const char *error) in add_error() argument
93 s->errors->error_count++; in add_error()
94s->errors->error_messages = timelib_realloc(s->errors->error_messages, s->errors->error_count * si… in add_error()
95 s->errors->error_messages[s->errors->error_count - 1].position = s->tok ? s->tok - s->str : 0; in add_error()
96 s->errors->error_messages[s->errors->error_count - 1].character = s->tok ? *s->tok : 0; in add_error()
97 s->errors->error_messages[s->errors->error_count - 1].message = timelib_strdup(error); in add_error()
100 static char *timelib_string(Scanner *s) in timelib_string() argument
102 char *tmp = timelib_calloc(1, s->cur - s->tok + 1); in timelib_string()
103 memcpy(tmp, s->tok, s->cur - s->tok); in timelib_string()
170 static int scan(Scanner *s) in scan() argument
172 uchar *cursor = s->cur; in scan()
177 s->tok = cursor; in scan()
178 s->len = 0; in scan()
254 add_error(s, "Unexpected character"); in scan()
287 add_error(s, "Missing expected time part"); in scan()
293 case 'Y': s->period->y = nr; break; in scan()
294 case 'W': s->period->d += nr * 7; break; in scan()
295 case 'D': s->period->d += nr; break; in scan()
296 case 'H': s->period->h = nr; break; in scan()
297 case 'S': s->period->s = nr; break; in scan()
300 s->period->i = nr; in scan()
302 s->period->m = nr; in scan()
306 add_error(s, "Undefined period specifier"); in scan()
310 } while (!s->errors->error_count && *ptr); in scan()
311 s->have_period = 1; in scan()
331 s->pos = cursor; s->line++; in scan()
668 s->period->y = timelib_get_unsigned_nr(&ptr, 4); in scan()
670 s->period->m = timelib_get_unsigned_nr(&ptr, 2); in scan()
672 s->period->d = timelib_get_unsigned_nr(&ptr, 2); in scan()
674 s->period->h = timelib_get_unsigned_nr(&ptr, 2); in scan()
676 s->period->i = timelib_get_unsigned_nr(&ptr, 2); in scan()
678 s->period->s = timelib_get_unsigned_nr(&ptr, 2); in scan()
679 s->have_period = 1; in scan()
816 if (s->have_date || s->have_period) { in scan()
817 current = s->end; in scan()
818 s->have_end_date = 1; in scan()
820 current = s->begin; in scan()
821 s->have_begin_date = 1; in scan()
830 current->s = timelib_get_nr(&ptr, 2); in scan()
831 s->have_date = 1; in scan()
918 s->recurrences = timelib_get_unsigned_nr(&ptr, 9); in scan()
920 s->have_recurrences = 1; in scan()
934 void timelib_strtointerval(const char *s, size_t len, in timelib_strtointerval() argument
941 const char *e = s + len - 1; in timelib_strtointerval()
951 while (isspace(*s) && s < e) { in timelib_strtointerval()
952 s++; in timelib_strtointerval()
954 while (isspace(*e) && e > s) { in timelib_strtointerval()
958 if (e - s < 0) { in timelib_strtointerval()
970 in.str = timelib_malloc((e - s) + YYMAXFILL); in timelib_strtointerval()
971 memset(in.str, 0, (e - s) + YYMAXFILL); in timelib_strtointerval()
972 memcpy(in.str, s, (e - s)); in timelib_strtointerval()
973 in.lim = in.str + (e - s) + YYMAXFILL; in timelib_strtointerval()
983 in.begin->s = TIMELIB_UNSET; in timelib_strtointerval()
996 in.end->s = TIMELIB_UNSET; in timelib_strtointerval()
1009 in.period->s = 0; in timelib_strtointerval()