2 * Copyright 1987, 1988 by MIT Student Information Processing Board
4 * For copyright information, see copyright.h.
8 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9 * Use is subject to license terms.
13 #include "ss_internal.h"
14 #include "copyright.h"
15 #define size sizeof(ss_data *)
18 int ss_create_invocation(subsystem_name
, version_string
, info_ptr
,
19 request_table_ptr
, code_ptr
)
20 char *subsystem_name
, *version_string
;
22 ss_request_table
*request_table_ptr
;
26 register ss_data
*new_table
;
27 register ss_data
**table
;
31 new_table
= (ss_data
*) malloc(sizeof(ss_data
));
33 if (table
== (ss_data
**) NULL
) {
34 table
= (ss_data
**) malloc(2 * size
);
35 table
[0] = table
[1] = (ss_data
*)NULL
;
38 for (sci_idx
= 1; table
[sci_idx
] != (ss_data
*)NULL
; sci_idx
++)
40 table
= (ss_data
**) realloc((char *)table
,
41 ((unsigned)sci_idx
+2)*size
);
42 table
[sci_idx
+1] = (ss_data
*) NULL
;
43 table
[sci_idx
] = new_table
;
45 new_table
->subsystem_name
= subsystem_name
;
46 new_table
->subsystem_version
= version_string
;
47 new_table
->argv
= (char **)NULL
;
48 new_table
->current_request
= (char *)NULL
;
49 new_table
->info_dirs
= (char **)malloc(sizeof(char *));
50 *new_table
->info_dirs
= (char *)NULL
;
51 new_table
->info_ptr
= info_ptr
;
52 /* Solaris Kerberos */
53 new_table
->prompt
= malloc((unsigned)strlen(subsystem_name
)+3);
54 strcpy(new_table
->prompt
, subsystem_name
);
55 strcat(new_table
->prompt
, ": ");
57 new_table
->abbrev_info
= ss_abbrev_initialize("/etc/passwd", code_ptr
);
59 new_table
->abbrev_info
= NULL
;
61 new_table
->flags
.escape_disabled
= 0;
62 new_table
->flags
.abbrevs_disabled
= 0;
63 new_table
->rqt_tables
=
64 (ss_request_table
**) calloc(2, sizeof(ss_request_table
*));
65 *(new_table
->rqt_tables
) = request_table_ptr
;
66 *(new_table
->rqt_tables
+1) = (ss_request_table
*) NULL
;
72 ss_delete_invocation(sci_idx
)
81 while(t
->info_dirs
[0] != (char *)NULL
)
82 ss_delete_info_dir(sci_idx
, t
->info_dirs
[0], &ignored_code
);
83 free((char *)t
->info_dirs
);