1 /* 2 3 -Procedure zzadrepf_c (GF, progress report termination adapter ) 4 5 -Abstract 6 7 Provide an f2c-style interface allowing f2c'd Fortran code to call a 8 CSPICE-style GF progress reporting termination function. 9 10 -Disclaimer 11 12 THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE 13 CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. 14 GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE 15 ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE 16 PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" 17 TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY 18 WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A 19 PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC 20 SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 21 SOFTWARE AND RELATED MATERIALS, HOWEVER USED. 22 23 IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA 24 BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT 25 LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, 26 INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, 27 REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE 28 REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. 29 30 RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF 31 THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY 32 CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE 33 ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. 34 35 -Required_Reading 36 37 None. 38 39 -Keywords 40 41 UTILITY 42 43 */ 44 45 #include "SpiceUsr.h" 46 #include "SpiceZfc.h" 47 #include "SpiceZmc.h" 48 #include "SpiceZst.h" 49 #include "SpiceZad.h" 50 #undef zzadrepf_c 51 zzadrepf_c()52 int zzadrepf_c () 53 54 55 /* 56 57 -Brief_I/O 58 59 None. 60 61 -Detailed_Input 62 63 None. 64 65 -Detailed_Output 66 67 None. 68 69 -Parameters 70 71 None. 72 73 -Exceptions 74 75 1) A run-time error will result if this routine is called before 76 a valid pointer to a CSPICE-style GF progress reporting 77 termination function has been stored via a call to zzadsave_c. 78 79 The argument list of the stored function must match that of 80 gfrepf_c. 81 82 -Files 83 84 None. 85 86 -Particulars 87 88 This routine is meant to be passed to f2c'd Fortran GF code that 89 requires a progress reporting termination function input argument. 90 The argument list of this routine matches that of the f2c'd routine 91 92 gfrepf_ 93 94 This routine calls the CSPICE-style progress reporting termination 95 function passed into a CSPICE wrapper for an intermediate-level GF 96 function. A pointer to this progress reporting termination function 97 must be stored via a call to zzadsave_c before this routine is 98 called. 99 100 The argument list of the function referenced by the saved pointer 101 must match that of 102 103 gfrepf_c 104 105 -Examples 106 107 None. 108 109 -Restrictions 110 111 None. 112 113 -Literature_References 114 115 None. 116 117 -Author_and_Institution 118 119 N.J. Bachman (JPL) 120 W.L. Taber (JPL) 121 I.M. Underwood (JPL) 122 L.S. Elson (JPL) 123 E.D. Wright (JPL) 124 125 -Version 126 127 -CSPICE Version 1.0.0, 29-MAR-2008 (NJB) 128 129 -Index_Entries 130 131 terminate a gf progress report 132 133 -& 134 */ 135 136 { /* Begin zzadrepf_c */ 137 138 139 /* 140 Local variables 141 */ 142 void ( * fPtr ) (); 143 144 145 /* 146 Participate in error tracing. 147 */ 148 if ( return_c() ) 149 { 150 return ( 0 ); 151 } 152 chkin_c ( "zzadrepf_c" ); 153 154 155 /* 156 Retrieve the stored pointer for the passed-in function; cast 157 the pointer from (void *) to that of a function whose argument 158 list matches that of gfrepf_c. 159 */ 160 161 fPtr = ( void (*) () ) zzadget_c ( UDREPF ); 162 163 /* 164 Call the CSPICE-style progress report termination function. 165 */ 166 167 ( *fPtr ) (); 168 169 170 chkout_c ( "zzadrepf_c" ); 171 172 return ( 0 ); 173 174 } /* End zzadrepf_c */ 175