Ignore:
Timestamp:
Oct 7, 2007, 1:57:35 AM (18 years ago)
Author:
bird
Message:

input.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shinstance.h

    r1199 r1201  
    2727#ifndef ___shinstance_h___
    2828#define ___shinstance_h___
     29
     30#include <stdio.h> /* BUFSIZ */
    2931
    3032#include "shtypes.h"
     
    3638#include "var.h"
    3739
     40/* memalloc.c */
    3841#define MINSIZE 504             /* minimum size of a block */
    3942struct stack_block {
     
    4144        char space[MINSIZE];
    4245};
     46
     47/* input.c */
     48struct strpush {
     49        struct strpush *prev;   /* preceding string on stack */
     50        char *prevstring;
     51        int prevnleft;
     52        int prevlleft;
     53        struct alias *ap;       /* if push was associated with an alias */
     54};
     55
     56/*
     57 * The parsefile structure pointed to by the global variable parsefile
     58 * contains information about the current file being read.
     59 */
     60struct parsefile {
     61        struct parsefile *prev; /* preceding file on stack */
     62        int linno;              /* current line */
     63        int fd;                 /* file descriptor (or -1 if string) */
     64        int nleft;              /* number of chars left in this line */
     65        int lleft;              /* number of chars left in this buffer */
     66        char *nextc;            /* next char in buffer */
     67        char *buf;              /* input buffer */
     68        struct strpush *strpush; /* for pushing strings at this level */
     69        struct strpush basestrpush; /* so pushing one is fast */
     70};
     71
    4372
    4473
     
    136165    struct stackmark   *markp;
    137166
    138 
    139167    /* jobs.h */
    140168    pid_t               backgndpid;     /**< pid of last background process */
     
    142170
    143171    /* input.h */
    144     int                 plinno;
     172    int                 plinno/* = 1 */;/**< input line number */
    145173    int                 parsenleft;     /**< number of characters left in input buffer */
    146174    char               *parsenextc;     /**< next character in input buffer */
    147     int                 init_editline;  /**< 0 == not setup, 1 == OK, -1 == failed */
     175    int                 init_editline/* = 0 */;     /**< 0 == not setup, 1 == OK, -1 == failed */
     176
     177    /* input.c */
     178    int                 parselleft;     /**< copy of parsefile->lleft */
     179    struct parsefile    basepf;         /**< top level input file */
     180    char                basebuf[BUFSIZ];/**< buffer for top level input file */
     181    struct parsefile   *parsefile/* = &basepf*/;    /**< current input file */
     182#ifndef SMALL
     183    EditLine           *el;             /**< cookie for editline package */
     184#endif
     185
    148186
    149187    /* exec.h */
Note: See TracChangeset for help on using the changeset viewer.