PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/src/chbase.c

https://github.com/mattbornski/spice
C | 401 lines | 7 code | 143 blank | 251 comment | 0 complexity | a08cbd8aa9099208865e3a8438596746 MD5 | raw file
  1. /* chbase.f -- translated by f2c (version 19980913).
  2. You must link the resulting object file with the libraries:
  3. -lf2c -lm (in that order)
  4. */
  5. #include "f2c.h"
  6. /* $Procedure CHBASE ( Character set base ) */
  7. integer chbase_(void)
  8. {
  9. /* System generated locals */
  10. integer ret_val;
  11. /* $ Abstract */
  12. /* Return the base value used to encode unsigned integer values */
  13. /* in character strings. */
  14. /* $ Disclaimer */
  15. /* THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  16. /* CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  17. /* GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  18. /* ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  19. /* PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  20. /* TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  21. /* WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  22. /* PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  23. /* SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  24. /* SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  25. /* IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  26. /* BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  27. /* LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  28. /* INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  29. /* REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  30. /* REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  31. /* RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  32. /* THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  33. /* CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  34. /* ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  35. /* $ Required_Reading */
  36. /* None. */
  37. /* $ Keywords */
  38. /* CONSTANTS */
  39. /* $ Declarations */
  40. /* None. */
  41. /* $ Brief_I/O */
  42. /* The function returns the base value used to encode unsigned */
  43. /* integer values in character strings. */
  44. /* $ Detailed_Input */
  45. /* None. */
  46. /* $ Detailed_Output */
  47. /* CHBASE is the base used by ENCHAR and DECHAR to encode and decode */
  48. /* non-negative integers to and from character strings. Its value is */
  49. /* determined by the size of the character set available for a given */
  50. /* machine and compiler. Strictly speaking, CHBASE is one more than */
  51. /* the biggest positive integer which can be handled by both the */
  52. /* CHAR and ICHAR intrinsic functions (which are used by ENCHAR and */
  53. /* DECHAR). That is, CHBASE is the first positive integer for which */
  54. /* the logical expression */
  55. /* ( ICHAR ( CHAR ( CHBASE ) ) .EQ. CHBASE ) */
  56. /* is false. */
  57. /* Note that CHBASE can be (and probably is) different from the */
  58. /* number of characters in the character set used by the processor. */
  59. /* $ Parameters */
  60. /* None. */
  61. /* $ Exceptions */
  62. /* Error free. */
  63. /* $ Files */
  64. /* None. */
  65. /* $ Particulars */
  66. /* The function always returns a constant value, set by the user */
  67. /* prior to compilation. */
  68. /* CHBASE should always be at least 128 (the size of the ASCII */
  69. /* character set), and will usually be 256 for machines which use */
  70. /* eight bits to represent a single character. The following list */
  71. /* contains the values of CHBASE for a range of environments. */
  72. /* Environment: VAX/VMS, VAX FORTRAN */
  73. /* Value: 256 */
  74. /* Environment: Sun, Sun FORTRAN */
  75. /* Value: 256 */
  76. /* Environment: PC, MS FORTRAN */
  77. /* Value: 256 */
  78. /* Environment: Macintosh, Language Systems FORTRAN */
  79. /* Value: 256 */
  80. /* Environment: PC, Lahey F77 EM/32 Version 4.0 */
  81. /* Value: 256 */
  82. /* Environment: HP-UX 9000/750, FORTRAN/9000 Series 700 computers */
  83. /* Value: 256 */
  84. /* Environment: Silicon Graphics IRIX OS, SGI FORTRAN 77 */
  85. /* Value: 256 */
  86. /* Environment: DEC Alpha 3000/4000, OSF/1, DEC FORTRAN-77 */
  87. /* Value: 256 */
  88. /* Environment: NeXT/Mach OS, Absoft Fortran */
  89. /* Value: 256 */
  90. /* Environment: PC/Linux, Fort77 */
  91. /* Value: 128 */
  92. /* For other machines, the value can be determined by running */
  93. /* the following simple program: */
  94. /* INTEGER CHBASE */
  95. /* DATA CHBASE / 0 / */
  96. /* DO WHILE ( .TRUE. ) */
  97. /* IF ( ICHAR (CHAR ( CHBASE ) ) .EQ. CHBASE ) THEN */
  98. /* CHBASE = CHBASE + 1 */
  99. /* ELSE */
  100. /* WRITE (6,*) 'CHBASE for this machine is : ', CHBASE */
  101. /* STOP */
  102. /* END IF */
  103. /* END DO */
  104. /* END */
  105. /* $ Examples */
  106. /* See ENCHAR, DECHAR. */
  107. /* $ Restrictions */
  108. /* None. */
  109. /* $ Literature_References */
  110. /* 1. "Programming in VAX FORTRAN", Digital Equipment Corporation, */
  111. /* September 1984, Section 8.3, page 8-6. */
  112. /* 2. "Microsoft FORTRAN Reference", Microsoft Corporation, */
  113. /* 1989, Section 5.1.1, page 241. */
  114. /* 3. "Language Systems FORTRAN Reference Manual", Language Systems */
  115. /* Corporation, version 1.2.1, page 3-20. */
  116. /* 4. "Lahey F77L EM/32 FORTRAN Language Reference Manual", page */
  117. /* 222, Note 20. */
  118. /* $ Author_and_Institution */
  119. /* N.J. Bachman (JPL) */
  120. /* H.A. Neilan (JPL) */
  121. /* M.J. Spencer (JPL) */
  122. /* W.L. Taber (JPL) */
  123. /* F.S. Turner (JPL) */
  124. /* I.M. Underwood (JPL) */
  125. /* $ Version */
  126. /* - SPICELIB Version 2.21.0, 13-MAY-2010 (BVS) */
  127. /* Updated for SUN-SOLARIS-INTEL. */
  128. /* - SPICELIB Version 2.20.0, 13-MAY-2010 (BVS) */
  129. /* Updated for SUN-SOLARIS-INTEL-CC_C. */
  130. /* - SPICELIB Version 2.19.0, 13-MAY-2010 (BVS) */
  131. /* Updated for SUN-SOLARIS-INTEL-64BIT-CC_C. */
  132. /* - SPICELIB Version 2.18.0, 13-MAY-2010 (BVS) */
  133. /* Updated for SUN-SOLARIS-64BIT-NATIVE_C. */
  134. /* - SPICELIB Version 2.17.0, 13-MAY-2010 (BVS) */
  135. /* Updated for PC-WINDOWS-64BIT-IFORT. */
  136. /* - SPICELIB Version 2.16.0, 13-MAY-2010 (BVS) */
  137. /* Updated for PC-LINUX-64BIT-GFORTRAN. */
  138. /* - SPICELIB Version 2.15.0, 13-MAY-2010 (BVS) */
  139. /* Updated for PC-64BIT-MS_C. */
  140. /* - SPICELIB Version 2.14.0, 13-MAY-2010 (BVS) */
  141. /* Updated for MAC-OSX-64BIT-INTEL_C. */
  142. /* - SPICELIB Version 2.13.0, 13-MAY-2010 (BVS) */
  143. /* Updated for MAC-OSX-64BIT-IFORT. */
  144. /* - SPICELIB Version 2.12.0, 13-MAY-2010 (BVS) */
  145. /* Updated for MAC-OSX-64BIT-GFORTRAN. */
  146. /* - SPICELIB Version 2.11.0, 18-MAR-2009 (BVS) */
  147. /* Updated for PC-LINUX-GFORTRAN. */
  148. /* - SPICELIB Version 2.10.0, 18-MAR-2009 (BVS) */
  149. /* Updated for MAC-OSX-GFORTRAN. */
  150. /* - SPICELIB Version 2.9.0, 19-FEB-2008 (BVS) */
  151. /* Updated for PC-LINUX-IFORT. */
  152. /* - SPICELIB Version 2.8.0, 14-NOV-2006 (BVS) */
  153. /* Updated for PC-LINUX-64BIT-GCC_C. */
  154. /* - SPICELIB Version 2.7.0, 14-NOV-2006 (BVS) */
  155. /* Updated for MAC-OSX-INTEL_C. */
  156. /* - SPICELIB Version 2.6.0, 14-NOV-2006 (BVS) */
  157. /* Updated for MAC-OSX-IFORT. */
  158. /* - SPICELIB Version 2.5.0, 14-NOV-2006 (BVS) */
  159. /* Updated for PC-WINDOWS-IFORT. */
  160. /* - SPICELIB Version 2.4.0, 26-OCT-2005 (BVS) */
  161. /* Updated for SUN-SOLARIS-64BIT-GCC_C. */
  162. /* - SPICELIB Version 2.3.0, 03-JAN-2005 (BVS) */
  163. /* Updated for PC-CYGWIN_C. */
  164. /* - SPICELIB Version 2.2.0, 03-JAN-2005 (BVS) */
  165. /* Updated for PC-CYGWIN. */
  166. /* - SPICELIB Version 2.1.1, 17-JUL-2002 (BVS) */
  167. /* Added MAC-OSX environments. */
  168. /* - SPICELIB Version 2.1.0, 05-DEC-2001 (FST) */
  169. /* Updated the value for PC-LINUX environment. */
  170. /* - SPICELIB Version 2.0.4, 08-OCT-1999 (WLT) */
  171. /* The environment lines were expanded so that the supported */
  172. /* environments are now explicitely given. New */
  173. /* environments are WIN-NT */
  174. /* - SPICELIB Version 2.0.3, 24-SEP-1999 (NJB) */
  175. /* CSPICE environments were added. Some typos were corrected. */
  176. /* - SPICELIB Version 2.0.2, 28-JUL-1999 (WLT) */
  177. /* The environment lines were expanded so that the supported */
  178. /* environments are now explicitely given. New */
  179. /* environments are PC-DIGITAL, SGI-O32 and SGI-N32. */
  180. /* - SPICELIB Version 2.0.1, 18-MAR-1999 (WLT) */
  181. /* The environment lines were expanded so that the supported */
  182. /* environments are now explicitely given. Previously, */
  183. /* environments such as SUN-SUNOS and SUN-SOLARIS were implied */
  184. /* by the environment label SUN. */
  185. /* - SPICELIB Version 2.0.0, 05-APR-1998 (NJB) */
  186. /* Added reference to the PC-LINUX environment. */
  187. /* - SPICELIB Version 1.5.0, 03-NOV-1993 (HAN) */
  188. /* Module was updated to include the character base */
  189. /* value for the Silicon Graphics, DEC Alpha-OSF/1, and */
  190. /* NeXT platforms. */
  191. /* - SPICELIB Version 1.4.0, 06-OCT-1992 (HAN) */
  192. /* Module was updated to include the character base */
  193. /* value for the Hewlett Packard UX 9000/750 environment, */
  194. /* and the value for the Sun was changed from 128 to 256. */
  195. /* Both changes are the result of running the program in */
  196. /* the Particulars section of the header on both machines. */
  197. /* - SPICELIB Version 1.3.1, 10-MAR-1999 (WLT) */
  198. /* Comment section for permuted index source lines was added */
  199. /* following the header. */
  200. /* - SPICELIB Version 1.3.0, 13-NOV-1991 (MJS) */
  201. /* Module was updated to include the character base */
  202. /* value for the Lahey FORTRAN EM/32 environment (PC). */
  203. /* - SPICELIB Version 1.2.0, 07-DEC-1990 (MJS) */
  204. /* Module was updated to include the character base */
  205. /* value for the Macintosh. */
  206. /* - SPICELIB Version 1.1.0, 09-MAR-1990 (HAN) */
  207. /* Module was updated to include the character base */
  208. /* value for the Sun. Sources for the values contained */
  209. /* in this module are now specified in the Literature_References */
  210. /* section. */
  211. /* - SPICELIB Version 1.0.0, 31-JAN-1990 (WLT) (IMU) */
  212. /* -& */
  213. /* $ Index_Entries */
  214. /* base for encoding integers in character_string */
  215. /* -& */
  216. /* $ Revisions */
  217. /* - SPICELIB Version 2.1.0, 05-DEC-2001 (FST) */
  218. /* It was discovered that linux distributions shipping */
  219. /* versions of g77 derived off of gcc versions 2.96-3.00 */
  220. /* suffer from in implementation change in ICHAR that */
  221. /* requires CHBASE to change to 128. Since restricting */
  222. /* CHBASE to 128 has little impact on other linux */
  223. /* environments utilizing other versions of g77 or fort77, */
  224. /* we elected to make the change to all environments */
  225. /* rather than complicate this issue by forking a new one. */
  226. /* - SPICELIB Version 1.4.0, 06-OCT-1992 (HAN) */
  227. /* Module was updated to include the character base */
  228. /* value for the Hewlett Packard UX 9000/750 environment, */
  229. /* and the value for the Sun was changed from 128 to 256. */
  230. /* Both changes are the result of running the program in */
  231. /* the Particulars section of the header on both machines. */
  232. /* The previous Sun value was computed on the Sun3 and was */
  233. /* not updated when we moved to the Sun4. Everything passed */
  234. /* the suite of test programs that would have indicated a bug. */
  235. /* The code was also reformatted so that a utility program can */
  236. /* create the file for each environment. */
  237. /* - Beta Version 1.1.0, 16-FEB-1989 (HAN) (NJB) */
  238. /* Contents of the Exceptions section was changed */
  239. /* to "error free" to reflect the decision that the */
  240. /* module will never participate in error handling. */
  241. /* Missing parentheses added to CHBASE declaration. */
  242. /* -& */
  243. /* We have provided values for several popular machines. Remove */
  244. /* the comment character in front of the value for your machine, */
  245. /* or provide your own value. Numbers are provided in a variety */
  246. /* of formats: decimal, hex, and binary. These last two formats */
  247. /* are not portable; but then, neither are the values. */
  248. /* VAX, VAX FORTRAN */
  249. /* Sun, Sun FORTRAN */
  250. /* IBM PC, Microsoft FORTRAN, Lahey EM/32 FORTRAN */
  251. /* Macintosh, Language Systems FORTRAN */
  252. /* HP-UX 9000/750, FORTRAN/9000 Series 700 computers */
  253. /* Silicon Graphics, IRIX OS, SGI FORTRAN 77 */
  254. /* DEC Alpha, OSF/1, DEC FORTRAN-77 */
  255. /* NeXT, Mach OS, Absoft Fortran 77 */
  256. ret_val = 256;
  257. return ret_val;
  258. } /* chbase_ */