Add support for hyper and quad keywords. (See Sun ONC+ Developer's Guide
and RFC-4506 for additional details.) [From FreeBSD and OpenSolaris]
This commit is contained in:
parent
5b5e53256c
commit
3cad8d1d2c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc_parse.c,v 1.15 2006/04/04 21:27:42 christos Exp $ */
|
||||
/* $NetBSD: rpc_parse.c,v 1.16 2009/05/06 14:30:51 ginsbach Exp $ */
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI";
|
||||
#else
|
||||
__RCSID("$NetBSD: rpc_parse.c,v 1.15 2006/04/04 21:27:42 christos Exp $");
|
||||
__RCSID("$NetBSD: rpc_parse.c,v 1.16 2009/05/06 14:30:51 ginsbach Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -578,6 +578,10 @@ get_type(prefixp, typep, dkind)
|
|||
*typep = "long";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
case TOK_HYPER:
|
||||
*typep = "longlong_t";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
case TOK_VOID:
|
||||
if (dkind != DEF_UNION && dkind != DEF_PROGRAM) {
|
||||
error("voids allowed only inside union and program definitions with one argument");
|
||||
|
@ -591,6 +595,7 @@ get_type(prefixp, typep, dkind)
|
|||
case TOK_FLOAT:
|
||||
case TOK_DOUBLE:
|
||||
case TOK_BOOL:
|
||||
case TOK_QUAD:
|
||||
*typep = tok.str;
|
||||
break;
|
||||
default:
|
||||
|
@ -620,6 +625,11 @@ unsigned_dec(typep)
|
|||
*typep = "u_long";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
case TOK_HYPER:
|
||||
get_token(&tok);
|
||||
*typep = "u_longlong_t";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
case TOK_INT:
|
||||
get_token(&tok);
|
||||
*typep = "u_int";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc_scan.c,v 1.10 2006/03/20 17:01:26 elad Exp $ */
|
||||
/* $NetBSD: rpc_scan.c,v 1.11 2009/05/06 14:30:51 ginsbach Exp $ */
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI";
|
||||
#else
|
||||
__RCSID("$NetBSD: rpc_scan.c,v 1.10 2006/03/20 17:01:26 elad Exp $");
|
||||
__RCSID("$NetBSD: rpc_scan.c,v 1.11 2009/05/06 14:30:51 ginsbach Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -414,8 +414,10 @@ static token symbols[] = {
|
|||
{TOK_UNSIGNED, "unsigned"},
|
||||
{TOK_SHORT, "short"},
|
||||
{TOK_LONG, "long"},
|
||||
{TOK_HYPER, "hyper"},
|
||||
{TOK_FLOAT, "float"},
|
||||
{TOK_DOUBLE, "double"},
|
||||
{TOK_QUAD, "quadruple"},
|
||||
{TOK_STRING, "string"},
|
||||
{TOK_PROGRAM, "program"},
|
||||
{TOK_VERSION, "version"},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rpc_scan.h,v 1.7 2003/10/27 00:12:43 lukem Exp $ */
|
||||
/* $NetBSD: rpc_scan.h,v 1.8 2009/05/06 14:30:51 ginsbach Exp $ */
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
|
@ -70,9 +70,11 @@ enum tok_kind {
|
|||
TOK_INT,
|
||||
TOK_SHORT,
|
||||
TOK_LONG,
|
||||
TOK_HYPER,
|
||||
TOK_UNSIGNED,
|
||||
TOK_FLOAT,
|
||||
TOK_DOUBLE,
|
||||
TOK_QUAD,
|
||||
TOK_OPAQUE,
|
||||
TOK_CHAR,
|
||||
TOK_STRING,
|
||||
|
|
Loading…
Reference in New Issue