rh

Check-in [d10742d6cc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Start supporting large files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:d10742d6cc6e3a62bbeca02620542d2e012e71220e6a14282c8b5eec120ae59d
User & Date: ajv-899-334-8894@vsta.org 2010-04-23 03:11:06
Context
2011-01-03
21:46
Note changes by Andy Valencia check-in: 4814501163 user: ajv-899-334-8894@vsta.org tags: master, trunk
2010-04-23
03:11
Start supporting large files check-in: d10742d6cc user: ajv-899-334-8894@vsta.org tags: master, trunk
2010-04-22
03:03
Add access to allocated blocks, so I can find files with allocation holes check-in: 6827c7f100 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to rh.c.

     8      8    *
     9      9    * Static Functions: printhelp, max_descriptors, fmt_req_stat,
    10     10    *		     prog_req_stat, execute, exam1, exam2,
    11     11    *		     exam3, exam4, get_rhpath, get_func,
    12     12    *		     push_instr, write_tree, write_functions
    13     13    */
    14     14   
    15         -#if !defined(lint)
    16         -static char rcsid[] = "$Id: rh.c,v 1.3 1994/01/26 16:18:29 rick Exp $";
    17         -#endif
    18         -
           15  +#define _FILE_OFFSET_BITS 64
    19     16   #include "rh.h"
    20     17   #include "rhcmds.h"
    21     18   #include "rhdata.h"
    22     19   #include "rhgram.h"
    23     20   #include "alloc.h"
    24     21   #include "errmsg.h"
    25     22   

Changes to rhdir.c.

     8      8    * directories.
     9      9    *
    10     10    * Global Functions: ftrw, graphic, printentry, printformat
    11     11    *
    12     12    * Static Functions: fwt1, handle_file, ls_date
    13     13    */
    14     14   
    15         -#if !defined(lint)
    16         -static char rcsid[] = "$Id: rhdir.c,v 1.2 2009/10/02 15:28:48 vandys Exp vandys $";
    17         -#endif
    18         -
           15  +#define _FILE_OFFSET_BITS 64
    19     16   #include <ctype.h>
    20     17   #include "rh.h"
    21     18   #include "rhdata.h"
    22     19   #include "errmsg.h"
    23     20   #include "sysinfo.h"
    24     21   
    25     22   #define user_index(b)	((000777 & (b)) >> 6) + ((b) & S_ISUID ? 8 : 0) 
................................................................................
   241    238   	    
   242    239   	case 'A':	/* atime in seconds */
   243    240   	    (void) printf("%10lu", (u_long) buf->st_atime);
   244    241   	    break;
   245    242   
   246    243   #if BSD
   247    244   	case 'b':	/* number blocks allocated to file */
   248         -	    (void) printf("%10ld", buf->st_blocks);
          245  +	    (void) printf("%10lld", buf->st_blocks);
   249    246   	    break;
   250    247   	    
   251    248   	case 'B':	/* optimal block size for file system i/o */
   252    249   	    (void) printf("%6ld", buf->st_blksize);
   253    250   	    break;
   254    251   #endif
   255    252   	    
................................................................................
   287    284   	    }
   288    285   	    else {
   289    286   		(void) printf("%-8.8s", gi->name);
   290    287   	    }
   291    288   	    break;
   292    289   	    
   293    290   	case 'i':	/* inode number */
   294         -	    (void) printf("%6lu", buf->st_ino);
          291  +	    (void) printf("%6llu", buf->st_ino);
   295    292   	    break;
   296    293   	    
   297    294   	case 'l':	/* number of links */
   298    295   	    (void) printf("%3d", buf->st_nlink);
   299    296   	    break;
   300    297   	    
   301    298   	case 'm':	/* mtime as ls date */
................................................................................
   367    364   	    break;
   368    365   	    
   369    366   	case 'y':	/* numeric device of device where file resides */
   370    367   	    (void) printf("%04x", (u_int) buf->st_dev);
   371    368   	    break;
   372    369   	    
   373    370   	case 'z':	/* file size in bytes */
   374         -	    (void) printf("%9ld", buf->st_size);
          371  +	    (void) printf("%9lld", buf->st_size);
   375    372   	    break;
   376    373   	    
   377    374   	default:
   378    375   	    (void) putc(*fp, stdout);
   379    376   	    break;
   380    377   	}
   381    378       }
................................................................................
   438    435   			  gid_buf,
   439    436   			  major(buf->st_rdev),
   440    437   			  minor(buf->st_rdev),
   441    438   			  ls_date(buf->st_mtime, full_date),
   442    439   			  attr.graphic ? graphic(name) : name);
   443    440   	}
   444    441   	else {
   445         -	    (void) printf("%s%s%s%s %s %s %9ld %s %s\n",
          442  +	    (void) printf("%s%s%s%s %s %s %9lld %s %s\n",
   446    443   			  ftype[ftype_index(buf->st_mode)],
   447    444   			  perm[user_index(buf->st_mode)],
   448    445   			  perm[group_index(buf->st_mode)],
   449    446   			  perm2[all_index(buf->st_mode)],
   450    447   			  uid_buf,
   451    448   			  gid_buf,
   452    449   			  buf->st_size,
................................................................................
   462    459   			  perm[group_index(buf->st_mode)],
   463    460   			  perm2[all_index(buf->st_mode)],
   464    461   			  major(buf->st_rdev),
   465    462   			  minor(buf->st_rdev),
   466    463   			  attr.graphic ? graphic(name) : name);
   467    464   	}
   468    465   	else {
   469         -	    (void) printf("%s%s%s%s %9ld %s\n",
          466  +	    (void) printf("%s%s%s%s %9lld %s\n",
   470    467   			  ftype[ftype_index(buf->st_mode)],
   471    468   			  perm[user_index(buf->st_mode)],
   472    469   			  perm[group_index(buf->st_mode)],
   473    470   			  perm2[all_index(buf->st_mode)],
   474    471   			  buf->st_size,
   475    472   			  attr.graphic ? graphic(name) : name);
   476    473   	}

Changes to rhlex.c.

   180    180   /* Special action meaning "start processing a new file". */
   181    181   #define YY_NEW_FILE yyrestart(yyin  )
   182    182   
   183    183   #define YY_END_OF_BUFFER_CHAR 0
   184    184   
   185    185   /* Size of default input buffer. */
   186    186   #ifndef YY_BUF_SIZE
          187  +#ifdef __ia64__
          188  +/* On IA-64, the buffer size is 16k, not 8k.
          189  + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
          190  + * Ditto for the __ia64__ case accordingly.
          191  + */
          192  +#define YY_BUF_SIZE 32768
          193  +#else
   187    194   #define YY_BUF_SIZE 16384
          195  +#endif /* __ia64__ */
   188    196   #endif
   189    197   
   190    198   /* The state buf must be large enough to hold one state per character in the main buffer.
   191    199    */
   192    200   #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
   193    201   
   194    202   #ifndef YY_TYPEDEF_YY_BUFFER_STATE
................................................................................
   646    654   static char *yy_last_accepting_cpos;
   647    655   
   648    656   extern int yy_flex_debug;
   649    657   int yy_flex_debug = 1;
   650    658   
   651    659   static yyconst flex_int16_t yy_rule_linenum[70] =
   652    660       {   0,
   653         -       80,   90,  102,  148,  158,  160,  162,  164,  166,  178,
   654         -      180,  182,  184,  206,  216,  218,  220,  222,  235,  245,
   655         -      247,  249,  251,  268,  278,  279,  280,  281,  282,  283,
   656         -      284,  285,  286,  287,  288,  289,  290,  291,  292,  293,
   657         -      294,  295,  296,  297,  298,  299,  300,  301,  302,  303,
   658         -      304,  305,  307,  313,  328,  334,  349,  388,  394,  400,
   659         -      405,  411,  426,  434,  436,  442,  460,  466,  468
          661  +       76,   86,   98,  144,  154,  156,  158,  160,  162,  174,
          662  +      176,  178,  180,  202,  212,  214,  216,  218,  231,  241,
          663  +      243,  245,  247,  264,  274,  275,  276,  277,  278,  279,
          664  +      280,  281,  282,  283,  284,  285,  286,  287,  288,  289,
          665  +      290,  291,  292,  293,  294,  295,  296,  297,  298,  299,
          666  +      300,  301,  303,  309,  324,  330,  345,  384,  390,  396,
          667  +      401,  407,  422,  430,  432,  438,  456,  462,  464
   660    668       } ;
   661    669   
   662    670   /* The intent behind this definition is that it'll catch
   663    671    * any uses of REJECT which flex missed.
   664    672    */
   665    673   #define REJECT reject_used_but_not_detected
   666    674   static int yy_more_flag = 0;
................................................................................
   674    682   #line 4 "rhlex.l"
   675    683   
   676    684   /*
   677    685    * rhlex.l
   678    686    *
   679    687    * Written by:	Rick Ohnemus	(rick@sterling.com)
   680    688    */
   681         -
   682         -#if !defined(lint)
   683         -static char rcsid[] = "$Id: rhlex.l,v 1.1 1994/01/12 19:39:35 rick Exp $";
   684         -#endif
   685         -
          689  +#define _FILE_OFFSET_BITS 64
   686    690   #include <memory.h>
   687    691   #include <sys/types.h>
   688    692   #include <sys/time.h>
   689    693   #include <sys/timeb.h>
   690    694   #include <errno.h>
   691    695   
   692    696   #if defined(DEBUG)
................................................................................
   734    738   
   735    739   
   736    740   
   737    741   
   738    742   
   739    743   
   740    744   
   741         -#line 742 "<stdout>"
          745  +#line 746 "<stdout>"
   742    746   
   743    747   #define INITIAL 0
   744    748   #define COMMENT 1
   745    749   #define DATE_SPEC 2
   746    750   #define FILE_NAME 3
   747    751   #define FILE_TIME 4
   748    752   #define FIRST_LINE 5
................................................................................
   851    855   
   852    856   /* %if-c-only */
   853    857   
   854    858   /* %endif */
   855    859   
   856    860   /* Amount of stuff to slurp up with each read. */
   857    861   #ifndef YY_READ_BUF_SIZE
          862  +#ifdef __ia64__
          863  +/* On IA-64, the buffer size is 16k, not 8k */
          864  +#define YY_READ_BUF_SIZE 16384
          865  +#else
   858    866   #define YY_READ_BUF_SIZE 8192
          867  +#endif /* __ia64__ */
   859    868   #endif
   860    869   
   861    870   /* Copy whatever the last rule matched to the standard output. */
   862    871   #ifndef ECHO
   863    872   /* %if-c-only Standard (non-C++) definition */
   864    873   /* This used to be an fputs(), but since the string might contain NUL's,
   865    874    * we now use fwrite().
................................................................................
   982    991   YY_DECL
   983    992   {
   984    993   	register yy_state_type yy_current_state;
   985    994   	register char *yy_cp, *yy_bp;
   986    995   	register int yy_act;
   987    996       
   988    997   /* %% [7.0] user's declarations go here */
   989         -#line 73 "rhlex.l"
          998  +#line 69 "rhlex.l"
   990    999   
   991   1000   
   992   1001       if (First_line) {
   993   1002   	BEGIN(FIRST_LINE);
   994   1003   	First_line = 0;
   995   1004       }
   996   1005   
   997         -#line 998 "<stdout>"
         1006  +#line 1007 "<stdout>"
   998   1007   
   999   1008   	if ( !(yy_init) )
  1000   1009   		{
  1001   1010   		(yy_init) = 1;
  1002   1011   
  1003   1012   #ifdef YY_USER_INIT
  1004   1013   		YY_USER_INIT;
................................................................................
  1112   1121   			*yy_cp = (yy_hold_char);
  1113   1122   			yy_cp = (yy_last_accepting_cpos);
  1114   1123   			yy_current_state = (yy_last_accepting_state);
  1115   1124   			goto yy_find_action;
  1116   1125   
  1117   1126   case 1:
  1118   1127   YY_RULE_SETUP
  1119         -#line 80 "rhlex.l"
         1128  +#line 76 "rhlex.l"
  1120   1129   {
  1121   1130   			    Line = ALLOCATE(yyleng + 1);
  1122   1131   			    (void) strcpy(Line, yytext);
  1123   1132   			    Line_len = yyleng;
  1124   1133   			    Line_num = 1;
  1125   1134   			    Line_pos = 0;
  1126   1135   			    BEGIN(INITIAL);
  1127   1136   			    yyless(0);
  1128   1137   			}
  1129   1138   	YY_BREAK
  1130   1139   case 2:
  1131   1140   /* rule 2 can match eol */
  1132   1141   YY_RULE_SETUP
  1133         -#line 90 "rhlex.l"
         1142  +#line 86 "rhlex.l"
  1134   1143   {
  1135   1144   			    Line = ALLOCATE(81);
  1136   1145   			    *Line = '\0';
  1137   1146   			    Line_len = 80;
  1138   1147   			    Line_num = 1;
  1139   1148   			    Line_pos = 0;
  1140   1149   			    BEGIN(INITIAL);
  1141   1150   			    yyless(0);
  1142   1151   			}
  1143   1152   	YY_BREAK
  1144   1153   case YY_STATE_EOF(FIRST_LINE):
  1145         -#line 100 "rhlex.l"
         1154  +#line 96 "rhlex.l"
  1146   1155   { yyterminate(); }
  1147   1156   	YY_BREAK
  1148   1157   case 3:
  1149   1158   YY_RULE_SETUP
  1150         -#line 102 "rhlex.l"
         1159  +#line 98 "rhlex.l"
  1151   1160   {
  1152   1161   			    int adjustment = 0;
  1153   1162   			    int len;
  1154   1163   			    int lp;
  1155   1164   			    char *from;
  1156   1165   			    char *to;
  1157   1166   
................................................................................
  1193   1202   			    BEGIN(OldSC);
  1194   1203   			    yyless(0);
  1195   1204   			}
  1196   1205   	YY_BREAK
  1197   1206   case 4:
  1198   1207   /* rule 4 can match eol */
  1199   1208   YY_RULE_SETUP
  1200         -#line 148 "rhlex.l"
         1209  +#line 144 "rhlex.l"
  1201   1210   { *Line = '\0'; Line_num++; Line_pos = 0; }
  1202   1211   	YY_BREAK
  1203   1212   case YY_STATE_EOF(NEW_LINE):
  1204         -#line 150 "rhlex.l"
         1213  +#line 146 "rhlex.l"
  1205   1214   {
  1206   1215   			    if (OldSC == COMMENT) {
  1207   1216   				lex_error(Start_line, Start_line_num,
  1208   1217   					  "unterminated comment");
  1209   1218   			    }
  1210   1219   			    yyterminate();
  1211   1220   			}
  1212   1221   	YY_BREAK
  1213   1222   case 5:
  1214   1223   YY_RULE_SETUP
  1215         -#line 158 "rhlex.l"
         1224  +#line 154 "rhlex.l"
  1216   1225   { Line_pos += yyleng; }
  1217   1226   	YY_BREAK
  1218   1227   case 6:
  1219   1228   /* rule 6 can match eol */
  1220   1229   YY_RULE_SETUP
  1221         -#line 160 "rhlex.l"
         1230  +#line 156 "rhlex.l"
  1222   1231   { OldSC = COMMENT; BEGIN(NEW_LINE); }
  1223   1232   	YY_BREAK
  1224   1233   case 7:
  1225   1234   YY_RULE_SETUP
  1226         -#line 162 "rhlex.l"
         1235  +#line 158 "rhlex.l"
  1227   1236   { Line_pos += yyleng; }
  1228   1237   	YY_BREAK
  1229   1238   case 8:
  1230   1239   /* rule 8 can match eol */
  1231   1240   YY_RULE_SETUP
  1232         -#line 164 "rhlex.l"
         1241  +#line 160 "rhlex.l"
  1233   1242   { OldSC = COMMENT; BEGIN(NEW_LINE); }
  1234   1243   	YY_BREAK
  1235   1244   case 9:
  1236   1245   YY_RULE_SETUP
  1237         -#line 166 "rhlex.l"
         1246  +#line 162 "rhlex.l"
  1238   1247   {
  1239   1248   			    Line_pos += yyleng;
  1240   1249   			    free(Start_line);
  1241   1250   			    Start_line = (char *) NULL;
  1242   1251   			    BEGIN(INITIAL);
  1243   1252   			}
  1244   1253   	YY_BREAK
  1245   1254   case YY_STATE_EOF(COMMENT):
  1246         -#line 173 "rhlex.l"
         1255  +#line 169 "rhlex.l"
  1247   1256   {
  1248   1257   			    lex_error(Start_line, Start_line_num,
  1249   1258   				      "unterminated comment");
  1250   1259   			}
  1251   1260   	YY_BREAK
  1252   1261   case 10:
  1253   1262   YY_RULE_SETUP
  1254         -#line 178 "rhlex.l"
         1263  +#line 174 "rhlex.l"
  1255   1264   { yymore(); }
  1256   1265   	YY_BREAK
  1257   1266   case 11:
  1258   1267   YY_RULE_SETUP
  1259         -#line 180 "rhlex.l"
         1268  +#line 176 "rhlex.l"
  1260   1269   { yymore(); }
  1261   1270   	YY_BREAK
  1262   1271   case 12:
  1263   1272   YY_RULE_SETUP
  1264         -#line 182 "rhlex.l"
         1273  +#line 178 "rhlex.l"
  1265   1274   { yymore(); }
  1266   1275   	YY_BREAK
  1267   1276   case 13:
  1268   1277   YY_RULE_SETUP
  1269         -#line 184 "rhlex.l"
         1278  +#line 180 "rhlex.l"
  1270   1279   {
  1271   1280   			    char *date_str;
  1272   1281   
  1273   1282   			    if (yyleng == 1) {
  1274   1283   				lex_error(Line, Line_num,
  1275   1284   					  "empty date specification");
  1276   1285   			    }
................................................................................
  1288   1297   			    BEGIN(INITIAL);
  1289   1298   			    return DATESPEC;
  1290   1299   			}
  1291   1300   	YY_BREAK
  1292   1301   case 14:
  1293   1302   /* rule 14 can match eol */
  1294   1303   YY_RULE_SETUP
  1295         -#line 206 "rhlex.l"
         1304  +#line 202 "rhlex.l"
  1296   1305   {
  1297   1306   			    lex_error(Line, Line_num,
  1298   1307   				      "unterminated date specification");
  1299   1308   			}
  1300   1309   	YY_BREAK
  1301   1310   case YY_STATE_EOF(DATE_SPEC):
  1302         -#line 211 "rhlex.l"
         1311  +#line 207 "rhlex.l"
  1303   1312   {
  1304   1313   			    lex_error(Line, Line_num,
  1305   1314   				      "unterminated date specification");
  1306   1315   			}
  1307   1316   	YY_BREAK
  1308   1317   case 15:
  1309   1318   YY_RULE_SETUP
  1310         -#line 216 "rhlex.l"
         1319  +#line 212 "rhlex.l"
  1311   1320   { yymore(); }
  1312   1321   	YY_BREAK
  1313   1322   case 16:
  1314   1323   YY_RULE_SETUP
  1315         -#line 218 "rhlex.l"
         1324  +#line 214 "rhlex.l"
  1316   1325   { yymore(); }
  1317   1326   	YY_BREAK
  1318   1327   case 17:
  1319   1328   YY_RULE_SETUP
  1320         -#line 220 "rhlex.l"
         1329  +#line 216 "rhlex.l"
  1321   1330   { yymore(); }
  1322   1331   	YY_BREAK
  1323   1332   case 18:
  1324   1333   YY_RULE_SETUP
  1325         -#line 222 "rhlex.l"
         1334  +#line 218 "rhlex.l"
  1326   1335   {
  1327   1336   			    if (yyleng == 1) {
  1328   1337   				lex_error(Line, Line_num,
  1329   1338   					  "empty file name pattern");
  1330   1339   			    }
  1331   1340   			    Line_pos += yyleng;
  1332   1341   			    rh_lval.str = SAVESTR(yytext);
................................................................................
  1335   1344   			    remove_escapes(rh_lval.str);
  1336   1345   			    return FILENAME_PATTERN;
  1337   1346   			}
  1338   1347   	YY_BREAK
  1339   1348   case 19:
  1340   1349   /* rule 19 can match eol */
  1341   1350   YY_RULE_SETUP
  1342         -#line 235 "rhlex.l"
         1351  +#line 231 "rhlex.l"
  1343   1352   {
  1344   1353   			    lex_error(Line, Line_num,
  1345   1354   				      "unterminated file name pattern");
  1346   1355   			}
  1347   1356   	YY_BREAK
  1348   1357   case YY_STATE_EOF(FILE_NAME):
  1349         -#line 240 "rhlex.l"
         1358  +#line 236 "rhlex.l"
  1350   1359   {
  1351   1360   			    lex_error(Line, Line_num,
  1352   1361   				      "unterminated file name pattern");
  1353   1362   			}
  1354   1363   	YY_BREAK
  1355   1364   case 20:
  1356   1365   YY_RULE_SETUP
  1357         -#line 245 "rhlex.l"
         1366  +#line 241 "rhlex.l"
  1358   1367   { yymore(); }
  1359   1368   	YY_BREAK
  1360   1369   case 21:
  1361   1370   YY_RULE_SETUP
  1362         -#line 247 "rhlex.l"
         1371  +#line 243 "rhlex.l"
  1363   1372   { yymore(); }
  1364   1373   	YY_BREAK
  1365   1374   case 22:
  1366   1375   YY_RULE_SETUP
  1367         -#line 249 "rhlex.l"
         1376  +#line 245 "rhlex.l"
  1368   1377   { yymore(); }
  1369   1378   	YY_BREAK
  1370   1379   case 23:
  1371   1380   YY_RULE_SETUP
  1372         -#line 251 "rhlex.l"
         1381  +#line 247 "rhlex.l"
  1373   1382   {
  1374   1383   			    char *ftspec;
  1375   1384   
  1376   1385   			    if (yyleng == 1) {
  1377   1386   				lex_error(Line, Line_num,
  1378   1387   					  "empty file time operator");
  1379   1388   			    }
................................................................................
  1386   1395   			    BEGIN(INITIAL);
  1387   1396   			    return FILETIME_FIELD;
  1388   1397   			}
  1389   1398   	YY_BREAK
  1390   1399   case 24:
  1391   1400   /* rule 24 can match eol */
  1392   1401   YY_RULE_SETUP
  1393         -#line 268 "rhlex.l"
         1402  +#line 264 "rhlex.l"
  1394   1403   {
  1395   1404   			    lex_error(Line, Line_num,
  1396   1405   				      "unterminated file time operator");
  1397   1406   			}
  1398   1407   	YY_BREAK
  1399   1408   case YY_STATE_EOF(FILE_TIME):
  1400         -#line 273 "rhlex.l"
         1409  +#line 269 "rhlex.l"
  1401   1410   {
  1402   1411   			    lex_error(Line, Line_num,
  1403   1412   				      "unterminated file time operator");
  1404   1413   			}
  1405   1414   	YY_BREAK
  1406   1415   case 25:
  1407   1416   YY_RULE_SETUP
  1408         -#line 278 "rhlex.l"
         1417  +#line 274 "rhlex.l"
  1409   1418   { Line_pos += yyleng; return '!'; }
  1410   1419   	YY_BREAK
  1411   1420   case 26:
  1412   1421   YY_RULE_SETUP
  1413         -#line 279 "rhlex.l"
         1422  +#line 275 "rhlex.l"
  1414   1423   { Line_pos += yyleng; return NE; }
  1415   1424   	YY_BREAK
  1416   1425   case 27:
  1417   1426   YY_RULE_SETUP
  1418         -#line 280 "rhlex.l"
         1427  +#line 276 "rhlex.l"
  1419   1428   { Line_pos += yyleng; return '%'; }
  1420   1429   	YY_BREAK
  1421   1430   case 28:
  1422   1431   YY_RULE_SETUP
  1423         -#line 281 "rhlex.l"
         1432  +#line 277 "rhlex.l"
  1424   1433   { Line_pos += yyleng; return '&'; }
  1425   1434   	YY_BREAK
  1426   1435   case 29:
  1427   1436   YY_RULE_SETUP
  1428         -#line 282 "rhlex.l"
         1437  +#line 278 "rhlex.l"
  1429   1438   { Line_pos += yyleng; return LOGAND; }
  1430   1439   	YY_BREAK
  1431   1440   case 30:
  1432   1441   YY_RULE_SETUP
  1433         -#line 283 "rhlex.l"
         1442  +#line 279 "rhlex.l"
  1434   1443   { Line_pos += yyleng; return '('; }
  1435   1444   	YY_BREAK
  1436   1445   case 31:
  1437   1446   YY_RULE_SETUP
  1438         -#line 284 "rhlex.l"
         1447  +#line 280 "rhlex.l"
  1439   1448   { Line_pos += yyleng; return ')'; }
  1440   1449   	YY_BREAK
  1441   1450   case 32:
  1442   1451   YY_RULE_SETUP
  1443         -#line 285 "rhlex.l"
         1452  +#line 281 "rhlex.l"
  1444   1453   { Line_pos += yyleng; return '*'; }
  1445   1454   	YY_BREAK
  1446   1455   case 33:
  1447   1456   YY_RULE_SETUP
  1448         -#line 286 "rhlex.l"
         1457  +#line 282 "rhlex.l"
  1449   1458   { Line_pos += yyleng; return '+'; }
  1450   1459   	YY_BREAK
  1451   1460   case 34:
  1452   1461   YY_RULE_SETUP
  1453         -#line 287 "rhlex.l"
         1462  +#line 283 "rhlex.l"
  1454   1463   { Line_pos += yyleng; return ','; }
  1455   1464   	YY_BREAK
  1456   1465   case 35:
  1457   1466   YY_RULE_SETUP
  1458         -#line 288 "rhlex.l"
         1467  +#line 284 "rhlex.l"
  1459   1468   { Line_pos += yyleng; return '-'; }
  1460   1469   	YY_BREAK
  1461   1470   case 36:
  1462   1471   YY_RULE_SETUP
  1463         -#line 289 "rhlex.l"
         1472  +#line 285 "rhlex.l"
  1464   1473   { Line_pos += yyleng; return '/'; }
  1465   1474   	YY_BREAK
  1466   1475   case 37:
  1467   1476   YY_RULE_SETUP
  1468         -#line 290 "rhlex.l"
         1477  +#line 286 "rhlex.l"
  1469   1478   { Line_pos += yyleng; return ':'; }
  1470   1479   	YY_BREAK
  1471   1480   case 38:
  1472   1481   YY_RULE_SETUP
  1473         -#line 291 "rhlex.l"
         1482  +#line 287 "rhlex.l"
  1474   1483   { Line_pos += yyleng; return ';'; }
  1475   1484   	YY_BREAK
  1476   1485   case 39:
  1477   1486   YY_RULE_SETUP
  1478         -#line 292 "rhlex.l"
         1487  +#line 288 "rhlex.l"
  1479   1488   { Line_pos += yyleng; return '<'; }
  1480   1489   	YY_BREAK
  1481   1490   case 40:
  1482   1491   YY_RULE_SETUP
  1483         -#line 293 "rhlex.l"
         1492  +#line 289 "rhlex.l"
  1484   1493   { Line_pos += yyleng; return LSHIFT; }
  1485   1494   	YY_BREAK
  1486   1495   case 41:
  1487   1496   YY_RULE_SETUP
  1488         -#line 294 "rhlex.l"
         1497  +#line 290 "rhlex.l"
  1489   1498   { Line_pos += yyleng; return LE; }
  1490   1499   	YY_BREAK
  1491   1500   case 42:
  1492   1501   YY_RULE_SETUP
  1493         -#line 295 "rhlex.l"
         1502  +#line 291 "rhlex.l"
  1494   1503   { Line_pos += yyleng; return EQ; }
  1495   1504   	YY_BREAK
  1496   1505   case 43:
  1497   1506   YY_RULE_SETUP
  1498         -#line 296 "rhlex.l"
         1507  +#line 292 "rhlex.l"
  1499   1508   { Line_pos += yyleng; return '>'; }
  1500   1509   	YY_BREAK
  1501   1510   case 44:
  1502   1511   YY_RULE_SETUP
  1503         -#line 297 "rhlex.l"
         1512  +#line 293 "rhlex.l"
  1504   1513   { Line_pos += yyleng; return GE; }
  1505   1514   	YY_BREAK
  1506   1515   case 45:
  1507   1516   YY_RULE_SETUP
  1508         -#line 298 "rhlex.l"
         1517  +#line 294 "rhlex.l"
  1509   1518   { Line_pos += yyleng; return RSHIFT; }
  1510   1519   	YY_BREAK
  1511   1520   case 46:
  1512   1521   YY_RULE_SETUP
  1513         -#line 299 "rhlex.l"
         1522  +#line 295 "rhlex.l"
  1514   1523   { Line_pos += yyleng; return '?'; }
  1515   1524   	YY_BREAK
  1516   1525   case 47:
  1517   1526   YY_RULE_SETUP
  1518         -#line 300 "rhlex.l"
         1527  +#line 296 "rhlex.l"
  1519   1528   { Line_pos += yyleng; return '^'; }
  1520   1529   	YY_BREAK
  1521   1530   case 48:
  1522   1531   YY_RULE_SETUP
  1523         -#line 301 "rhlex.l"
         1532  +#line 297 "rhlex.l"
  1524   1533   { Line_pos += yyleng; return '{'; }
  1525   1534   	YY_BREAK
  1526   1535   case 49:
  1527   1536   YY_RULE_SETUP
  1528         -#line 302 "rhlex.l"
         1537  +#line 298 "rhlex.l"
  1529   1538   { Line_pos += yyleng; return '|'; }
  1530   1539   	YY_BREAK
  1531   1540   case 50:
  1532   1541   YY_RULE_SETUP
  1533         -#line 303 "rhlex.l"
         1542  +#line 299 "rhlex.l"
  1534   1543   { Line_pos += yyleng; return LOGOR; }
  1535   1544   	YY_BREAK
  1536   1545   case 51:
  1537   1546   YY_RULE_SETUP
  1538         -#line 304 "rhlex.l"
         1547  +#line 300 "rhlex.l"
  1539   1548   { Line_pos += yyleng; return '}'; }
  1540   1549   	YY_BREAK
  1541   1550   case 52:
  1542   1551   YY_RULE_SETUP
  1543         -#line 305 "rhlex.l"
         1552  +#line 301 "rhlex.l"
  1544   1553   { Line_pos += yyleng; return '~'; }
  1545   1554   	YY_BREAK
  1546   1555   case 53:
  1547   1556   YY_RULE_SETUP
  1548         -#line 307 "rhlex.l"
         1557  +#line 303 "rhlex.l"
  1549   1558   {
  1550   1559   			    Line_pos += yyleng;
  1551   1560   			    rh_lval.value = getuid();
  1552   1561   			    return NUMBER;
  1553   1562   			}
  1554   1563   	YY_BREAK
  1555   1564   case 54:
  1556   1565   YY_RULE_SETUP
  1557         -#line 313 "rhlex.l"
         1566  +#line 309 "rhlex.l"
  1558   1567   {
  1559   1568   			    user_info *uip;
  1560   1569   
  1561   1570   			    Line_pos += yyleng;
  1562   1571   			    if (yyleng == 1) {
  1563   1572   				rh_error("user name missing");
  1564   1573   			    }
................................................................................
  1568   1577   			    }
  1569   1578   			    rh_lval.value = uip->uid;
  1570   1579   			    return NUMBER;
  1571   1580   			}
  1572   1581   	YY_BREAK
  1573   1582   case 55:
  1574   1583   YY_RULE_SETUP
  1575         -#line 328 "rhlex.l"
         1584  +#line 324 "rhlex.l"
  1576   1585   {
  1577   1586   			    Line_pos += yyleng;
  1578   1587   			    rh_lval.value = getgid();
  1579   1588   			    return NUMBER;
  1580   1589   			}
  1581   1590   	YY_BREAK
  1582   1591   case 56:
  1583   1592   YY_RULE_SETUP
  1584         -#line 334 "rhlex.l"
         1593  +#line 330 "rhlex.l"
  1585   1594   {
  1586   1595   			    group_info *gip;
  1587   1596   
  1588   1597   			    Line_pos += yyleng;
  1589   1598   			    if (yyleng == 1) {
  1590   1599   				rh_error("group name missing");
  1591   1600   			    }
................................................................................
  1595   1604   			    }
  1596   1605   			    rh_lval.value = gip->gid;
  1597   1606   			    return NUMBER;
  1598   1607   			}
  1599   1608   	YY_BREAK
  1600   1609   case 57:
  1601   1610   YY_RULE_SETUP
  1602         -#line 349 "rhlex.l"
         1611  +#line 345 "rhlex.l"
  1603   1612   {
  1604   1613   			    char *end;
  1605   1614   
  1606   1615   			    Line_pos += yyleng;
  1607   1616   			    rh_lval.value = strtol(yytext, &end, 10);
  1608   1617   
  1609   1618   			    switch (*end) {
................................................................................
  1637   1646   				break;
  1638   1647   			    }
  1639   1648   			    return NUMBER;
  1640   1649   			}
  1641   1650   	YY_BREAK
  1642   1651   case 58:
  1643   1652   YY_RULE_SETUP
  1644         -#line 388 "rhlex.l"
         1653  +#line 384 "rhlex.l"
  1645   1654   {
  1646   1655   			    Line_pos += yyleng;
  1647   1656   			    rh_lval.value = strtol(yytext, (char **) NULL, 0);
  1648   1657   			    return NUMBER;
  1649   1658   			}
  1650   1659   	YY_BREAK
  1651   1660   case 59:
  1652   1661   YY_RULE_SETUP
  1653         -#line 394 "rhlex.l"
         1662  +#line 390 "rhlex.l"
  1654   1663   {
  1655   1664   			    Line_pos += yyleng;
  1656   1665   			    rh_lval.value = strtol(yytext, (char **) NULL, 0);
  1657   1666   			    return NUMBER;
  1658   1667   			}
  1659   1668   	YY_BREAK
  1660   1669   case 60:
  1661   1670   YY_RULE_SETUP
  1662         -#line 400 "rhlex.l"
         1671  +#line 396 "rhlex.l"
  1663   1672   {
  1664   1673   			    Line_pos += yyleng;
  1665   1674   			    return lookup(yytext);
  1666   1675   			}
  1667   1676   	YY_BREAK
  1668   1677   case 61:
  1669   1678   YY_RULE_SETUP
  1670         -#line 405 "rhlex.l"
         1679  +#line 401 "rhlex.l"
  1671   1680   {
  1672   1681   			    Start_line_pos = Line_pos + 1;
  1673   1682   			    Line_pos += yyleng;
  1674   1683   			    BEGIN(FILE_NAME);
  1675   1684   			}
  1676   1685   	YY_BREAK
  1677   1686   case 62:
  1678   1687   YY_RULE_SETUP
  1679         -#line 411 "rhlex.l"
         1688  +#line 407 "rhlex.l"
  1680   1689   {
  1681   1690   			    char *p;
  1682   1691   
  1683   1692   			    Start_line_pos = Line_pos + 1;
  1684   1693   			    for (p = yytext; *p != '\0'; p++) {
  1685   1694   				if (*p == '\t') {
  1686   1695   				    Line_pos += (8 - (Line_pos + 1) % 8);
................................................................................
  1690   1699   				}
  1691   1700   			    }
  1692   1701   			    BEGIN(DATE_SPEC);
  1693   1702   			}
  1694   1703   	YY_BREAK
  1695   1704   case 63:
  1696   1705   YY_RULE_SETUP
  1697         -#line 426 "rhlex.l"
         1706  +#line 422 "rhlex.l"
  1698   1707   {
  1699   1708   			    Start_line_pos = Line_pos + 1;
  1700   1709   			    Start_line_num = Line_num;
  1701   1710   			    Start_line = SAVESTR(Line);
  1702   1711   			    Line_pos += yyleng;
  1703   1712   			    BEGIN(COMMENT);
  1704   1713   			}
  1705   1714   	YY_BREAK
  1706   1715   case 64:
  1707   1716   YY_RULE_SETUP
  1708         -#line 434 "rhlex.l"
         1717  +#line 430 "rhlex.l"
  1709   1718   { }	/* simple comment - ignore to end of line */
  1710   1719   	YY_BREAK
  1711   1720   case 65:
  1712   1721   YY_RULE_SETUP
  1713         -#line 436 "rhlex.l"
         1722  +#line 432 "rhlex.l"
  1714   1723   {
  1715   1724   			    Line_pos += yyleng;
  1716   1725   			    rh_lval.str = SAVESTR(yytext);
  1717   1726   			    return FSTYPE;
  1718   1727   			}
  1719   1728   	YY_BREAK
  1720   1729   case 66:
  1721   1730   YY_RULE_SETUP
  1722         -#line 442 "rhlex.l"
         1731  +#line 438 "rhlex.l"
  1723   1732   {			/* ignore white space */
  1724   1733   			    char *p;
  1725   1734   
  1726   1735   			    for (p = yytext; *p != '\0'; p++) {
  1727   1736   				if (*p == '\f') {
  1728   1737   				    Line_num++;
  1729   1738   				    Line_pos = 0;
................................................................................
  1736   1745   				    Line_pos += (8 - (Line_pos + 1) % 8);
  1737   1746   				}
  1738   1747   			    }
  1739   1748   			}
  1740   1749   	YY_BREAK
  1741   1750   case 67:
  1742   1751   YY_RULE_SETUP
  1743         -#line 460 "rhlex.l"
         1752  +#line 456 "rhlex.l"
  1744   1753   {
  1745   1754   			    Start_line_pos = Line_pos + 1;
  1746   1755   			    Line_pos += yyleng;
  1747   1756   			    BEGIN(FILE_TIME);
  1748   1757   			}
  1749   1758   	YY_BREAK
  1750   1759   case 68:
  1751   1760   /* rule 68 can match eol */
  1752   1761   YY_RULE_SETUP
  1753         -#line 466 "rhlex.l"
         1762  +#line 462 "rhlex.l"
  1754   1763   { OldSC = INITIAL; BEGIN(NEW_LINE); }
  1755   1764   	YY_BREAK
  1756   1765   case 69:
  1757   1766   YY_RULE_SETUP
  1758         -#line 468 "rhlex.l"
         1767  +#line 464 "rhlex.l"
  1759   1768   { Line_pos += yyleng; return yytext[0]; }
  1760   1769   	YY_BREAK
  1761   1770   case YY_STATE_EOF(INITIAL):
  1762         -#line 470 "rhlex.l"
         1771  +#line 466 "rhlex.l"
  1763   1772   { yyterminate(); }
  1764   1773   	YY_BREAK
  1765   1774   case 70:
  1766   1775   YY_RULE_SETUP
  1767         -#line 472 "rhlex.l"
         1776  +#line 468 "rhlex.l"
  1768   1777   YY_FATAL_ERROR( "flex scanner jammed" );
  1769   1778   	YY_BREAK
  1770         -#line 1771 "<stdout>"
         1779  +#line 1780 "<stdout>"
  1771   1780   
  1772   1781   	case YY_END_OF_BUFFER:
  1773   1782   		{
  1774   1783   		/* Amount of text matched not including the EOB char. */
  1775   1784   		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  1776   1785   
  1777   1786   		/* Undo the effects of YY_DO_BEFORE_ACTION. */
................................................................................
  2626   2635   	return yy_scan_bytes(yystr,strlen(yystr) );
  2627   2636   }
  2628   2637   /* %endif */
  2629   2638   
  2630   2639   /* %if-c-only */
  2631   2640   /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  2632   2641    * scan from a @e copy of @a bytes.
  2633         - * @param bytes the byte buffer to scan
  2634         - * @param len the number of bytes in the buffer pointed to by @a bytes.
         2642  + * @param yybytes the byte buffer to scan
         2643  + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  2635   2644    * 
  2636   2645    * @return the newly allocated buffer state object.
  2637   2646    */
  2638   2647   YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
  2639   2648   {
  2640   2649   	YY_BUFFER_STATE b;
  2641   2650   	char *buf;
................................................................................
  2896   2905   /* %if-tables-serialization definitions */
  2897   2906   /* %define-yytables   The name for this specific scanner's tables. */
  2898   2907   #define YYTABLES_NAME "yytables"
  2899   2908   /* %endif */
  2900   2909   
  2901   2910   /* %ok-for-header */
  2902   2911   
  2903         -#line 472 "rhlex.l"
         2912  +#line 468 "rhlex.l"
  2904   2913   
  2905   2914   
  2906   2915   
  2907   2916   static void lex_error(const char *line, int line_num, const char *msg)
  2908   2917   {
  2909   2918       (void) fprintf(stderr, "%s: %s: %d: %s\n",
  2910   2919   		   Program_name, Input_name, line_num, msg);

Changes to rhlex.l.

     3      3   %{
     4      4   
     5      5   /*
     6      6    * rhlex.l
     7      7    *
     8      8    * Written by:	Rick Ohnemus	(rick@sterling.com)
     9      9    */
    10         -
    11         -#if !defined(lint)
    12         -static char rcsid[] = "$Id: rhlex.l,v 1.1 1994/01/12 19:39:35 rick Exp $";
    13         -#endif
    14         -
           10  +#define _FILE_OFFSET_BITS 64
    15     11   #include <memory.h>
    16     12   #include <sys/types.h>
    17     13   #include <sys/time.h>
    18     14   #include <sys/timeb.h>
    19     15   #include <errno.h>
    20     16   
    21     17   #if defined(DEBUG)