From: Vern Paxson Date: Mon, 27 Dec 1993 14:40:05 +0000 (+0000) Subject: Added action_define() X-Git-Tag: flex-2-5-5b~219 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29919d726a5b95aed38166da993d5acc71ab9f4c;p=flex Added action_define() --- diff --git a/misc.c b/misc.c index 12e4cf1..744cdfb 100644 --- a/misc.c +++ b/misc.c @@ -38,6 +38,24 @@ void dataflush PROTO((void)); int otoi PROTO((Char [])); +void action_define( defname, value ) +char *defname; +int value; + { + char buf[MAXLINE]; + + if ( strlen( defname ) > MAXLINE / 2 ) + { + format_pinpoint_message( "name \"%s\" ridiculously long", + defname ); + return; + } + + sprintf( buf, "#define %s %d\n", defname, value ); + add_action( buf ); + } + + void add_action( new_text ) char *new_text; { @@ -149,7 +167,7 @@ int c; readable_form( c ) ); if ( c >= csize ) - lerrsf( "scanner requires -8 flag to use the character '%s'", + lerrsf( "scanner requires -8 flag to use the character %s", readable_form( c ) ); }