Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : NN0306.ZIP
Filename : SAY_XCMD.C

 
Output of file : SAY_XCMD.C contained in archive : NN0306.ZIP
/* Program: SAY_XCMD.C */
/* Author: Michael Herman */
/* Copyright (c) 1989 Nantucket Corp. All Rights Reserved. */

#include
typedef struct
{
short int paramCount;
Handle params[16];
Handle returnValue;
Boolean passFlag;
void (*entryPoint)();
short int request;
short int result;
long inArgs[8];
long outArgs[4];
} *XCmdBlockPtr;

/* The PASCAL types SpeechOn, Reader, MacinTalk and SpeechOff are
PASCAL functions of MACINTALK being called from within the C
program. Also the XCmdBlockPtr function is taking the place of
MAIN() since XCMDs have no header bytes. */

pascal int SpeechOn(char*, Handle*);
pascal int Reader(Handle, char*, long, Handle);
pascal int MacinTalk(Handle, Handle);
pascal void SpeechOff(Handle);
pascal void main(XCmdBlockPtr);
int Upper(char*);
void strcpy(char*, char*);

pascal void main(paramPtr)
XCmdBlockPtr paramPtr;
{
int err, len;
Handle theSpeech, Phonemes;
asm { move.l a0, a4 } /* So that we can properly access
globals and literals */
paramPtr->returnValue = NewHandle(256L);
if (paramPtr->paramCount > 0)
{
len = Upper(*paramPtr->params[0]);
err = SpeechOn("", &theSpeech);
if (err == 0)
{
Phonemes = NewHandle(0L);
err = Reader(theSpeech, (char*)(*paramPtr->params[0]),
(long) len,Phonemes);
if (err == 0)
{
err = MacinTalk(theSpeech, Phonemes);
if (err == 0)
strcpy((char*)(*paramPtr->returnValue), "Ok.");
else
strcpy((char*)(*paramPtr->returnValue),
"Error: MacinTalk.");
}
else
strcpy((char*)(*paramPtr->returnValue), "Error: Reader.");
DisposHandle(Phonemes);
SpeechOff(theSpeech);
}
else
strcpy((char*)(*paramPtr->returnValue), "Error: Can't load
MacinTalk.");
}
else
strcpy((char*)(*paramPtr->returnValue), "Error: Not enough
parameters.");
}
int Upper(str)
char *str;
{
int i=0;
while (str[i] != 0)
{
if (str[i] > 96 && str[i] < 123)
str[i] &= 0xdf;
i++;
}
return (i);
}
void strcpy(s1, s2)
char *s1, *s2;
{
int i=0;
while (s1[i] = s2[i])
i++;
}


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : NN0306.ZIP
Filename : SAY_XCMD.C

  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/