1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * Copyright 1987, 1988 by MIT Student Information Processing Board
5 * For copyright information, see copyright.h.
9 #include "ss_internal.h"
11 #define ssrt ss_request_table /* for some readable code... */
14 ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr)
17 int position; /* 1 -> becomes second... */
20 register ss_data *info;
23 info = ss_info(sci_idx);
24 for (size=0; info->rqt_tables[size] != (ssrt *)NULL; size++)
26 /* size == C subscript of NULL == #elements */
27 size += 2; /* new element, and NULL */
28 info->rqt_tables = (ssrt **)realloc(info->rqt_tables,
30 if (info->rqt_tables == (ssrt **)NULL) {
34 if (position > size - 2)
38 for (i = size - 2; i >= position; i--)
39 info->rqt_tables[i+1] = info->rqt_tables[i];
41 info->rqt_tables[position] = rqtbl_ptr;
42 info->rqt_tables[size-1] = (ssrt *)NULL;
47 ss_delete_request_table(sci_idx, rqtbl_ptr, code_ptr)
52 register ss_data *info;
53 register ssrt **rt1, **rt2;
55 *code_ptr = SS_ET_TABLE_NOT_FOUND;
56 info = ss_info(sci_idx);
57 rt1 = info->rqt_tables;
58 for (rt2 = rt1; *rt1; rt1++) {
59 if (*rt1 != rqtbl_ptr) {