Ignore:
Timestamp:
Oct 8, 2007, 2:24:31 AM (18 years ago)
Author:
bird
Message:

more fixes - it all compiles now (linking fails of course).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/generated/arith.c

    r1199 r1222  
    4444 */
    4545
    46 #include <sys/cdefs.h>
     46#if 0
    4747#ifndef lint
    48 #if 0
    4948static char sccsid[] = "@(#)arith.y     8.3 (Berkeley) 5/4/95";
    5049#else
    5150__RCSID("$NetBSD: arith.y,v 1.17 2003/09/17 17:33:36 jmmv Exp $");
    52 #endif
    5351#endif /* not lint */
     52#endif
    5453
    5554#include <stdlib.h>
     
    5958#include "output.h"
    6059#include "memalloc.h"
    61 
     60#include "shinstance.h"
     61
     62shinstance *arith_psh;
    6263const char *arith_buf, *arith_startbuf;
    6364
     
    294295#define yystacksize YYSTACKSIZE
    295296int
    296 arith(s)
    297         const char *s;
     297arith(shinstance *psh, const char *s)
    298298{
    299299        long result;
    300300
     301        INTOFF;
     302/* todo lock */
     303   arith_psh = psh;
    301304        arith_buf = arith_startbuf = s;
    302 
    303         INTOFF;
    304305        result = yyparse();
    305306        arith_lex_reset();      /* reprime lex */
     307   arith_psh = NULL;
     308/* todo unlock */
    306309        INTON;
    307310
     
    314317 */
    315318int
    316 expcmd(argc, argv)
    317         int argc;
    318         char **argv;
     319expcmd(shinstance *psh, int argc, char **argv)
    319320{
    320321        const char *p;
     
    344345                p = "";
    345346
    346         i = arith(p);
     347        i = arith(psh, p);
    347348
    348349        out1fmt(psh, "%ld\n", i);
     
    367368
    368369void
    369 yyerror(s)
    370         const char *s;
    371 {
    372 
     370yyerror(const char *s)
     371{
     372   shinstance *psh = arith_psh;
    373373        yyerrok;
    374374        yyclearin;
    375375        arith_lex_reset();      /* reprime lex */
    376         error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
     376/** @todo unlock */
     377        error(psh, "arithmetic expression: %s: \"%s\"", s, arith_startbuf);
    377378        /* NOTREACHED */
    378379}
     
    382383#define YYERROR goto yyerrlab
    383384#ifdef __cplusplus
    384 extern "C" {
     385extern "C" { 
    385386char * getenv();
    386387int yylex();
Note: See TracChangeset for help on using the changeset viewer.