aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/update-game-score.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF's address.Lute Kamstra2005-07-041-2/+2
|
* Throughout, replace 0 destined for `exit' arg with `EXIT_SUCCESS'.Thien-Thi Nguyen2004-05-081-6/+8
| | | | | Likewise, replace 1 with `EXIT_FAILURE'. (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
* Add arch taglinesMiles Bader2003-09-011-0/+3
|
* (difftime) [!HAVE_DIFFTIME]: Define.Dave Love2003-05-221-1/+23
| | | | (strerror) [!HAVE_STRERROR && !WINDOWSNT]: New.
* (read_scores): Fix corruption of score files.Juanma Barranquero2003-04-271-1/+3
|
* Trailing whitespace deleted.Juanma Barranquero2003-02-041-14/+14
|
* (push_score, read_scores): Cast values of malloc and realloc.Richard M. Stallman2003-02-041-6/+8
| | | | (main, lock_file): Avoid assignment inside if.
* Whitespace changes.Richard M. Stallman2003-02-041-125/+122
|
* Include unistd.h, string.h, stdlib.h,Dave Love2002-11-181-11/+17
| | | | | | | | fcntl.h, stdarg.h conditionally. (_GNU_SOURCE, __attribute__): Don't define. (optarg, optind, opterr): Declare. (lose, lose_syserr): Use NO_RETURN. (get_user_id): Use P_.
* (P_): New macro. Use it for all prototypes.Colin Walters2002-08-011-46/+84
| | | | | | | (lose): Don't use varargs. (lose_syserr): New function. Change all functions to K&R style.
* (SCORE_FILE_PREFIX): Delete.Colin Walters2002-04-291-45/+41
| | | | | | | | | | | (main): New argument -d, for specifying directory. (usage): Document. (get_user_id): Compute (get_home_dir): Deleted. (get_prefix): New function, taken from main. (main): Check whether or not we are running setuid. Move prefix computation to get_prefix. Don't call getpwent; we don't need to any more. Instead, move it to get_user_id().
* (read_score) [HAVE_GETDELIM]: Trim trailing space.Colin Walters2002-04-231-0/+2
|
* Move config.h before the other headers, to prevent compiler warningsEli Zaretskii2002-04-161-1/+2
| | | | due to redifinition of _FILE_OFFSET_BITS.
* (lock_file): If the lock file is older than an hour, delete it. ResetColin Walters2002-04-141-1/+9
| | | | attempts to zero if we have to break the lock.
* (read_score): Fix type of second parameterAndreas Schwab2002-04-141-3/+3
| | | | | of getdelim to be of type size_t instead of int. Use 0 instead of ESUCCES.
* (toplevel): Include stdarg.h.Colin Walters2002-04-101-99/+80
| | | | | | | | | | | | | | | | (MAX_DATA_LEN, MAX_SCORES): New. (SCORE_FILE_PREFIX): If HAVE_SHARED_GAME_DIR is not defined, default to ~/.emacs.d/games. (get_user_id): Don't zero uid in the case where we can't get the username. (lose): New function. (main): Actually use `max', and default it to MAX_SCORES. Correctly handle new default for SCORE_FILE_PREFIX. Use `lose' function. (read_score): Handle the case of reading unamelen characters, then finishing. Use mktemp if mkstemp isn't available. (lock_file, unlock_file): Delete unused versions. (lock_file): Always sleep, even if we unlinked the lock file.
* update-game-score.c (SCORE_FILE_PREFIX): Don't hardcode.Colin Walters2002-04-071-9/+37
| | | | | | | | (get_user_id): Take struct passwd as an argument. (get_home_dir): New function. (main): Read in user information here. Discover home directory if necessary. (read_score): Trim newline only in `getline' case.
* Actually make previous changes work (oops).Colin Walters2002-04-051-3/+9
|
* (toplevel): Include pwd.h.Colin Walters2002-04-051-15/+83
| | | | | | | | | | | | (struct score_entry): Add username field. (push_score): Use it. (get_user_id): New function. (main): Don't malloc excessively. (main): Use username field. (read_score): Read it. (push_score): Handle it. (write_scores) Write it. (read_score): Handle arbitrary length data.
* Initial version.Colin Walters2002-03-271-0/+373