1%{ 2/* 3** Originally written by Steven M. Bellovin <smb@research.att.com> while 4** at the University of North Carolina at Chapel Hill. Later tweaked by 5** a couple of people on Usenet. Completely overhauled by Rich $alz 6** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990; 7** 8** This grammar has 10 shift/reduce conflicts. 9** 10** This code is in the public domain and has no copyright. 11*/ 12/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */ 13/* SUPPRESS 288 on yyerrlab *//* Label unused */ 14 15#include <sys/cdefs.h> |
16__FBSDID("$FreeBSD: head/usr.bin/find/getdate.y 235789 2012-05-22 16:33:10Z bapt $"); |
17 18#include <stdio.h> 19#include <ctype.h> 20 21/* The code at the top of get_date which figures out the offset of the 22 current time zone checks various CPP symbols to see if special 23 tricks are need, but defaults to using the gettimeofday system call. 24 Include <sys/time.h> if that will be used. */ --- 30 unchanged lines hidden (view full) --- 55 is to use byacc instead of bison, which should generate a portable 56 parser. I played with adding "#define alloca dont_use_alloca", to 57 give an error if the parser generator uses alloca (and thus detect 58 unportable getdate.c's), but that seems to cause as many problems 59 as it solves. */ 60 61#include <time.h> 62 |
63#define yylex getdate_yylex 64#define yyerror getdate_yyerror 65 |
66static int yylex(void); 67static int yyerror(const char *); 68 69time_t get_date(char *); 70 71#define EPOCH 1970 72#define HOUR(x) ((time_t)(x) * 60) 73#define SECSPERDAY (24L * 60L * 60L) --- 886 unchanged lines hidden --- |