aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/update-game-score.c
Commit message (Collapse)AuthorAgeFilesLines
* (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