1 /* 2 3 -Procedure getcml_c ( Get the command line ) 4 5 -Abstract 6 7 Store the contents of argv and argc for later access.. 8 9 -Disclaimer 10 11 THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE 12 CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. 13 GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE 14 ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE 15 PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" 16 TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY 17 WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A 18 PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC 19 SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 20 SOFTWARE AND RELATED MATERIALS, HOWEVER USED. 21 22 IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA 23 BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT 24 LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, 25 INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, 26 REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE 27 REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. 28 29 RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF 30 THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY 31 CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE 32 ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. 33 34 -Required_Reading 35 36 None. 37 38 -Keywords 39 40 UTILITY 41 42 */ 43 44 #include <string.h> 45 #include <stdlib.h> 46 47 #include "SpiceUsr.h" 48 getcml_c(SpiceInt * argc,SpiceChar *** argv)49 void getcml_c ( SpiceInt * argc, 50 SpiceChar *** argv ) 51 52 /* 53 54 -Brief_I/O 55 56 Variable I/O Description 57 -------- --- -------------------------------------------------- 58 argc O The number of command line arguments. 59 argv O The vector of command line arguments. 60 61 -Detailed_Input 62 63 None. 64 65 -Detailed_Output 66 67 argc is the number of command line arguments. 68 69 argv is the vector of space delimited command line arguments. 70 Each entry entry contains one argument. argv[0] is the 71 command name. 72 73 -Parameters 74 75 None. 76 77 -Exceptions 78 79 This routines participates in error tracing but detects no errors. 80 Error detection is done in zzgetcml_c.c. 81 82 -Files 83 84 None. 85 86 -Particulars 87 88 This routine is a wrapper function for zzgetcml_c.c. getcml_c 89 allows a user to access the argv and argc values from any program 90 module. 91 92 -Examples 93 94 #include <stdio.h> 95 #include <stdlib.h> 96 97 #include "SpiceUsr.h" 98 99 void main( int argc, char *argv[] ) 100 { 101 102 103 /. Store argv and argc for latter access. ./ 104 105 putcml_c (argc, argv ); 106 107 108 ..... other stuff ..... 109 ..... ..... 110 111 } 112 113 114 void goop () 115 { 116 ..... new module ..... 117 118 SpiceInt argc; 119 SpiceChar ** argv; 120 121 122 ..... 123 ..... 124 125 /. Now get the stored information. ./ 126 127 getcml_c ( &argc, &argv ); 128 129 } 130 131 132 133 -Restrictions 134 135 None. 136 137 -Literature_References 138 139 None. 140 141 -Author_and_Institution 142 143 E.D. Wright (JPL) 144 145 -Version 146 147 -CSPICE Version 1.0.1, 08-FEB-1998 (EDW) 148 149 Routine rewritten to use private routine zzgetcml_c.c. 150 151 -CSPICE Version 1.0.1, 14-JAN-1997 (EDW) 152 153 Replaced a defined variable type for argv with a *** declaration. 154 155 -CSPICE Version 1.0.0, 6-JAN-1997 (EDW) 156 157 -Index_Entries 158 159 store/retrieve argc argv 160 161 -& 162 */ 163 164 { 165 166 /* 167 'zzgetcml_c' does all the real work. Make the call. The SPICEFALSE 168 boolean indicates the call is comming from getcml_c.c and not 169 putcml_c.c 170 */ 171 172 chkin_c( "getcml_c" ); 173 174 zzgetcml_c ( argc, argv, SPICEFALSE ); 175 176 chkout_c( "getcml_c" ); 177 178 } 179 180