void SetBlock(int scr, int y, int x, unsigned char type)
{
- if (y >= 0 && y < Players[scr].boardHeight &&
- x >= 0 && x < Players[scr].boardWidth) {
+ if (y >= 0 && y < Players[scr].boardHeight
+ && x >= 0 && x < Players[scr].boardWidth) {
board[scr][y][x] = type;
changed[scr][y] |= 1 << x;
}
EraseShape(Players[scr].curShape, scr,
Players[scr].curY, Players[scr].curX, 1);
result = ShapeFits(Players[scr].curShape, scr, Players[scr].curY + deltaY,
- Players[scr].curX + deltaX);
+ Players[scr].curX + deltaX);
if (result) {
Players[scr].curY += deltaY;
Players[scr].curX += deltaX;
} //try to fit if it doesn't
if (result) Players[scr].curShape = newshape;
PlotShape(Players[scr].curShape, scr,
- Players[scr].curY, Players[scr].curX, scr == me);
+ Players[scr].curY, Players[scr].curX, scr == me);
return result;
} //RotatePiece
EraseShape(Players[scr].curShape, scr,
Players[scr].curY, Players[scr].curX, 1);
while (ShapeFits(Players[scr].curShape, scr,
- Players[scr].curY - 1, Players[scr].curX)) {
+ Players[scr].curY - 1, Players[scr].curX)) {
Players[scr].curY--;
count++;
}
char type;
short color;
} myColorTable[] = {
- { BT_white, COLOR_WHITE },
- { BT_blue, COLOR_BLUE },
- { BT_magenta, COLOR_MAGENTA },
- { BT_cyan, COLOR_CYAN },
- { BT_yellow, COLOR_YELLOW },
- { BT_green, COLOR_GREEN },
- { BT_red, COLOR_RED },
- { BT_none, 0 }
+ { BT_white, COLOR_WHITE },
+ { BT_blue, COLOR_BLUE },
+ { BT_magenta, COLOR_MAGENTA },
+ { BT_cyan, COLOR_CYAN },
+ { BT_yellow, COLOR_YELLOW },
+ { BT_green, COLOR_GREEN },
+ { BT_red, COLOR_RED },
+ { BT_none, 0 }
}; //myColorTable
int i = 0;
} //I've never worked on a color-changable terminal, so no idea..
for (i = 0; myColorTable[i].type != BT_none; ++i)
init_pair(myColorTable[i].type, COLOR_BLACK,
- myColorTable[i].color);
+ myColorTable[i].color);
} //haveColor
#else
haveColor = 0;
#endif
- AtExit(CleanupScreens); //restore everything when done
+ AtExit(CleanupScreens); //restore everything when done
RestoreSignals(NULL, &oldMask);
- cbreak(); //no line buffering
+ cbreak(); //no line buffering
noecho();
-// keypad(stdscr, TRUE); //get arrow/functionkeys 'n stuff
+// keypad(stdscr, TRUE); //get arrow/functionkeys 'n stuff
OutputTermStr(term_vi, 0);
- AddEventGen(&keyGen); //key handler
- signal(SIGWINCH, CatchWinCh); //handle window resize
+ AddEventGen(&keyGen); //key handler
+ signal(SIGWINCH, CatchWinCh); //handle window resize
// ioctl(STDIN_FILENO, KDSKBMODE, K_MEDIUMRAW);
- standend(); //normal text
+ standend(); //normal text
memset(messages, 0, sizeof(messages)); //empty messages
{
int i;
for (i = 0; i<MSG_HEIGHT; i++)
- message[i] = messages[i]; //set pointers
+ message[i] = messages[i]; //set pointers
}
} //InitScreens
void CleanupScreens(void)
{
RemoveEventGen(&keyGen);
- endwin(); //end curses
+ endwin(); //end curses
OutputTermStr(term_ve, 1);
} //CleanupScreens
*/
if (!term_vi || !term_ve) {
static char *vts[] = {
- "vt100", "vt101", "vt102",
- "vt200", "vt220", "vt300",
- "vt320", "vt400", "vt420",
- "screen", "xterm", NULL };
+ "vt100", "vt101", "vt102",
+ "vt200", "vt220", "vt300",
+ "vt320", "vt400", "vt420",
+ "screen", "xterm", NULL };
int i;
for (i = 0; vts[i]; i++)
fprintf(stderr, "Duplicate key mappings:\n");
errs++;
fprintf(stderr, " %s mapped to both %s and %s\n",
- scratch, keyNames[used[ch]-1], keyNames[k]);
+ scratch, keyNames[used[ch]-1], keyNames[k]);
}
used[ch] = k + 1;
}
Players[scr].curY = Players[scr].boardVisible + 4;
Players[scr].curX = Players[scr].boardWidth / 2 - 2;
while (!ShapeVisible(Players[scr].curShape, scr,
- Players[scr].curY, Players[scr].curX))
+ Players[scr].curY, Players[scr].curX))
Players[scr].curY--;
if (!ShapeFits(Players[scr].curShape, scr,
Players[scr].curY, Players[scr].curX))
Game.speed /= SPEEDINC;
if (Game.speed < SPEEDMINIMUM)
Game.speed = SPEEDMINIMUM;
- ResetBaseTime(); //reset timer
+ ResetBaseTime(); //reset timer
SetITimer(Game.speed, Game.speed);
Players[me].nextShape = ChooseOption(stdOptions);
for (i = 1; i <= maxPlayer; i++) {
// int linevaluesq[] = { 25, 50, 100, 200, 500, 720, 980, 1280, 1620, 2000,
// 2420, 2880, 3380, 3920, 4500, 5120, 5780, 6480 };
int linevaluesq[] = { 20, 50, 100, 200, 500, 750, 1000, 1250, 1500, 2000,
- 2500, 3000, 3500, 4000, 4500, 5000, 6000, 7500 };
+ 2500, 3000, 3500, 4000, 4500, 5000, 6000, 7500 };
if ((linesCleared = ClearFullLines(scr)) > 0) {
if (game == GT_onePlayer)
// ReadConf(optarg);
// else
ReadConf(CONFIG_FILE);
- while ((ch = getopt_long(argc, argv,
- "hHRk:c:n:odDSCap:i:l:t:", options, NULL)) != -1)
+ while ((ch = getopt_long(
+ argc, argv, "hHRk:c:n:odDSCap:i:l:t:", options, NULL
+ )) != -1)
HandleOption(ch, optarg);
if (optind < argc) {
Usage();
}
// WriteConf();
- InitScreens(); //setup screen
+ InitScreens(); //setup screen
if (game == GT_classicTwo) {
spied = 1;
InitiateConnection(hostStr, port);
{
static struct {
int playerflags;
- int maxplayers; //1
- int started; //2
- int continuous; //3
- long seed; //4
- int initspeed; //5
+ int maxplayers; //1
+ int started; //2
+ int continuous; //3
+ long seed; //4
+ int initspeed; //5
} data;
memcpy(&data, event.u.net.data, event.u.net.size);
#include <stdio.h>
#include <signal.h>
-#define version_string "0.8"
+#define version_string "0.8"
-#ifdef NOEXT //prevent re-declaration
+#ifdef NOEXT //prevent re-declaration
# define EXT
#else
# define EXT extern
#define ntoh4(x) ntohl(x)
/* Protocol versions */
-#define MAJOR_VERSION 1
-#define PROTOCOL_VERSION 4
+#define MAJOR_VERSION 1
+#define PROTOCOL_VERSION 4
-#define DEFAULT_PORT 9284 /* Very arbitrary */
+#define DEFAULT_PORT 9284 /* Very arbitrary */
#define CONFIG_FILE "netris.conf"
//#define DEFAULT_KEYS "4685 2fp^lq"
#define DEFAULT_KEYS "dcaf b^fp^lq"
-#define MAX_BOARD_WIDTH 32
-#define MAX_BOARD_HEIGHT 64
-#define MAX_SCREENS 9 //8 players
+#define MAX_BOARD_WIDTH 32
+#define MAX_BOARD_HEIGHT 64
+#define MAX_SCREENS 9 //8 players
/* Event masks */
-#define EM_alarm 000001
-#define EM_key 000002
-#define EM_net 000004
-#define EM_connect 000020
-#define EM_any 000777
+#define EM_alarm 000001
+#define EM_key 000002
+#define EM_net 000004
+#define EM_connect 000020
+#define EM_any 000777
typedef enum _GameType { GT_onePlayer, GT_classicTwo, GT_len } GameType;
typedef enum _BlockTypeA {
E_none, E_alarm, E_key, E_connect, E_net, E_lostConn
} MyEventType;
typedef enum _NetPacketType {
- NP_endConn, //client/server quits
- NP_byeBye, //unused atm
- NP_error, //handshake error
- NP_hello, //check versions
- NP_gamedata, //game options
-
- NP_start, //game ok to start
- NP_pause, //player (un)pauses
- NP_stop, //game ended
- NP_newPlayer, //add new player
- NP_team, //player switched teams
- NP_argghhh, //player died
- NP_part, //player left
-
- NP_msg, //chat message
-
- NP_newPiece, //new piece info
- NP_rotright, //rotate piece clockwise
- NP_rotleft, //rotate piece counterclockwise
- NP_left, //move piece left
- NP_right, //move piece right
- NP_down, //move piece one down
- NP_drop, //drop piece to bottom
- NP_clear, //line cleared
- NP_insertJunk, //player added junk
-
- NP_giveJunk //player has to add junk
+ NP_endConn, //client/server quits
+ NP_byeBye, //unused atm
+ NP_error, //handshake error
+ NP_hello, //check versions
+ NP_gamedata, //game options
+
+ NP_start, //game ok to start
+ NP_pause, //player (un)pauses
+ NP_stop, //game ended
+ NP_newPlayer, //add new player
+ NP_team, //player switched teams
+ NP_argghhh, //player died
+ NP_part, //player left
+
+ NP_msg, //chat message
+
+ NP_newPiece, //new piece info
+ NP_rotright, //rotate piece clockwise
+ NP_rotleft, //rotate piece counterclockwise
+ NP_left, //move piece left
+ NP_right, //move piece right
+ NP_down, //move piece one down
+ NP_drop, //drop piece to bottom
+ NP_clear, //line cleared
+ NP_insertJunk, //player added junk
+
+ NP_giveJunk //player has to add junk
} NetPacketType;
typedef struct {
} Shape;
/* NP_startConn flags */
-#define SCF_paused 1
+#define SCF_paused 1
typedef struct {
int alive;
long score;
int pieces, lines, adds;
} score;
- char host[256]; //last
+ char host[256]; //last
} _Player;
EXT _Player Players[MAX_SCREENS];
EXT short me;
EXT short maxPlayer;
EXT int spied; //in player.flags
-#define DEFAULT_INTERVAL 1000000 /* Step-down interval in microseconds */
-#define SPEEDINC 1.2
-#define SPEEDMINIMUM 40000
+#define DEFAULT_INTERVAL 1000000 /* Step-down interval in microseconds */
+#define SPEEDINC 1.2
+#define SPEEDMINIMUM 40000
typedef struct {
- int gravity; //1
- int started; //2
- int continuous; //3
- long seed; //4
- int initspeed; //5
+ int gravity; //1
+ int started; //2
+ int continuous; //3
+ long seed; //4
+ int initspeed; //5
int speed;
} _Game;
EXT _Game Game;
#define HEADER_SIZE sizeof(netint4[3])
static struct option options[] = {
- { "wait", 0, 0, 'w' },
- { "port", 1, 0, 'p' },
- { "quadra", 1, 0, 'q' },
- { "min-players",1, 0, 'm' },
- { "max-players",1, 0, 'x' },
- { "continuous", 1, 0, 'c' },
- { "speed", 1, 0, 'i' },
- { "seed", 1, 0, 's' },
- { "verbose", 0, 0, 'v' },
- { "info", 0, 0, 'H' },
- { "help", 0, 0, 'h' },
- { 0, 0, 0, 0 }
+ { "wait", 0, 0, 'w' },
+ { "port", 1, 0, 'p' },
+ { "quadra", 1, 0, 'q' },
+ { "min-players", 1, 0, 'm' },
+ { "max-players", 1, 0, 'x' },
+ { "continuous", 1, 0, 'c' },
+ { "speed", 1, 0, 'i' },
+ { "seed", 1, 0, 's' },
+ { "verbose", 0, 0, 'v' },
+ { "info", 0, 0, 'H' },
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
};
static char minplayers = 2;
if (netGen[playa].fd >= 0) {
if (Players[playa].alive >= 0) {
SendPacketTo(playa, 0, NP_endConn, 0, NULL);
- do{} while (WaitMyEvent(&event, EM_net) != E_lostConn);
+ do {} while (WaitMyEvent(&event, EM_net) != E_lostConn);
} //say bye to player
close(netGen[playa].fd);
netGen[playa].fd = -1;
sprintf(Players[new].host, "%s", inet_ntoa(addr.sin_addr));
if (addr.sin_family == AF_INET) {
host = gethostbyaddr((void *)&addr.sin_addr,
- sizeof(struct in_addr), AF_INET);
+ sizeof(struct in_addr), AF_INET);
if (host) {
strncpy(Players[new].host, host->h_name,
sizeof(Players[new].host) - 1);
int paused = 1;
int i;
char teams[10][7] = { "", "Green", "Cyan", "Blue", "Purple",
- "Red", "Grey", "White", "*Orange" };
+ "Red", "Grey", "White", "*Orange" };
do {
switch (WaitMyEvent(&event, EM_any)) {
major = ntoh4(versiondata[0]);
protocolVersion = ntoh4(versiondata[1]);
if (major != MAJOR_VERSION
- || protocolVersion != PROTOCOL_VERSION) {
+ || protocolVersion != PROTOCOL_VERSION) {
snprintf(data, sizeof(data),
"Version mismatch: received %d.%d",
major, protocolVersion);
sendtoall:
// if (event.u.net.type >= NP_pause)
if (event.u.net.type >= NP_rotright
- && Game.started < 2)
+ && Game.started < 2)
break;
for (i = 1; i < MAX_SCREENS; i++)
if (i != event.u.net.sender)
void SHeader(void)
{
fprintf(stderr,
- "NETRIS Server %s\t(c) 2002 Shiar <shiar@shiar.org>\n\n",
- version_string);
+ "NETRIS Server %s\t(c) 2002 Shiar <shiar@shiar.org>\n\n",
+ version_string);
}
void SUsage(void)
{
SHeader();
fprintf(stderr,
- "Usage: netris <options>\n"
- "\n"
- " -h, --help\t\tPrint this usage information\n"
- " -H, --info\t\tShow distribution and warranty information\n"
- "\n"
- " -p, --port <port>\tSet port number (default is %d)\n"
- "\n"
- " -s, --seed <seed>\tStart with given random seed\n"
- " -i, --speed <sec>\tSet the initial step-down interval, in seconds\n"
- " -m, --min-players <2>\tNumber of players required before starting the game\n"
- " -x, --max-players <8>\tMaximum number of players allowed in the game\n"
- " -c, --continuous\tDon'n quit the game\n"
- "\n", DEFAULT_PORT);
+ "Usage: netris <options>\n"
+ "\n"
+ " -h, --help\t\tPrint this usage information\n"
+ " -H, --info\t\tShow distribution and warranty information\n"
+ "\n"
+ " -p, --port <port>\tSet port number (default is %d)\n"
+ "\n"
+ " -s, --seed <seed>\tStart with given random seed\n"
+ " -i, --speed <sec>\tSet the initial step-down interval, in seconds\n"
+ " -m, --min-players <2>\tNumber of players required before starting the game\n"
+ " -x, --max-players <8>\tMaximum number of players allowed in the game\n"
+ " -c, --continuous\tDon'n quit the game\n"
+ "\n", DEFAULT_PORT);
}
void WriteConf(void)
void HandleOption(char tag, char *value)
{
switch (tag) {
- case 'v': //verbose
+ case 'v': //verbose
verbose = 1;
break;
- case 'p': //port
+ case 'p': //port
port = atoi(value);
break;
- case 'c': //min-players
+ case 'c': //min-players
Game.continuous = atoi(value);
break;
- case 'm': //min-players
+ case 'm': //min-players
minplayers = atoi(value);
break;
- case 'x': //max-players
+ case 'x': //max-players
maxplayers = atoi(value);
if (maxplayers >= MAX_SCREENS)
maxplayers = MAX_SCREENS;
break;
- case 'q': //quadra-style gravity
+ case 'q': //quadra-style gravity
Game.gravity ^= 1;
break;
- case 'i': //speed (of level 1)
+ case 'i': //speed (of level 1)
Game.initspeed = atof(value) * 1e6;
break;
- case 's': //seed
+ case 's': //seed
Game.seed = atoi(value);
break;
- case 'H': //info
+ case 'H': //info
SHeader();
DistInfo(); exit(0);
- case 'h': //help
+ case 'h': //help
SUsage(); exit(0);
default:
break;
if ((ch = strchr(buf, '#')))
*ch = '\0'; // truncate string from # char
for (i = strlen(buf)-1; i >= 0; i--)
- if (buf[i] == ' ' || buf[i] == '\t'
- || buf[i] == '\n' || buf[i] == 13)
+ if (buf[i] == ' ' || buf[i] == '\t'
+ || buf[i] == '\n' || buf[i] == 13)
buf[i] = '\0';
else break;
// ReadConf(optarg);
// else
ReadConf(CONFIG_FILE);
- while ((ch = getopt_long(argc, argv,
- "hHvqp:i:s:c:m:x:", options, NULL)) != -1)
+ while ((ch = getopt_long(
+ argc, argv, "hHvqp:i:s:c:m:x:", options, NULL
+ )) != -1)
HandleOption(ch, optarg);
if (optind < argc) {
SUsage();
die("socket");
val1 = 1;
setsockopt(connGen.fd, SOL_SOCKET, SO_REUSEADDR,
- (void *)&val1, sizeof(val1));
+ (void *)&val1, sizeof(val1));
if (bind(connGen.fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
die("bind");
if (listen(connGen.fd, 1) < 0)
static MyEventType AlarmGenFunc(EventGenRec *gen, MyEvent *event);
static EventGenRec alarmGen =
- { &alarmGen, 0, FT_read, -1, AlarmGenFunc, EM_alarm };
+ { &alarmGen, 0, FT_read, -1, AlarmGenFunc, EM_alarm };
static EventGenRec *nextGen = &alarmGen;
static int myRandSeed = 1;
void Header(void)
{
fprintf(stderr,
- "NETRIS %s\t(c) 1994-1996,1999 Mark H. Weaver <mhw@netris.org>\n"
- " \t(c) 2002 Shiar <shiar@shiar.org>\n\n",
- version_string);
+ "NETRIS %s\t(c) 1994-1996,1999 Mark H. Weaver <mhw@netris.org>\n"
+ " \t(c) 2002 Shiar <shiar@shiar.org>\n\n",
+ version_string);
} //Header
void Usage(void)
{
Header();
fprintf(stderr,
- "Usage: netris <options>\n"
- "\n"
- " -h, --help\t\tPrint this usage information\n"
- " -H, --info\t\tShow distribution and warranty information\n"
- " -R, --rules\t\tShow game rules\n"
- "\n"
- " -S, --slowterm\tDisable inverse/bold/color for slow terminals\n"
- " -a, --ascii\t\tUse ascii characters\n"
- " -C, --color=0\t\tDisable color\n"
- "\n"
- " -c, --connect <host>\tInitiate connection\n"
- " -p, --port <port>\tSet port number (default is %d)\n"
- "\n"
- " -t, --team <team>\tJoin a team (don't receive lines from your teammates)\n"
- " -l, --level <lvl>\tBegin at a higher level (can be used as handicap)\n"
- " -k, --keys <keys>\tRemap keys (default is \"%s\" for cursors)\n"
- " -d, --dropmode\tDrops go into drop mode\n"
- " -D, --instadrop\tInstant drop\n"
- "\n"
- " -r, --robot <cmd>\tExecute program to control the game instead of keyboard\n"
- " -F, --fair-robot\tUse fair robot interface\n"
- "\n", DEFAULT_PORT, DEFAULT_KEYS);
+ "Usage: netris <options>\n"
+ "\n"
+ " -h, --help\t\tPrint this usage information\n"
+ " -H, --info\t\tShow distribution and warranty information\n"
+ " -R, --rules\t\tShow game rules\n"
+ "\n"
+ " -S, --slowterm\tDisable inverse/bold/color for slow terminals\n"
+ " -a, --ascii\t\tUse ascii characters\n"
+ " -C, --color=0\t\tDisable color\n"
+ "\n"
+ " -c, --connect <host>\tInitiate connection\n"
+ " -p, --port <port>\tSet port number (default is %d)\n"
+ "\n"
+ " -t, --team <team>\tJoin a team (don't receive lines from your teammates)\n"
+ " -l, --level <lvl>\tBegin at a higher level (can be used as handicap)\n"
+ " -k, --keys <keys>\tRemap keys (default is \"%s\" for cursors)\n"
+ " -d, --dropmode\tDrops go into drop mode\n"
+ " -D, --instadrop\tInstant drop\n"
+ "\n"
+ " -r, --robot <cmd>\tExecute program to control the game instead of keyboard\n"
+ " -F, --fair-robot\tUse fair robot interface\n"
+ "\n", DEFAULT_PORT, DEFAULT_KEYS);
}
void DistInfo(void)
{
fprintf(stderr,
- "This program is free software; you can redistribute it and/or modify\n"
- "it under the terms of the GNU General Public License as published by\n"
- "the Free Software Foundation; either version 2 of the License, or\n"
- "(at your option) any later version.\n"
- "\n"
- "This program is distributed in the hope that it will be useful,\n"
- "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
- "GNU General Public License for more details.\n"
- "\n"
- "You should have received a copy of the GNU General Public License\n"
- "along with this program; if not, write to the Free Software\n"
- "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n"
- "\n");
+ "This program is free software; you can redistribute it and/or modify\n"
+ "it under the terms of the GNU General Public License as published by\n"
+ "the Free Software Foundation; either version 2 of the License, or\n"
+ "(at your option) any later version.\n"
+ "\n"
+ "This program is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "GNU General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU General Public License\n"
+ "along with this program; if not, write to the Free Software\n"
+ "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n"
+ "\n");
} //DistInfo
void Rules(void)
{
Header();
fprintf(stderr,
- "One player mode\n"
- "---------------\n"
- "Good old Tetris. Scoring is like on the GameBoy version (so try to\n"
- "remove as many lines at once as you can). After removing ten lines\n"
- "you go to the next level, which will be faster thus making the game\n"
- "harder to play.\n"
- "\n"
- "Two player mode\n"
- "---------------\n"
- "It's just like normal T*tris except that when you clear more than\n"
- "one row with a single piece, the other player receives penalty lines\n"
- "For clearing 2, 3 or 4 rows, respectively 1, 2 or 4 junk rows will\n"
- "be added to the bottom of your opponent's board respectively.\n"
- "The junk rows have exactly one empty column, which will line up for\n"
- "multiple rows.\n"
- "\n"
- "The longest surviving player wins the game.\n"
- "\n");
+ "One player mode\n"
+ "---------------\n"
+ "Good old Tetris. Scoring is like on the GameBoy version (so try to\n"
+ "remove as many lines at once as you can). After removing ten lines\n"
+ "you go to the next level, which will be faster thus making the game\n"
+ "harder to play.\n"
+ "\n"
+ "Two player mode\n"
+ "---------------\n"
+ "It's just like normal T*tris except that when you clear more than\n"
+ "one row with a single piece, the other player receives penalty lines\n"
+ "For clearing 2, 3 or 4 rows, respectively 1, 2 or 4 junk rows will\n"
+ "be added to the bottom of your opponent's board respectively.\n"
+ "The junk rows have exactly one empty column, which will line up for\n"
+ "multiple rows.\n"
+ "\n"
+ "The longest surviving player wins the game.\n"
+ "\n");
} //Rules
///////////// RANDOM /////////////
tv.tv_sec = 0;
tv.tv_usec = (retry && !anyReady) ? 500000 : 0;
result = select(FD_SETSIZE, &fds[FT_read], &fds[FT_write],
- &fds[FT_except], anyReady ? &tv : NULL);
+ &fds[FT_except], anyReady ? &tv : NULL);
}
else {
if (retry && !anyReady)
}
gen = nextGen;
do {
- if ((gen->mask & mask)
- && (gen->ready || (result > 0 && gen->fd >= 0
- && FD_ISSET(gen->fd, &fds[gen->fdType])))) {
+ if ((gen->mask & mask) && (gen->ready || (
+ result > 0 && gen->fd >= 0
+ && FD_ISSET(gen->fd, &fds[gen->fdType])
+ ))) {
gen->ready = 0;
event->type = gen->func(gen, event);
if (event->type != E_none) {