rh

Check-in [c924f9b320]
Login

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

Overview
Comment:Fix warnings. Avoid name clash on getdate().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:c924f9b320d4c710b9781a0b52989cbd26a03e41a7f365c606a81253dae997b6
User & Date: ajv-899-334-8894@vsta.org 2016-08-10 21:22:24
Context
2017-04-24
20:26
My private rhrc macros check-in: 7aea832c71 user: vandyswa@gmail.com tags: master, trunk
2016-08-10
21:22
Fix warnings. Avoid name clash on getdate(). check-in: c924f9b320 user: ajv-899-334-8894@vsta.org tags: master, trunk
21:04
Tidy up git output check-in: 32a60f8413 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to getdate.c.

749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
		for (i = milzone; i->name; i++)
			if (strcmp(i->name, idvar) == 0) return gotit;
	}

	return(ID);
}

date_info getdate(p, now)
char *p;
struct timeb *now;
{
#define mcheck(f)	if (f>1) err++
    int gd_parse();
    time_t monthadd();
    int err;







|







749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
		for (i = milzone; i->name; i++)
			if (strcmp(i->name, idvar) == 0) return gotit;
	}

	return(ID);
}

date_info rhgetdate(p, now)
char *p;
struct timeb *now;
{
#define mcheck(f)	if (f>1) err++
    int gd_parse();
    time_t monthadd();
    int err;

Changes to getdate.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
27
28
29
30
31
32
33
34
35
36
/*
 * getdate.h
 *
 * Written by:	Rick Ohnemus	(rick@sterling.com)
 *
 * This file contains the structure returned by getdate().
 *
 * rcsid: $Id: getdate.h,v 1.1 2008/12/27 00:56:03 vandys Exp $
 */

#if !defined(__GETDATE_H__)
#define __GETDATE_H__

................................................................................
    unsigned int	secflag   : 1;
    unsigned int	monthflag : 1;
    unsigned int	yearflag  : 1;
    unsigned int	dayflag   : 1;

} date_info;

extern date_info getdate();

#endif	/* __GETDATE_H__ */





|







 







|


1
2
3
4
5
6
7
8
9
10
11
12
13
..
27
28
29
30
31
32
33
34
35
36
/*
 * getdate.h
 *
 * Written by:	Rick Ohnemus	(rick@sterling.com)
 *
 * This file contains the structure returned by rhgetdate().
 *
 * rcsid: $Id: getdate.h,v 1.1 2008/12/27 00:56:03 vandys Exp $
 */

#if !defined(__GETDATE_H__)
#define __GETDATE_H__

................................................................................
    unsigned int	secflag   : 1;
    unsigned int	monthflag : 1;
    unsigned int	yearflag  : 1;
    unsigned int	dayflag   : 1;

} date_info;

extern date_info rhgetdate();

#endif	/* __GETDATE_H__ */

Changes to resname.c.

14
15
16
17
18
19
20

21
22
23
24
25
26
27
static char rcsid[] = "$Id: resname.c,v 1.1 2008/12/27 00:56:03 vandys Exp $";
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>


#include "alloc.h"

#if !defined(MAX_PATH_LEN)
#  define MAX_PATH_LEN	1024
#endif








>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
static char rcsid[] = "$Id: resname.c,v 1.1 2008/12/27 00:56:03 vandys Exp $";
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>

#include "alloc.h"

#if !defined(MAX_PATH_LEN)
#  define MAX_PATH_LEN	1024
#endif

Changes to rh.h.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 */

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/unistd.h>


#if !defined(FALSE)
#  define FALSE	0
#endif

#if !defined(TRUE)







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 */

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <unistd.h>


#if !defined(FALSE)
#  define FALSE	0
#endif

#if !defined(TRUE)

Changes to rhcmds.c.

15
16
17
18
19
20
21

22
23
24
25
26
27
28
#if !defined(lint)
static char rcsid[] = "$Id: rhcmds.c,v 1.3 2011/12/31 02:41:07 vandys Exp $";
#endif

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


void c_or(instr_value *v)
{
    Stack[SP - 2] = Stack[SP - 2] || Stack[SP - 1];
    SP--;
    return;
}







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#if !defined(lint)
static char rcsid[] = "$Id: rhcmds.c,v 1.3 2011/12/31 02:41:07 vandys Exp $";
#endif

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

void c_or(instr_value *v)
{
    Stack[SP - 2] = Stack[SP - 2] || Stack[SP - 1];
    SP--;
    return;
}

Changes to rhdata.c.

10
11
12
13
14
15
16

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

#include "rh.h"
#include "rhcmds.h"
#include "rhgram.h"


#if !defined(S_IREAD)
#  define S_IREAD	0400
#  define S_IWRITE	0200
#  define S_IEXEC	0100
#endif








>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#if !defined(lint)
static char rcsid[] = "$Id: rhdata.c,v 1.2 2010/04/22 03:03:16 vandys Exp $";
#endif

#include "rh.h"
#include "rhcmds.h"
#include "rhgram.h"
#include "errmsg.h"

#if !defined(S_IREAD)
#  define S_IREAD	0400
#  define S_IWRITE	0200
#  define S_IEXEC	0100
#endif

Changes to rhdir.c.

129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
330
331
332
333
334
335
336
337
338
339

340
341
342
343
344
345
346
347

void printformat(struct stat *buf,
		 const char *name,
		 int depth)
{
    static char *hex_digits = "0123456789abcdef";


    unsigned char	c;
    char *		fp;
    group_info *	gi;
    int			i;
    char *		p;
    user_info *		ui;
    
    
    for (fp = attr.format; *fp != '\0'; fp++) {
	if (*fp != '%') {
	    if (*fp != '\\') {
		(void) putc(*fp, stdout);
		continue;
	    }
	    fp++;
................................................................................
	case 'n':	/* full path of file (relative to start point) */
	case 's':
	    (void) printf("%s", attr.graphic ? graphic(name) : name);
	    break;
	    
	case 'N':	/* base name of file */
	case 'S':
	    if ((p = strrchr(name, '/')) == (char *) NULL)
		(void) printf(attr.graphic ? graphic(name) : name);
	    else

		(void) printf(attr.graphic ? graphic(p + 1) : (p + 1));
	    break;
	    
	case 'u':	/* numeric user id */
	    (void) printf("%8d", buf->st_uid);
	    break;
	    
	case 'U':	/* symbolic user id */







>
|
|
|
|
<
|
|
<







 







|
|
|
>
|







129
130
131
132
133
134
135
136
137
138
139
140

141
142

143
144
145
146
147
148
149
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347

void printformat(struct stat *buf,
		 const char *name,
		 int depth)
{
    static char *hex_digits = "0123456789abcdef";

    const char *cp;
    unsigned char c;
    char *fp, *p;
    group_info *gi;
    int	i;

    user_info *ui;


    for (fp = attr.format; *fp != '\0'; fp++) {
	if (*fp != '%') {
	    if (*fp != '\\') {
		(void) putc(*fp, stdout);
		continue;
	    }
	    fp++;
................................................................................
	case 'n':	/* full path of file (relative to start point) */
	case 's':
	    (void) printf("%s", attr.graphic ? graphic(name) : name);
	    break;
	    
	case 'N':	/* base name of file */
	case 'S':
	    cp = strrchr(name, '/');
	    if (cp == NULL) {
		cp = name;
	    }
	    (void)printf("%s", attr.graphic ? graphic(cp) : cp);
	    break;
	    
	case 'u':	/* numeric user id */
	    (void) printf("%8d", buf->st_uid);
	    break;
	    
	case 'U':	/* symbolic user id */

Changes to rhlex.c.

1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
					  "empty date specification");
			    }
			    Line_pos += yyleng;
			    date_str = SAVESTR(yytext);
			    date_str[yyleng - 1] = '\0';
			    remove_escapes(date_str);
			    rh_lval.di = ALLOCATE(sizeof(date_info));
			    *rh_lval.di = getdate(date_str,
						  (struct timeb *) NULL);
			    free(date_str);
			    if (rh_lval.di->seconds == -1) {
				rh_error("invalid date specification");
			    }
			    BEGIN(INITIAL);
			    return DATESPEC;







|







1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
					  "empty date specification");
			    }
			    Line_pos += yyleng;
			    date_str = SAVESTR(yytext);
			    date_str[yyleng - 1] = '\0';
			    remove_escapes(date_str);
			    rh_lval.di = ALLOCATE(sizeof(date_info));
			    *rh_lval.di = rhgetdate(date_str,
						  (struct timeb *) NULL);
			    free(date_str);
			    if (rh_lval.di->seconds == -1) {
				rh_error("invalid date specification");
			    }
			    BEGIN(INITIAL);
			    return DATESPEC;