Category : Files from Magazines
Archive   : PJ82.ZIP
Filename : FIG.5

 
Output of file : FIG.5 contained in archive : PJ82.ZIP
/* Excerpts from the Yacc module for the Windows DDE Communications server. */

%{
static int portnum;
static int cmd;
static int dcbbuf[MAXSIZE];
static int dcbndx = -1;

/* define our ownd error message handler */
#undef yyerror
#define yyerror(msg) myerror(msg)
%}

%token '[' ']' '(' ')' '"' ','
%token SETDCB
%token INTEGER

%%
exestring : exestring command
| /* NULL */
;
command : '[' opcodestr ']' { /* execute command */
if (cmd == SETDCB) {
cmd = 0;
if (SetDCB()) /* failed, show error */
YYABORT;
}
}
;
opcodestr : opcode
| opcode parameterlist
;
parameterlist : '(' parameters ')'
;
parameters : parameter
| parameters ',' parameter
;
parameter : '"' quotedop '"'
;
opcode : SETDCB { /* initialize command type and dcbbuf parameters */
cmd = SETDCB;
for (dcbndx = 0; dcbndx < MAXSIZE; dcbndx++)
dcbbuf[dcbndx] = -1;
dcbndx = -1;
}
;
quotedop : field
| quotedop ',' field
;
field : INTEGER { /* enter this value into dcbbuf */
if (dcbndx++ < MAXSIZE) dcbbuf[dcbndx] = $1;
}
| { /* empty field, so just bump pointer */
dcbndx++;
}
;
%%

/* handle the execute string from the client */
void FAR DDEExecute(HWND hWnd, HWND hClient, HANDLE hCommand, WORD index)
{
WORD wStatus = 0;
portnum = index;

if (cmdstr = GlobalLock(hCommand)) {
wStatus = (yyparse() == 0 ? 0x8000 : 0);
GlobalUnlock(hCommand);
}
DDEPostMessage(hClient, WM_DDE_ACK, hWnd, MAKELONG(wStatus, hCommand));
}

myerror(msg)
{
; // do nothing
}


  3 Responses to “Category : Files from Magazines
Archive   : PJ82.ZIP
Filename : FIG.5

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/