2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #pragma ident "%Z%%M% %I% %E% SMI"
9 * Copyright 1987, 1988 by MIT Student Information Processing Board
11 * For copyright information, see copyright.h.
14 #include "copyright.h"
15 #include "ss_internal.h"
17 #define ssrt ss_request_table /* for some readable code... */
20 ss_add_request_table(sci_idx
, rqtbl_ptr
, position
, code_ptr
)
23 int position
; /* 1 -> becomes second... */
26 register ss_data
*info
;
29 info
= ss_info(sci_idx
);
30 for (size
=0; info
->rqt_tables
[size
] != (ssrt
*)NULL
; size
++)
32 /* size == C subscript of NULL == #elements */
33 size
+= 2; /* new element, and NULL */
34 info
->rqt_tables
= (ssrt
**)realloc(info
->rqt_tables
,
36 if (info
->rqt_tables
== (ssrt
**)NULL
) {
40 if (position
> size
- 2)
44 for (i
= size
- 2; i
>= position
; i
--)
45 info
->rqt_tables
[i
+1] = info
->rqt_tables
[i
];
47 info
->rqt_tables
[position
] = rqtbl_ptr
;
48 info
->rqt_tables
[size
-1] = (ssrt
*)NULL
;
53 ss_delete_request_table(sci_idx
, rqtbl_ptr
, code_ptr
)
58 register ss_data
*info
;
59 register ssrt
**rt1
, **rt2
;
61 *code_ptr
= SS_ET_TABLE_NOT_FOUND
;
62 info
= ss_info(sci_idx
);
63 rt1
= info
->rqt_tables
;
64 for (rt2
= rt1
; *rt1
; rt1
++) {
65 if (*rt1
!= rqtbl_ptr
) {