* Massachusetts.
*
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
*
* Enhancements Copyright 2005 Alessandro Scotti
*
extern void mysrandom(unsigned int seed);
extern int myrandom(void);
-void ZippyInit()
+void
+ZippyInit ()
{
char *p;
#define MAX_SPEECH 250
-void Speak(how, whom)
- char *how, *whom;
+void
+Speak (char *how, char *whom)
{
static FILE *zipfile = NULL;
static struct stat zipstat;
time_t now;
char *p;
int c, speechlen;
- Boolean done;
if (strcmp(how, "shout") == 0) {
now = time((time_t *) NULL);
if (c == EOF) continue;
break;
}
- done = FALSE;
/* Don't use ics_prefix; we need to let FICS expand the alias i -> it,
but use the real command "i" on ICC */
Speak(how, whom); /* tail recursion */
}
-int ZippyCalled(str)
- char *str;
+int
+ZippyCalled (char *str)
{
return ics_handle[0] != NULLCHAR && StrCaseStr(str, ics_handle) != NULL;
}
extern ColorClass curColor;
-static void SetCurColor( ColorClass color )
+static void
+SetCurColor (ColorClass color)
{
curColor = color;
}
-static void ColorizeEx( ColorClass color, int cont )
+static void
+ColorizeEx (ColorClass color, int cont)
{
if( appData.colorize ) {
Colorize( color, cont );
}
}
-int ZippyControl(buf, i)
- char *buf;
- int *i;
+int
+ZippyControl (char *buf, int *i)
{
char *player, *p;
char reply[MSG_SIZ];
return FALSE;
}
-int ZippyConverse(buf, i)
- char *buf;
- int *i;
+int
+ZippyConverse(char *buf, int *i)
{
static char lastgreet[MSG_SIZ];
char reply[MSG_SIZ];
/* Channel tells */
oldi = *i;
if (looking_at(buf, i, "*(*: *")) {
- char *player;
char *channel;
if (star_match[0][0] == NULLCHAR ||
strchr(star_match[0], ' ') ||
return FALSE;
}
if (appData.zippyTalk) {
- player = StripHighlightAndTitle(star_match[0]);
channel = strrchr(star_match[1], '(');
if (channel == NULL) {
channel = star_match[1];
return FALSE;
}
-void ZippyGameStart(white, black)
- char *white, *black;
+void
+ZippyGameStart (char *white, char* black)
{
if (!first.initDone) {
/* Game is starting prematurely. We can't deal with this */
}
}
-void ZippyGameEnd(result, resultDetails)
- ChessMove result;
- char *resultDetails;
+void
+ZippyGameEnd (ChessMove result, char *resultDetails)
{
if (appData.zippyAcceptOnly[0] == NULLCHAR &&
appData.zippyGameEnd[0] != NULLCHAR) {
* Routines to implement Zippy playing chess
*/
-void ZippyHandleChallenge(srated, swild, sbase, sincrement, opponent)
- char *srated, *swild, *sbase, *sincrement, *opponent;
+void
+ZippyHandleChallenge (char *srated, char *swild, char *sbase, char *sincrement, char *opponent)
{
char buf[MSG_SIZ];
- int base, increment, i=0;
- char rated;
+ int i=0;
VariantClass variant;
char *varname;
- rated = srated[0];
variant = StringToVariant(swild);
varname = VariantName(variant);
- base = atoi(sbase);
- increment = atoi(sincrement);
/* [DM] If icsAnalyzeEngine active we don't accept automatic games */
if (appData.icsActive && appData.icsEngineAnalyze) return;
/* Accept matches */
-int ZippyMatch(buf, i)
- char *buf;
- int *i;
+int
+ZippyMatch (char *buf, int *i)
{
if (looking_at(buf, i, "* * match * * requested with * (*)")) {
/* Initialize chess program with data from the first board
* of a new or resumed game.
*/
-void ZippyFirstBoard(moveNum, basetime, increment)
- int moveNum, basetime, increment;
+void
+ZippyFirstBoard (int moveNum, int basetime, int increment)
{
char buf[MSG_SIZ];
int w, b;
void
-ZippyHoldings(white_holding, black_holding, new_piece)
- char *white_holding, *black_holding, *new_piece;
+ZippyHoldings (char *white_holding, char *black_holding, char *new_piece)
{
char buf[MSG_SIZ];
if (gameMode != IcsPlayingBlack && gameMode != IcsPlayingWhite) return;