Changeset 1198 for trunk/src/kash/show.c


Ignore:
Timestamp:
Oct 6, 2007, 11:19:19 PM (18 years ago)
Author:
bird
Message:

moving globals into shinstance...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/show.c

    r809 r1198  
    276276trputc(int c)
    277277{
    278         if (debug != 1)
     278        if (debug(psh) != 1)
    279279                return;
    280280        putc(c, tracefile);
     
    283283
    284284void
    285 trace(const char *fmt, ...)
     285trace(shinstance *psh, const char *fmt, ...)
    286286{
    287287#ifdef DEBUG
    288288        va_list va;
    289289
    290         if (debug != 1)
     290        if (debug(psh) != 1)
    291291                return;
    292292        fprintf(tracefile, "[%d] ", getpid());
     
    298298
    299299void
    300 tracev(const char *fmt, va_list va)
    301 {
    302 #ifdef DEBUG
    303         if (debug != 1)
     300tracev(shinstance *psh, const char *fmt, va_list va)
     301{
     302#ifdef DEBUG
     303        if (debug(psh) != 1)
    304304                return;
    305305        fprintf(tracefile, "[%d] ", getpid());
     
    313313trputs(const char *s)
    314314{
    315         if (debug != 1)
     315        if (debug(psh) != 1)
    316316                return;
    317317        fputs(s, tracefile);
     
    325325        char c;
    326326
    327         if (debug != 1)
     327        if (debug(psh) != 1)
    328328                return;
    329329        putc('"', tracefile);
     
    361361
    362362void
    363 trargs(char **ap)
    364 {
    365 #ifdef DEBUG
    366         if (debug != 1)
     363trargs(shinstance *psh, char **ap)
     364{
     365#ifdef DEBUG
     366        if (debug(psh) != 1)
    367367                return;
    368368        while (*ap) {
     
    386386#endif
    387387
    388         if (debug != 1) {
     388        if (debug(psh) != 1) {
    389389                if (tracefile)
    390390                        fflush(tracefile);
     
    410410                if (!freopen(s, "a", tracefile)) {
    411411                        fprintf(stderr, "Can't re-open %s\n", s);
    412                         debug = 0;
     412                        debug(psh) = 0;
    413413                        return;
    414414                }
     
    416416                if ((tracefile = fopen(s, "a")) == NULL) {
    417417                        fprintf(stderr, "Can't open %s\n", s);
    418                         debug = 0;
     418                        debug(psh) = 0;
    419419                        return;
    420420                }
Note: See TracChangeset for help on using the changeset viewer.