/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
/*
* Print to current player similar to printf().
- * Use printf-style FORMAT with the optional arguments.
+ * Use printf-style @format with the optional arguments.
* Note: `to print' without further qualifications means sending
* C_DATA text.
*/
}
/*
- * Print UTF-8 text BUF to current player.
+ * Print UTF-8 text @buf to current player.
*/
void
uprnf(char *buf)
}
/*
- * Send some text to P with id ID, line-buffered.
- * Format text to send using printf-style FORMAT and optional
+ * Send some text to @p with id @id, line-buffered.
+ * Format text to send using printf-style @format and optional
* arguments. It is assumed to be already user text. Plain ASCII and
* text received from the same player are fine, for anything else the
* caller has to deal with output filtering.
}
/*
- * Send C_FLASH text to PL.
- * Format text to send using printf-style FORMAT and optional
+ * Send C_FLASH text to @pl.
+ * Format text to send using printf-style @format and optional
* arguments. It is assumed to be UTF-8.
* Initiate an output queue flush, but do not wait for it to complete.
*/
}
/*
- * Send C_INFORM text to PL.
- * Format text to send using printf-style FORMAT and optional
+ * Send C_INFORM text to @pl.
+ * Format text to send using printf-style @format and optional
* arguments. It is assumed to be plain ASCII.
* Initiate an output queue flush, but do not wait for it to complete.
*/
/*
* Send C_FLASH text to everyone.
- * Format text to send using printf-style FORMAT and optional
+ * Format text to send using printf-style @format and optional
* arguments. It is assumed to be plain ASCII.
* Prefix text it with a header suitable for broadcast from deity.
* Initiate an output queue flush, but do not wait for it to complete.
}
/*
- * Send ID text BUF to PL, line-buffered.
- * BUF is user text.
+ * Send @id text @buf to @pl, line-buffered.
+ * @buf is user text.
* If a partial line with different id is buffered, terminate it with
* a newline first.
*/
}
/*
- * Send ID text BUF to PL, line-buffered.
+ * Send @id text @buf to @pl, line-buffered.
* This function translates from normal text to user text.
* If a partial line with different id is buffered, terminate it with
* a newline first.
}
/*
- * Send id N to PL.
+ * Send id @n to @pl.
* This runs always at the beginning of a line.
*/
static void
}
/*
- * Send redirection request REDIR to the current player.
- * REDIR is UTF-8, but non-ASCII characters can occur only if the
+ * Send redirection request @redir to the current player.
+ * @redir is UTF-8, but non-ASCII characters can occur only if the
* player sent them. Therefore, it is also user text.
*/
void
}
/*
- * Send script execute request FILE to the current player.
- * FILE is UTF-8, but non-ASCII characters can occur only if the
+ * Send script execute request @file to the current player.
+ * @file is UTF-8, but non-ASCII characters can occur only if the
* player sent them. Therefore, it is also user text.
*/
void
/*
* Prompt for a line of non-command input.
- * Send C_FLUSH prompt PROMPT to the current player.
- * Read a line of input into BUF[SIZE] and convert it to ASCII.
+ * Send C_FLUSH prompt @prompt to the current player.
+ * Read a line of input into @buf[@size] and convert it to ASCII.
* This may block for input, yielding the processor. Flush buffered
* output when blocking, to make sure player sees the prompt.
- * Return number of bytes in BUF[], not counting the terminating 0,
+ * Return number of bytes in @buf[], not counting the terminating 0,
* or -1 on error.
*/
int
/*
* Prompt for a line of non-command, UTF-8 input.
- * Send C_FLUSH prompt PROMPT to the current player.
- * Read a line of input into BUF[SIZE], replacing funny characters by
+ * Send C_FLUSH prompt @prompt to the current player.
+ * Read a line of input into @buf[@size], replacing funny characters by
* '?'. The result is UTF-8.
* This may block for input, yielding the processor. Flush buffered
* output when blocking, to make sure player sees the prompt.
- * Return number of bytes in BUF[], not counting the terminating 0,
+ * Return number of bytes in @buf[], not counting the terminating 0,
* or -1 on error.
*/
int
time_t now;
(void)time(&now);
- pr(ctime(&now));
+ pr("%s", ctime(&now));
}
/*
- * Print coordinates X, Y.
- * FORMAT must be a printf-style format string that converts exactly
+ * Print coordinates @x,@y.
+ * @format must be a printf-style format string that converts exactly
* two int values.
*/
void
}
/*
- * Print complete lines to country CN similar to printf().
- * Use printf-style FORMAT with the optional arguments. FORMAT must
+ * Print complete lines to country @cn similar to printf().
+ * Use printf-style @format with the optional arguments. @format must
* end with '\n'.
- * If CN is zero, don't print anything.
- * Else, if CN is the current player and we're not in the update,
+ * If @cn is zero, don't print anything.
+ * Else, if @cn is the current player and we're not in the update,
* print just like pr(). Else print into a bulletin.
* Because printing like pr() requires normal text, and bulletins
* require user text, only plain ASCII is allowed.
}
/*
- * Copy SRC without funny characters to DST.
+ * Copy @src without funny characters to @dst.
* Drop control characters, except for '\t'.
* Replace non-ASCII characters by '?'.
- * Return length of DST.
- * DST must have space. If it overlaps SRC, then DST <= SRC must
+ * Return length of @dst.
+ * @dst must have space. If it overlaps @src, then @dst <= @src must
* hold.
*/
size_t
}
/*
- * Copy UTF-8 SRC without funny characters to DST.
+ * Copy UTF-8 @src without funny characters to @dst.
* Drop control characters, except for '\t'.
* FIXME Replace malformed UTF-8 sequences by '?'.
- * Return byte length of DST.
- * DST must have space. If it overlaps SRC, then DST <= SRC must
+ * Return byte length of @dst.
+ * @dst must have space. If it overlaps @src, then @dst <= @src must
* hold.
*/
size_t
}
/*
- * Copy UTF-8 SRC without funny characters to ASCII DST.
+ * Copy UTF-8 @src without funny characters to ASCII @dst.
* Drop control characters, except for '\t'.
* Replace non-ASCII characters by '?'.
- * Return length of DST.
- * DST must have space. If it overlaps SRC, then DST <= SRC must
+ * Return length of @dst.
+ * @dst must have space. If it overlaps @src, then @dst <= @src must
* hold.
*/
size_t
}
/*
- * Return byte-index of the N-th UTF-8 character in UTF-8 string S.
- * If S doesn't have that many characters, return its length instead.
+ * Return byte-index of the @n-th UTF-8 character in UTF-8 string @s.
+ * If @s doesn't have that many characters, return its length instead.
*/
int
ufindpfx(char *s, int n)