rh

Check-in [0d6f47d12f]
Login

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

Overview
Comment:Remove register decls
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:0d6f47d12f7fe7ff8d0669b164e5aabcac459ef550d3b12b34c96b768f24e185
User & Date: ajv-899-334-8894@vsta.org 2011-12-31 02:41:07
Context
2012-01-10
00:03
Remove register decls. Use malloc space, not stack, for some temp bufs. Apply POSIX stat field size globally, so it's uniform across sources. check-in: 3fb96447e1 user: ajv-899-334-8894@vsta.org tags: master, trunk
2011-12-31
02:41
Remove register decls check-in: 0d6f47d12f user: ajv-899-334-8894@vsta.org tags: master, trunk
2011-01-03
21:46
Note changes by Andy Valencia check-in: 4814501163 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

1
2
3
4
5
6
7
8
9
10
11
12
..
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# rcsid: $Id: Makefile,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $

PROGRAM = rh

CFLAGS=-O
CC=gcc

# Possible C preprocessor flags:
#	-DBSD			    BSD directory handling
#	-DSUNOS_4		    compiling on SunOS 4.1.x
#	-DPOSIX_DIRECTORY_LIBRARY   POSIX directory handling
#
................................................................................
	sysinfo.o	\
	wildmat.o	\
	$(DEBUG_OBJS)

all: debug

$(PROGRAM): $(OBJS)
	$(CC) $(OBJS) -o $(PROGRAM)

insight:
	$(MAKE) DEBUG_YFLAGS=-t DEBUG_LFLAGS=-d		\
		DEBUG_SRCS=dump.c DEBUG_OBJS=dump.o	\
		DEBUG_CPPFLAGS="-DDEBUG"		\
		CC=insight $(PROGRAM)

|



|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
..
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# rcsid: $Id: Makefile,v 1.2 2009/11/23 04:04:37 vandys Exp vandys $

PROGRAM = rh

CFLAGS=-g
CC=gcc

# Possible C preprocessor flags:
#	-DBSD			    BSD directory handling
#	-DSUNOS_4		    compiling on SunOS 4.1.x
#	-DPOSIX_DIRECTORY_LIBRARY   POSIX directory handling
#
................................................................................
	sysinfo.o	\
	wildmat.o	\
	$(DEBUG_OBJS)

all: debug

$(PROGRAM): $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o $(PROGRAM)

insight:
	$(MAKE) DEBUG_YFLAGS=-t DEBUG_LFLAGS=-d		\
		DEBUG_SRCS=dump.c DEBUG_OBJS=dump.o	\
		DEBUG_CPPFLAGS="-DDEBUG"		\
		CC=insight $(PROGRAM)

Changes to getdate.c.

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
...
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
...
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
...
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
	/*							*/
	/* 	Steven M. Bellovin (unc!smb)			*/
	/*	Dept. of Computer Science			*/
	/*	University of North Carolina at Chapel Hill	*/
	/*	@(#)getdate.y	2.13	9/16/86			*/

#if !defined(lint)
static char rcsid[] = "$Id: getdate.y,v 1.1 1994/01/12 19:35:54 rick Exp $";
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
................................................................................
extern struct tm *localtime();

static time_t
dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
int mm, dd, yy, h, m, s, mer, zone, dayflag;
{
	time_t tod, jdate;
	register int i;

	if (yy < 0) yy = -yy;
	if (yy < 100) yy += 1900;
	mdays[1] =
	    28 + ((yy % 4 == 0 && (yy % 100 != 0 || yy % 400 == 0)) ? 1 : 0);
	if (yy < epoch || yy > 1999 || mm < 1 || mm > 12 ||
		dd < 1 || dd > mdays[--mm]) return (-1);
................................................................................
	return (jdate);
}

static time_t
dayconv(ord, day, now)
int ord, day; time_t now;
{
	register struct tm *loctime;
	time_t tod;

	tod = now;
	loctime = localtime(&tod);
	tod += daysec * ((day - loctime->tm_wday + 7) % 7);
	tod += 7 * daysec * ((ord <= 0) ? ord : (ord - 1));
	return daylcorr(tod, now);
}

static time_t
timeconv(hh, mm, ss, mer)
register int hh, mm, ss, mer;
{
	if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
	switch (mer) {
		case AM: if (hh < 1 || hh > 12) return(-1);
			 return (60L * ((hh%12)*60L + mm)+ss);
		case PM: if (hh < 1 || hh > 12) return(-1);
			 return (60L * ((hh%12 +12)*60L + mm)+ss);
................................................................................

static char *lptr;

static int gd_lex()
{
	extern int gd_lval;
	int sign;
	register char c;
	register char *p;
	char idbuf[20];
	int pcnt;

	for (;;) {
		while (isspace(*lptr)) lptr++;

		if (isdigit(c = *lptr) || c == '-' || c == '+') {
................................................................................
static int lookup(id)
char *id;
{
#define gotit (gd_lval = i->value , i->type)
#define getid for(j = idvar, k = id; (*j++ = *k++) != '\0'; /* void */)

	char idvar[20];
	register char *j, *k;
	register struct table *i;
	int abbrev;

	getid;
	if (strlen(idvar) == 3) {
	    abbrev = 1;
	}
	else if (strlen(idvar) == 4 && idvar[3] == '.') {
................................................................................
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse(void)
{
    register int yym, yyn, yystate;
#if YYDEBUG
    register const char *yys;

    if ((yys = getenv("YYDEBUG")) != 0)
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }







|







 







|







 







|











|







 







|
|







 







|
|







 







|

|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
...
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
...
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
...
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
	/*							*/
	/* 	Steven M. Bellovin (unc!smb)			*/
	/*	Dept. of Computer Science			*/
	/*	University of North Carolina at Chapel Hill	*/
	/*	@(#)getdate.y	2.13	9/16/86			*/

#if !defined(lint)
static char rcsid[] = "$Id: getdate.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $";
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
................................................................................
extern struct tm *localtime();

static time_t
dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
int mm, dd, yy, h, m, s, mer, zone, dayflag;
{
	time_t tod, jdate;
	int i;

	if (yy < 0) yy = -yy;
	if (yy < 100) yy += 1900;
	mdays[1] =
	    28 + ((yy % 4 == 0 && (yy % 100 != 0 || yy % 400 == 0)) ? 1 : 0);
	if (yy < epoch || yy > 1999 || mm < 1 || mm > 12 ||
		dd < 1 || dd > mdays[--mm]) return (-1);
................................................................................
	return (jdate);
}

static time_t
dayconv(ord, day, now)
int ord, day; time_t now;
{
	struct tm *loctime;
	time_t tod;

	tod = now;
	loctime = localtime(&tod);
	tod += daysec * ((day - loctime->tm_wday + 7) % 7);
	tod += 7 * daysec * ((ord <= 0) ? ord : (ord - 1));
	return daylcorr(tod, now);
}

static time_t
timeconv(hh, mm, ss, mer)
int hh, mm, ss, mer;
{
	if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
	switch (mer) {
		case AM: if (hh < 1 || hh > 12) return(-1);
			 return (60L * ((hh%12)*60L + mm)+ss);
		case PM: if (hh < 1 || hh > 12) return(-1);
			 return (60L * ((hh%12 +12)*60L + mm)+ss);
................................................................................

static char *lptr;

static int gd_lex()
{
	extern int gd_lval;
	int sign;
	char c;
	char *p;
	char idbuf[20];
	int pcnt;

	for (;;) {
		while (isspace(*lptr)) lptr++;

		if (isdigit(c = *lptr) || c == '-' || c == '+') {
................................................................................
static int lookup(id)
char *id;
{
#define gotit (gd_lval = i->value , i->type)
#define getid for(j = idvar, k = id; (*j++ = *k++) != '\0'; /* void */)

	char idvar[20];
	char *j, *k;
	struct table *i;
	int abbrev;

	getid;
	if (strlen(idvar) == 3) {
	    abbrev = 1;
	}
	else if (strlen(idvar) == 4 && idvar[3] == '.') {
................................................................................
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse(void)
{
    int yym, yyn, yystate;
#if YYDEBUG
    const char *yys;

    if ((yys = getenv("YYDEBUG")) != 0)
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }

Changes to rhcmds.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
...
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
 * These functions are simple, and behave like RPN operators, that is
 * they use the last two values on the stack, apply an operator
 * and push the result. Similarly for unary ops.
 *
 */

#if !defined(lint)
static char rcsid[] = "$Id: rhcmds.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $";
#endif

#include "rh.h"
#include "rhdata.h"
#include "sysinfo.h"

void c_or(instr_value *v)
................................................................................
}


/* calculate the filename length */

void c_baselen(instr_value *v)
{
    register char *	c;
    register int	len;
    
    len = 0;
    for (c = attr.fname; *c != '\0'; c++) {
	if (*c == '/') {
	    len = 0;
	}
	else {
................................................................................
}


/* calculate the length of the directory portion of the path */

void c_dirlen(instr_value *v)
{
    register char *	c;
    register char *	slash = (char *) NULL;
    register int	len;

    for (c = attr.fname; *c != '\0'; c++) {
	if (*c == '/') {
	    slash = c;
	}
    }
    if (slash == (char *) NULL) {







|







 







|
|







 







|
|
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
...
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
 * These functions are simple, and behave like RPN operators, that is
 * they use the last two values on the stack, apply an operator
 * and push the result. Similarly for unary ops.
 *
 */

#if !defined(lint)
static char rcsid[] = "$Id: rhcmds.c,v 1.2 2010/04/22 03:03:16 vandys Exp vandys $";
#endif

#include "rh.h"
#include "rhdata.h"
#include "sysinfo.h"

void c_or(instr_value *v)
................................................................................
}


/* calculate the filename length */

void c_baselen(instr_value *v)
{
    char *	c;
    int	len;
    
    len = 0;
    for (c = attr.fname; *c != '\0'; c++) {
	if (*c == '/') {
	    len = 0;
	}
	else {
................................................................................
}


/* calculate the length of the directory portion of the path */

void c_dirlen(instr_value *v)
{
    char *	c;
    char *	slash = (char *) NULL;
    int	len;

    for (c = attr.fname; *c != '\0'; c++) {
	if (*c == '/') {
	    slash = c;
	}
    }
    if (slash == (char *) NULL) {

Changes to rhlex.c.

986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
....
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
....
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
....
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
....
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
....
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
....
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882

/* %not-for-header */

/** The main scanner function which does all the work.
 */
YY_DECL
{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;
    
/* %% [7.0] user's declarations go here */
#line 69 "rhlex.l"


    if (First_line) {
	BEGIN(FIRST_LINE);
................................................................................
		yy_bp = yy_cp;

/* %% [9.0] code to set up and find next match goes here */
		yy_current_state = (yy_start);
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				(yy_last_accepting_state) = yy_current_state;
				(yy_last_accepting_cpos) = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
................................................................................
 */
/* %if-c-only */
static int yy_get_next_buffer (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = (yytext_ptr);
	register int number_to_move, i;
	int ret_val;

	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
................................................................................
/* %not-for-header */

    static yy_state_type yy_get_previous_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register yy_state_type yy_current_state;
	register char *yy_cp;
    
/* %% [15.0] code to get the start state into yy_current_state goes here */
	yy_current_state = (yy_start);

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
/* %% [16.0] code to find the next state goes here */
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
................................................................................
 */
/* %if-c-only */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register int yy_is_jam;
    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
	register char *yy_cp = (yy_c_buf_p);

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		(yy_last_accepting_state) = yy_current_state;
		(yy_last_accepting_cpos) = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
................................................................................
	yy_is_jam = (yy_current_state == 106);

	return yy_is_jam ? 0 : yy_current_state;
}

/* %if-c-only */

    static void yyunput (int c, register char * yy_bp )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register char *yy_cp;
    
    yy_cp = (yy_c_buf_p);

	/* undo effects of setting up yytext */
	*yy_cp = (yy_hold_char);

	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = (yy_n_chars) + 2;
		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
		register char *source =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];

		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
................................................................................
/*
 * Internal utility routines.
 */

#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
}
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif








|
|
|







 







|







 







|
|
|







 







|
|







|







 







|

|

|







 







|




|









|
|

|







 







|








|







986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
....
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
....
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
....
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
....
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
....
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
....
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882

/* %not-for-header */

/** The main scanner function which does all the work.
 */
YY_DECL
{
	yy_state_type yy_current_state;
	char *yy_cp, *yy_bp;
	int yy_act;
    
/* %% [7.0] user's declarations go here */
#line 69 "rhlex.l"


    if (First_line) {
	BEGIN(FIRST_LINE);
................................................................................
		yy_bp = yy_cp;

/* %% [9.0] code to set up and find next match goes here */
		yy_current_state = (yy_start);
yy_match:
		do
			{
			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				(yy_last_accepting_state) = yy_current_state;
				(yy_last_accepting_cpos) = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
................................................................................
 */
/* %if-c-only */
static int yy_get_next_buffer (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	char *source = (yytext_ptr);
	int number_to_move, i;
	int ret_val;

	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
................................................................................
/* %not-for-header */

    static yy_state_type yy_get_previous_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	yy_state_type yy_current_state;
	char *yy_cp;
    
/* %% [15.0] code to get the start state into yy_current_state goes here */
	yy_current_state = (yy_start);

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
/* %% [16.0] code to find the next state goes here */
		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
................................................................................
 */
/* %if-c-only */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	int yy_is_jam;
    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
	char *yy_cp = (yy_c_buf_p);

	YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		(yy_last_accepting_state) = yy_current_state;
		(yy_last_accepting_cpos) = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
................................................................................
	yy_is_jam = (yy_current_state == 106);

	return yy_is_jam ? 0 : yy_current_state;
}

/* %if-c-only */

    static void yyunput (int c, char * yy_bp )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	char *yy_cp;
    
    yy_cp = (yy_c_buf_p);

	/* undo effects of setting up yytext */
	*yy_cp = (yy_hold_char);

	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		int number_to_move = (yy_n_chars) + 2;
		char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
		char *source =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];

		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
................................................................................
/*
 * Internal utility routines.
 */

#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
	int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
}
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
	int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif

Changes to strtol.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

#if !defined(lint)
static char rcsid[] = "$Header: /home/rick/work/rh/rh-3.0/t/RCS/strtol.c,v 1.1 1994/01/12 19:40:06 rick Exp $ SPRITE (Berkeley)";
#endif /* not lint */

#include <ctype.h>

 
/*
 *----------------------------------------------------------------------
................................................................................
    int base;			/* Base for conversion.  Must be less
				 * than 37.  If 0, then the base is chosen
				 * from the leading characters of string:
				 * "0x" means hex, "0" means octal, anything
				 * else means decimal.
				 */
{
    register char *p;
    int result;
    extern unsigned long strtoul(char *, char **, int);


    /*
     * Skip any leading blanks.
     */







|







 







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

#if !defined(lint)
static char rcsid[] = "$Header: /home/vandys/src/sim/N810/ports/rh-3.0-beta/RCS/strtol.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $ SPRITE (Berkeley)";
#endif /* not lint */

#include <ctype.h>

 
/*
 *----------------------------------------------------------------------
................................................................................
    int base;			/* Base for conversion.  Must be less
				 * than 37.  If 0, then the base is chosen
				 * from the leading characters of string:
				 * "0x" means hex, "0" means octal, anything
				 * else means decimal.
				 */
{
    char *p;
    int result;
    extern unsigned long strtoul(char *, char **, int);


    /*
     * Skip any leading blanks.
     */

Changes to strtoul.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

#if !defined(lint)
static char rcsid[] = "$Header: /home/rick/work/rh/rh-3.0/t/RCS/strtoul.c,v 1.1 1994/01/12 19:40:20 rick Exp $ SPRITE (Berkeley)";
#endif /* not lint */

#include <ctype.h>

/*
 * The table below is used to convert from ASCII digits to a
 * numerical equivalent.  It maps from '0' through 'z' to integers
................................................................................
    int base;			/* Base for conversion.  Must be less
				 * than 37.  If 0, then the base is chosen
				 * from the leading characters of string:
				 * "0x" means hex, "0" means octal, anything
				 * else means decimal.
				 */
{
    register char *p;
    register unsigned long int result = 0;
    register unsigned digit;
    int anyDigits = 0;

    /*
     * Skip any leading blanks.
     */

    p = string;







|







 







|
|
|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 */

#if !defined(lint)
static char rcsid[] = "$Header: /home/vandys/src/sim/N810/ports/rh-3.0-beta/RCS/strtoul.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $ SPRITE (Berkeley)";
#endif /* not lint */

#include <ctype.h>

/*
 * The table below is used to convert from ASCII digits to a
 * numerical equivalent.  It maps from '0' through 'z' to integers
................................................................................
    int base;			/* Base for conversion.  Must be less
				 * than 37.  If 0, then the base is chosen
				 * from the leading characters of string:
				 * "0x" means hex, "0" means octal, anything
				 * else means decimal.
				 */
{
    char *p;
    unsigned long int result = 0;
    unsigned digit;
    int anyDigits = 0;

    /*
     * Skip any leading blanks.
     */

    p = string;

Changes to wildmat.c.

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
**  loss of clarity (and the ABORT stuff seems to be unclear enough by
**  itself).  I think it would be unwise to try to get this into a
**  released version unless you have a good test data base to try it out
**  on.
*/

#if !defined(lint)
static char rcsid[] = "$Id: wildmat.c,v 1.1 1994/01/12 19:41:27 rick Exp $";
#endif

#define TRUE			1
#define FALSE			0
#define ABORT			-1


................................................................................
};


/*
**  Match text and p, return TRUE, FALSE, or ABORT.
*/
static int
DoMatch(register unsigned char	*text,
	register unsigned char	*pattern,
	int			 igncase)
{
    register int		 last;
    register int 	 	 matched;
    register int 	 	 reverse;
    register unsigned char	*tp;
    register unsigned char	*class_end;
    register unsigned char	*cmap = charmap;
    
    for ( ; *pattern != '\0'; text++, pattern++) {
	
	if (*text == '\0') {
	    return (*pattern == '*' && *++pattern == '\0') ? TRUE : ABORT;
	}








|







 







|
|


|
|
|
|
|
|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
**  loss of clarity (and the ABORT stuff seems to be unclear enough by
**  itself).  I think it would be unwise to try to get this into a
**  released version unless you have a good test data base to try it out
**  on.
*/

#if !defined(lint)
static char rcsid[] = "$Id: wildmat.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $";
#endif

#define TRUE			1
#define FALSE			0
#define ABORT			-1


................................................................................
};


/*
**  Match text and p, return TRUE, FALSE, or ABORT.
*/
static int
DoMatch(unsigned char	*text,
	unsigned char	*pattern,
	int			 igncase)
{
    int		 last;
    int 	 	 matched;
    int 	 	 reverse;
    unsigned char	*tp;
    unsigned char	*class_end;
    unsigned char	*cmap = charmap;
    
    for ( ; *pattern != '\0'; text++, pattern++) {
	
	if (*text == '\0') {
	    return (*pattern == '*' && *++pattern == '\0') ? TRUE : ABORT;
	}