1 /* -----------------------------------------------------------------------------
4 * This file manages the set of return-points for the WAD signal handler.
6 * Author(s) : David Beazley (beazley@cs.uchicago.edu)
8 * Copyright (C) 2000. The University of Chicago.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * See the file COPYING for a complete copy of the LGPL.
25 * ----------------------------------------------------------------------------- */
29 static char cvs[] = "$Id: return.c 10001 2007-10-17 21:33:57Z wsfulton $";
31 /* Maximum number of return points */
32 #define WAD_NUMBER_RETURN 128
34 static WadReturnFunc return_points[WAD_NUMBER_RETURN];
35 static int num_return = 0;
37 void wad_set_return(const char *name, long value) {
39 rp = &return_points[num_return];
40 wad_strcpy(rp->name,name);
43 if (wad_debug_mode & DEBUG_RETURN) {
44 printf("wad: Setting return ('%s', %d)\n", name,value);
48 void wad_set_returns(WadReturnFunc *rf) {
50 while (strlen(rf[i].name)) {
51 wad_set_return(rf[i].name, rf[i].value);
56 WadReturnFunc *wad_check_return(const char *name) {
59 for (i = 0; i < num_return; i++) {
60 if (strcmp(name,return_points[i].name) == 0) {
61 if (wad_debug_mode & DEBUG_RETURN) {
62 printf("wad: Found return ('%s', %d)\n", return_points[i].name, return_points[i].value);
64 return &return_points[i];