From:	MERC::"uunet!WKUVX1.BITNET!MacroMan" 30-MAR-1993 11:58:19.90
To:	MACRO32@WKUVX1.BITNET
CC:	
Subj:	Re: SHOW$DEBUG

In article <733441383.906564.MILLER@TGV.COM>, <MILLER@TGV.COM> writes:
> I like to catch the $TRNLNM call.  The only really interesting thing
> I've found so far is TTY$EXIT_STRING.

That is good, but doesn't give you bulk info all at once.
So I like to run a procedure like this using a hacked-up STRINGS for VMS:

 $ CREATE/DIR [.STRINGS]
 $ PAT = "SYS$SYSTEM:*.EXE;"
 $ IF P1 .NES. "" THEN PAT = P1
 $LOOP:
 $ E = F$SEARCH(PAT)
 $ IF E .EQS. "" THEN GOTO ENDLOOP
 $ N = F$PARSE(E,,,"NAME")
 $ WRITE SYS$OUTPUT N
 $ STRINGS 'E' [.STRINGS]'N'
 $ GOTO LOOP
 $ENDLOOP:
 $EXIT

Then search [.STRINGS]*. for DEBUG and LOG and other things like that.
It has been especially useful for picking up debug and logging mechanisms
for use with the decwindows/motif images.

How about OPC$DEBUG_FILE and OPC$DEBUG_TERMINAL?


--------

/* 18-APR-91 GJC@MITECH.COM
   A rather hacked-up program to find "strings" (zero and return/linefeed
   terminated stuff) in a file.
*/

#include <stdio.h>
#include <ctype.h>

/* This code wants to zip through the file as quickly as possible,
   so bypassing the idiotic getc of VAXCRTL is very important.
*/

/* This XGETC works on all files getc works on, except: HA, STREAM_LF files!
   Where it will see extra bytes at the end of the file.
 */

#define xgetc(p) \
 (--(*p)->_cnt>=0 ? \
  ((int) * ((unsigned char *) (*p)->_ptr++)) : \
  ((*p)->_cnt = 0, getc(p)))

#define isokchar(c) (_ctype_[(c) & 0x7F] & (_P | _U | _L | _D | _B | _S))

main(argc,argv)
     int argc;
     char **argv;
{FILE *f,*fout;
 char *fname,*sbuffer,*p;
 long maxs,j,c;
 if (argc > 1) fname = argv[1]; else fname = "SYS$INPUT:";
 if (!(f = fopen(fname,"rb")))
   {perror(fname);
    exit(1);}
 if (argc > 2)
   {fname = argv[2];
    if (!(fout = fopen(fname,"w")))
      {perror(fname);
       exit(1);}}
 else
   fout = stdout;
 maxs = 1022;
 sbuffer = (char *) malloc(maxs+2);
 j = 0;
 p = sbuffer;
 while((c = xgetc(f)) != EOF)
   {if (!isascii(c))
      {j = 0;
       p = sbuffer;}
    else if ((j == maxs) ||
             ((j > 3) && ((c == '\n') || (c == '\r') || (c == 0))))
      {sbuffer[j] = '\n';
       sbuffer[j+1] = 0;
       fputs(sbuffer,fout);
       j = 0;
       p = sbuffer;}
    else if (isprint(c))
      {*p++ = c;
       ++j;}
    else if (isspace(c) && (j > 0))
      {*p++ = c;
       ++j;}
    else
      {j = 0;
       p = sbuffer;}}
 fclose(f);
 if (fout != stdout) fclose(fout);}


