Added header files for third-party libraries required by Windows build.

ver1_6_1
Chris Laurel 2009-06-23 23:30:59 +00:00
parent 2343444e06
commit f85a4b5c05
38 changed files with 31103 additions and 0 deletions

119
windows/inc/iconv.h 100644
View File

@ -0,0 +1,119 @@
/* Copyright (C) 1999-2001 Free Software Foundation, Inc.
This file is part of the GNU LIBICONV Library.
The GNU LIBICONV Library is free software; you can redistribute it
and/or modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
The GNU LIBICONV Library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU LIBICONV Library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA. */
/* When installed, this file is called "iconv.h". */
#ifndef _LIBICONV_H
#define _LIBICONV_H
#define _LIBICONV_VERSION 0x0107 /* version number: (major<<8) + minor */
#ifdef BUILDING_LIBICONV
#define LIBICONV_DLL_EXPORTED __declspec(dllexport)
#else
/* #define LIBICONV_DLL_EXPORTED __declspec(dllimport) */
#define LIBICONV_DLL_EXPORTED
#endif
extern LIBICONV_DLL_EXPORTED int _libiconv_version; /* Likewise */
/* We would like to #include any system header file which could define
iconv_t, 1. in order to eliminate the risk that the user gets compilation
errors because some other system header file includes /usr/include/iconv.h
which defines iconv_t or declares iconv after this file, 2. when compiling
for LIBICONV_PLUG, we need the proper iconv_t type in order to produce
binary compatible code.
But gcc's #include_next is not portable. Thus, once libiconv's iconv.h
has been installed in /usr/local/include, there is no way any more to
include the original /usr/include/iconv.h. We simply have to get away
without it.
Ad 1. The risk that a system header file does
#include "iconv.h" or #include_next "iconv.h"
is small. They all do #include <iconv.h>.
Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It
has to be a scalar type because (iconv_t)(-1) is a possible return value
from iconv_open().) */
/* Define iconv_t ourselves. */
#undef iconv_t
#define iconv_t libiconv_t
typedef void* iconv_t;
/* Get size_t declaration. */
#include <stddef.h>
/* Get errno declaration and values. */
#include <errno.h>
/* Some systems, like SunOS 4, don't have EILSEQ. On these systems, define
EILSEQ ourselves, but don't define it as EINVAL, because iconv() callers
want to distinguish EINVAL and EILSEQ. */
#ifndef EILSEQ
#define EILSEQ ENOENT
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Allocates descriptor for code conversion from encoding `fromcode' to
encoding `tocode'. */
#ifndef LIBICONV_PLUG
#define iconv_open libiconv_open
#endif
extern LIBICONV_DLL_EXPORTED iconv_t iconv_open (const char* tocode, const char* fromcode);
/* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes
starting at `*inbuf', writing at most `*outbytesleft' bytes starting at
`*outbuf'.
Decrements `*inbytesleft' and increments `*inbuf' by the same amount.
Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */
#ifndef LIBICONV_PLUG
#define iconv libiconv
#endif
extern LIBICONV_DLL_EXPORTED size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
/* Frees resources allocated for conversion descriptor `cd'. */
#ifndef LIBICONV_PLUG
#define iconv_close libiconv_close
#endif
extern LIBICONV_DLL_EXPORTED int iconv_close (iconv_t cd);
#ifndef LIBICONV_PLUG
/* Nonstandard extensions. */
/* Control of attributes. */
#define iconvctl libiconvctl
extern LIBICONV_DLL_EXPORTED int iconvctl (iconv_t cd, int request, void* argument);
/* Requests for iconvctl. */
#define ICONV_TRIVIALP 0 /* int *argument */
#define ICONV_GET_TRANSLITERATE 1 /* int *argument */
#define ICONV_SET_TRANSLITERATE 2 /* const int *argument */
#endif
#ifdef __cplusplus
}
#endif
#endif /* _LIBICONV_H */

View File

@ -0,0 +1,389 @@
/* Message catalogs for internationalization.
Copyright (C) 1995-1997, 2000-2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1
#ifdef BUILDING_LIBINTL
#define LIBINTL_DLL_EXPORTED __declspec(dllexport)
#else
#define LIBINTL_DLL_EXPORTED __declspec(dllimport)
#endif
#include <locale.h>
/* The LC_MESSAGES locale category is the category used by the functions
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
On systems that don't define it, use an arbitrary value instead.
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
then includes <libintl.h> (i.e. this file!) and then only defines
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
in this case. */
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
# define LC_MESSAGES 1729
#endif
/* We define an additional symbol to signal that we use the GNU
implementation of gettext. */
#define __USE_GNU_GETTEXT 1
/* Provide information about the supported file formats. Returns the
maximum minor revision number supported for a given major revision. */
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
((major) == 0 || (major) == 1 ? 1 : -1)
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
precedence over _conio_gettext. */
#ifdef __DJGPP__
# undef gettext
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* We redirect the functions to those prefixed with "libintl_". This is
necessary, because some systems define gettext/textdomain/... in the C
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
If we used the unprefixed names, there would be cases where the
definition in the C library would override the one in the libintl.so
shared library. Recall that on ELF systems, the symbols are looked
up in the following order:
1. in the executable,
2. in the shared libraries specified on the link command line, in order,
3. in the dependencies of the shared libraries specified on the link
command line,
4. in the dlopen()ed shared libraries, in the order in which they were
dlopen()ed.
The definition in the C library would override the one in libintl.so if
either
* -lc is given on the link command line and -lintl isn't, or
* -lc is given on the link command line before -lintl, or
* libintl.so is a dependency of a dlopen()ed shared library but not
linked to the executable at link time.
Since Solaris gettext() behaves differently than GNU gettext(), this
would be unacceptable.
The redirection happens by default through macros in C, so that &gettext
is independent of the compilation unit, but through inline functions in
C++, in order not to interfere with the name mangling of class fields or
class methods called 'gettext'. */
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
If he doesn't, we choose the method. A third possible method is
_INTL_REDIRECT_ASM, supported only by GCC. */
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# define _INTL_REDIRECT_ASM
# else
# ifdef __cplusplus
# define _INTL_REDIRECT_INLINE
# else
# define _INTL_REDIRECT_MACROS
# endif
# endif
#endif
/* Auxiliary macros. */
#ifdef _INTL_REDIRECT_ASM
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
# define _INTL_STRINGIFY(prefix) #prefix
#else
# define _INTL_ASM(cname)
#endif
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_gettext (const char *__msgid);
static inline char *gettext (const char *__msgid)
{
return libintl_gettext (__msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define gettext libintl_gettext
#endif
extern LIBINTL_DLL_EXPORTED char *gettext (const char *__msgid)
_INTL_ASM (libintl_gettext);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_dgettext (const char *__domainname, const char *__msgid);
static inline char *dgettext (const char *__domainname, const char *__msgid)
{
return libintl_dgettext (__domainname, __msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dgettext libintl_dgettext
#endif
extern LIBINTL_DLL_EXPORTED char *dgettext (const char *__domainname, const char *__msgid)
_INTL_ASM (libintl_dgettext);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_dcgettext (const char *__domainname, const char *__msgid,
int __category);
static inline char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
{
return libintl_dcgettext (__domainname, __msgid, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcgettext libintl_dcgettext
#endif
extern LIBINTL_DLL_EXPORTED char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
_INTL_ASM (libintl_dcgettext);
#endif
/* Similar to `gettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n);
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
{
return libintl_ngettext (__msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define ngettext libintl_ngettext
#endif
extern LIBINTL_DLL_EXPORTED char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_ngettext);
#endif
/* Similar to `dgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n);
static inline char *dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
{
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dngettext libintl_dngettext
#endif
extern LIBINTL_DLL_EXPORTED char *dngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_dngettext);
#endif
/* Similar to `dcgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category);
static inline char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
{
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcngettext libintl_dcngettext
#endif
extern LIBINTL_DLL_EXPORTED char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
_INTL_ASM (libintl_dcngettext);
#endif
/* Set the current default message catalog to DOMAINNAME.
If DOMAINNAME is null, return the current default.
If DOMAINNAME is "", reset to the default of "messages". */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_textdomain (const char *__domainname);
static inline char *textdomain (const char *__domainname)
{
return libintl_textdomain (__domainname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define textdomain libintl_textdomain
#endif
extern LIBINTL_DLL_EXPORTED char *textdomain (const char *__domainname)
_INTL_ASM (libintl_textdomain);
#endif
/* Specify that the DOMAINNAME message catalog will be found
in DIRNAME rather than in the system locale data base. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_bindtextdomain (const char *__domainname,
const char *__dirname);
static inline char *bindtextdomain (const char *__domainname,
const char *__dirname)
{
return libintl_bindtextdomain (__domainname, __dirname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bindtextdomain libintl_bindtextdomain
#endif
extern LIBINTL_DLL_EXPORTED char *bindtextdomain (const char *__domainname, const char *__dirname)
_INTL_ASM (libintl_bindtextdomain);
#endif
/* Specify the character encoding in which the messages from the
DOMAINNAME message catalog will be returned. */
#ifdef _INTL_REDIRECT_INLINE
extern LIBINTL_DLL_EXPORTED char *libintl_bind_textdomain_codeset (const char *__domainname,
const char *__codeset);
static inline char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
{
return libintl_bind_textdomain_codeset (__domainname, __codeset);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
#endif
extern LIBINTL_DLL_EXPORTED char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
_INTL_ASM (libintl_bind_textdomain_codeset);
#endif
/* Support for format strings with positions in *printf(), following the
POSIX/XSI specification.
Note: These replacements for the *printf() functions are visible only
in source files that #include <libintl.h> or #include "gettext.h".
Packages that use *printf() in source files that don't refer to _()
or gettext() but for which the format string could be the return value
of _() or gettext() need to add this #include. Oh well. */
#if !0
#include <stdio.h>
#include <stddef.h>
/* Get va_list. */
#if __STDC__ || defined __cplusplus || defined _MSC_VER
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#undef fprintf
#define fprintf libintl_fprintf
extern LIBINTL_DLL_EXPORTED int fprintf (FILE *, const char *, ...);
#undef vfprintf
#define vfprintf libintl_vfprintf
extern LIBINTL_DLL_EXPORTED int vfprintf (FILE *, const char *, va_list);
#undef printf
#define printf libintl_printf
extern LIBINTL_DLL_EXPORTED int printf (const char *, ...);
#undef vprintf
#define vprintf libintl_vprintf
extern LIBINTL_DLL_EXPORTED int vprintf (const char *, va_list);
#undef sprintf
#define sprintf libintl_sprintf
extern LIBINTL_DLL_EXPORTED int sprintf (char *, const char *, ...);
#undef vsprintf
#define vsprintf libintl_vsprintf
extern LIBINTL_DLL_EXPORTED int vsprintf (char *, const char *, va_list);
#if 0
#undef snprintf
#define snprintf libintl_snprintf
extern LIBINTL_DLL_EXPORTED int snprintf (char *, size_t, const char *, ...);
#undef vsnprintf
#define vsnprintf libintl_vsnprintf
extern LIBINTL_DLL_EXPORTED int vsnprintf (char *, size_t, const char *, va_list);
#endif
#if 0
#undef asprintf
#define asprintf libintl_asprintf
extern LIBINTL_DLL_EXPORTED int asprintf (char **, const char *, ...);
#undef vasprintf
#define vasprintf libintl_vasprintf
extern LIBINTL_DLL_EXPORTED int vasprintf (char **, const char *, va_list);
#endif
#if 1
#undef fwprintf
#define fwprintf libintl_fwprintf
extern LIBINTL_DLL_EXPORTED int fwprintf (FILE *, const wchar_t *, ...);
#undef vfwprintf
#define vfwprintf libintl_vfwprintf
extern LIBINTL_DLL_EXPORTED int vfwprintf (FILE *, const wchar_t *, va_list);
#undef wprintf
#define wprintf libintl_wprintf
extern LIBINTL_DLL_EXPORTED int wprintf (const wchar_t *, ...);
#undef vwprintf
#define vwprintf libintl_vwprintf
extern LIBINTL_DLL_EXPORTED int vwprintf (const wchar_t *, va_list);
#undef swprintf
#define swprintf libintl_swprintf
extern LIBINTL_DLL_EXPORTED int swprintf (wchar_t *, size_t, const wchar_t *, ...);
#undef vswprintf
#define vswprintf libintl_vswprintf
extern LIBINTL_DLL_EXPORTED int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
#endif
#endif
/* Support for relocatable packages. */
/* Sets the original and the current installation prefix of the package.
Relocation simply replaces a pathname starting with the original prefix
by the corresponding pathname with the current prefix instead. Both
prefixes should be directory names without trailing slash (i.e. use ""
instead of "/"). */
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
extern LIBINTL_DLL_EXPORTED void
libintl_set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);
#ifdef __cplusplus
}
#endif
#endif /* libintl.h */

View File

@ -0,0 +1,45 @@
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
/* see jconfig.doc for explanations */
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
/* #define void char */
/* #define const */
#undef CHAR_IS_UNSIGNED
#define HAVE_STDDEF_H
#define HAVE_STDLIB_H
#undef NEED_BSD_STRINGS
#undef NEED_SYS_TYPES_H
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
#undef NEED_SHORT_EXTERNAL_NAMES
#undef INCOMPLETE_TYPES_BROKEN
/* Define "boolean" as unsigned char, not int, per Windows custom */
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#ifdef JPEG_INTERNALS
#undef RIGHT_SHIFT_IS_UNSIGNED
#endif /* JPEG_INTERNALS */
#ifdef JPEG_CJPEG_DJPEG
#define BMP_SUPPORTED /* BMP image file format */
#define GIF_SUPPORTED /* GIF image file format */
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
#undef RLE_SUPPORTED /* Utah RLE image file format */
#define TARGA_SUPPORTED /* Targa image file format */
#define TWO_FILE_COMMANDLINE /* optional */
#define USE_SETMODE /* Microsoft has setmode() */
#undef NEED_SIGNAL_CATCHER
#undef DONT_USE_B_MODE
#undef PROGRESS_REPORT /* optional */
#endif /* JPEG_CJPEG_DJPEG */

View File

@ -0,0 +1,363 @@
/*
* jmorecfg.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains additional configuration options that customize the
* JPEG software for special applications or support machine-dependent
* optimizations. Most users will not need to touch this file.
*/
/*
* Define BITS_IN_JSAMPLE as either
* 8 for 8-bit sample values (the usual setting)
* 12 for 12-bit sample values
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
* JPEG standard, and the IJG code does not support anything else!
* We do not support run-time selection of data precision, sorry.
*/
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
/*
* Maximum number of components (color channels) allowed in JPEG image.
* To meet the letter of the JPEG spec, set this to 255. However, darn
* few applications need more than 4 channels (maybe 5 for CMYK + alpha
* mask). We recommend 10 as a reasonable compromise; use 4 if you are
* really short on memory. (Each allowed component costs a hundred or so
* bytes of storage, whether actually used in an image or not.)
*/
#define MAX_COMPONENTS 10 /* maximum number of image components */
/*
* Basic data types.
* You may need to change these if you have a machine with unusual data
* type sizes; for example, "char" not 8 bits, "short" not 16 bits,
* or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
* but it had better be at least 16.
*/
/* Representation of a single sample (pixel element value).
* We frequently allocate large arrays of these, so it's important to keep
* them small. But if you have memory to burn and access to char or short
* arrays is very slow on your hardware, you might want to change these.
*/
#if BITS_IN_JSAMPLE == 8
/* JSAMPLE should be the smallest type that will hold the values 0..255.
* You can use a signed char by having GETJSAMPLE mask it with 0xFF.
*/
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JSAMPLE;
#define GETJSAMPLE(value) ((int) (value))
#else /* not HAVE_UNSIGNED_CHAR */
typedef char JSAMPLE;
#ifdef CHAR_IS_UNSIGNED
#define GETJSAMPLE(value) ((int) (value))
#else
#define GETJSAMPLE(value) ((int) (value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128
#endif /* BITS_IN_JSAMPLE == 8 */
#if BITS_IN_JSAMPLE == 12
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
* On nearly all machines "short" will do nicely.
*/
typedef short JSAMPLE;
#define GETJSAMPLE(value) ((int) (value))
#define MAXJSAMPLE 4095
#define CENTERJSAMPLE 2048
#endif /* BITS_IN_JSAMPLE == 12 */
/* Representation of a DCT frequency coefficient.
* This should be a signed value of at least 16 bits; "short" is usually OK.
* Again, we allocate large arrays of these, but you can change to int
* if you have memory to burn and "short" is really slow.
*/
typedef short JCOEF;
/* Compressed datastreams are represented as arrays of JOCTET.
* These must be EXACTLY 8 bits wide, at least once they are written to
* external storage. Note that when using the stdio data source/destination
* managers, this is also the data type passed to fread/fwrite.
*/
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char JOCTET;
#define GETJOCTET(value) (value)
#else /* not HAVE_UNSIGNED_CHAR */
typedef char JOCTET;
#ifdef CHAR_IS_UNSIGNED
#define GETJOCTET(value) (value)
#else
#define GETJOCTET(value) ((value) & 0xFF)
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */
#ifdef CHAR_IS_UNSIGNED
typedef char UINT8;
#else /* not CHAR_IS_UNSIGNED */
typedef short UINT8;
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
/* UINT16 must hold at least the values 0..65535. */
#ifdef HAVE_UNSIGNED_SHORT
typedef unsigned short UINT16;
#else /* not HAVE_UNSIGNED_SHORT */
typedef unsigned int UINT16;
#endif /* HAVE_UNSIGNED_SHORT */
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
//typedef long INT32;
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
* images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
* "unsigned int" is sufficient on all machines. However, if you need to
* handle larger images and you don't mind deviating from the spec, you
* can change this datatype.
*/
typedef unsigned int JDIMENSION;
#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
/* These macros are used in all function definitions and extern declarations.
* You could modify them if you need to change function linkage conventions;
* in particular, you'll need to do that to make the library a Windows DLL.
* Another application is to make all functions global for use with debuggers
* or code profilers that require it.
*/
/* a function called through method pointers: */
#define METHODDEF(type) static type
/* a function used only in its module: */
#define LOCAL(type) static type
/* a function referenced thru EXTERNs: */
#define GLOBAL(type) type
/* a reference to a GLOBAL function: */
#define EXTERN(type) extern type
/* This macro is used to declare a "method", that is, a function pointer.
* We want to supply prototype parameters if the compiler can cope.
* Note that the arglist parameter must be parenthesized!
* Again, you can customize this if you need special linkage keywords.
*/
#ifdef HAVE_PROTOTYPES
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
#else
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
#endif
/* Here is the pseudo-keyword for declaring pointers that must be "far"
* on 80x86 machines. Most of the specialized coding for 80x86 is handled
* by just saying "FAR *" where such a pointer is needed. In a few places
* explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
*/
#ifdef NEED_FAR_POINTERS
#define FAR far
#else
#define FAR
#endif
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
#ifndef FALSE /* in case these macros already exist */
#define FALSE 0 /* values of boolean */
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*
* The remaining options affect code selection within the JPEG library,
* but they don't need to be visible to most applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
*/
#ifdef JPEG_INTERNALS
#define JPEG_INTERNAL_OPTIONS
#endif
#ifdef JPEG_INTERNAL_OPTIONS
/*
* These defines indicate whether to include various optional functions.
* Undefining some of these symbols will produce a smaller but less capable
* library. Note that you can leave certain source files out of the
* compilation/linking process if you've #undef'd the corresponding symbols.
* (You may HAVE to do that if your compiler doesn't like null source files.)
*/
/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
/* Capability options common to encoder and decoder: */
#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
/* Encoder capability options: */
#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
* precision, so jchuff.c normally uses entropy optimization to compute
* usable tables for higher precision. If you don't want to do optimization,
* you'll have to supply different default Huffman tables.
* The exact same statements apply for progressive JPEG: the default tables
* don't work for progressive mode. (This may get fixed, however.)
*/
#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
/* Decoder capability options: */
#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
/* more capability options later, no doubt */
/*
* Ordering of RGB data in scanlines passed to or from the application.
* If your application wants to deal with data in the order B,G,R, just
* change these macros. You can also deal with formats such as R,G,B,X
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
* the offsets will also change the order in which colormap data is organized.
* RESTRICTIONS:
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
* 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
* useful if you are using JPEG color spaces other than YCbCr or grayscale.
* 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
* is not 3 (they don't understand about dummy color components!). So you
* can't use color quantization if you change that value.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
/* Definitions for speed-related optimizations. */
/* If your compiler supports inline functions, define INLINE
* as the inline keyword; otherwise define it as empty.
*/
#ifndef INLINE
#ifdef __GNUC__ /* for instance, GNU C knows about inline */
#define INLINE __inline__
#endif
#ifndef INLINE
#define INLINE /* default is to define it as empty */
#endif
#endif
/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
* two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
* as short on such a machine. MULTIPLIER must be at least 16 bits wide.
*/
#ifndef MULTIPLIER
#define MULTIPLIER int /* type for fastest integer multiply */
#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
* by your compiler. (Note that this type is only used in the floating point
* DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
* Typically, float is faster in ANSI C compilers, while double is faster in
* pre-ANSI compilers (because they insist on converting to double anyway).
* The code below therefore chooses float if we have ANSI-style prototypes.
*/
#ifndef FAST_FLOAT
#ifdef HAVE_PROTOTYPES
#define FAST_FLOAT float
#else
#define FAST_FLOAT double
#endif
#endif
#endif /* JPEG_INTERNAL_OPTIONS */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,332 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define deflateBound z_deflateBound
# define deflatePrime z_deflatePrime
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateCopy z_inflateCopy
# define inflateReset z_inflateReset
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
# define zError z_zError
# define alloc_func z_alloc_func
# define free_func z_free_func
# define in_func z_in_func
# define out_func z_out_func
# define Byte z_Byte
# define uInt z_uInt
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidpf z_voidpf
# define voidp z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
# ifndef WIN32
# define WIN32
# endif
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if defined(__OS400__)
# define NO_vsnprintf
#endif
#if defined(__MVS__)
# define NO_vsnprintf
# ifdef FAR
# undef FAR
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(deflateBound,"DEBND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(compressBound,"CMBND")
# pragma map(inflate_table,"INTABL")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,172 @@
/*
** $Id: lauxlib.h,v 1.87 2005/12/29 15:32:11 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
#ifndef lauxlib_h
#define lauxlib_h
#include <stddef.h>
#include <stdio.h>
#include "lua.h"
#if defined(LUA_COMPAT_GETN)
LUALIB_API int (luaL_getn) (lua_State *L, int t);
LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
#else
#define luaL_getn(L,i) ((int)lua_objlen(L, i))
#define luaL_setn(L,i,j) ((void)0) /* no op! */
#endif
#if defined(LUA_COMPAT_OPENLIB)
#define luaI_openlib luaL_openlib
#endif
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
typedef struct luaL_Reg {
const char *name;
lua_CFunction func;
} luaL_Reg;
LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
const luaL_Reg *l, int nup);
LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
const luaL_Reg *l);
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
size_t *l);
LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
const char *def, size_t *l);
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
lua_Integer def);
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);
LUALIB_API int (luaL_ref) (lua_State *L, int t);
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
const char *name);
LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
LUALIB_API lua_State *(luaL_newstate) (void);
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
const char *r);
LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
const char *fname, int szhint);
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
#define luaL_argcheck(L, cond,numarg,extramsg) \
((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
#define luaL_dofile(L, fn) (luaL_loadfile(L, fn) || lua_pcall(L, 0, 0, 0))
#define luaL_dostring(L, s) (luaL_loadstring(L, s) || lua_pcall(L, 0, 0, 0))
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
/*
** {======================================================
** Generic Buffer manipulation
** =======================================================
*/
typedef struct luaL_Buffer {
char *p; /* current position in buffer */
int lvl; /* number of strings in the stack (level) */
lua_State *L;
char buffer[LUAL_BUFFERSIZE];
} luaL_Buffer;
#define luaL_addchar(B,c) \
((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
(*(B)->p++ = (char)(c)))
/* compatibility only */
#define luaL_putchar(B,c) luaL_addchar(B,c)
#define luaL_addsize(B,n) ((B)->p += (n))
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
/* }====================================================== */
/* compatibility with ref system */
/* pre-defined references */
#define LUA_NOREF (-2)
#define LUA_REFNIL (-1)
#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
(lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
#define luaL_reg luaL_Reg
#endif

View File

@ -0,0 +1,384 @@
/*
** $Id: lua.h,v 1.216 2006/01/10 12:50:13 roberto Exp $
** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
*/
#ifndef lua_h
#define lua_h
#include <stdarg.h>
#include <stddef.h>
#include "luaconf.h"
#define LUA_VERSION "Lua 5.1"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
/* mark for precompiled code (`<esc>Lua') */
#define LUA_SIGNATURE "\033Lua"
/* option for multiple returns in `lua_pcall' and `lua_call' */
#define LUA_MULTRET (-1)
/*
** pseudo-indices
*/
#define LUA_REGISTRYINDEX (-10000)
#define LUA_ENVIRONINDEX (-10001)
#define LUA_GLOBALSINDEX (-10002)
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
/* thread status; 0 is OK */
#define LUA_YIELD 1
#define LUA_ERRRUN 2
#define LUA_ERRSYNTAX 3
#define LUA_ERRMEM 4
#define LUA_ERRERR 5
typedef struct lua_State lua_State;
typedef int (*lua_CFunction) (lua_State *L);
/*
** functions that read/write blocks when loading/dumping Lua chunks
*/
typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
/*
** prototype for memory-allocation functions
*/
typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
/*
** basic types
*/
#define LUA_TNONE (-1)
#define LUA_TNIL 0
#define LUA_TBOOLEAN 1
#define LUA_TLIGHTUSERDATA 2
#define LUA_TNUMBER 3
#define LUA_TSTRING 4
#define LUA_TTABLE 5
#define LUA_TFUNCTION 6
#define LUA_TUSERDATA 7
#define LUA_TTHREAD 8
/* minimum Lua stack available to a C function */
#define LUA_MINSTACK 20
/*
** generic extra include file
*/
#if defined(LUA_USER_H)
#include LUA_USER_H
#endif
/* type of numbers in Lua */
typedef LUA_NUMBER lua_Number;
/* type for integer functions */
typedef LUA_INTEGER lua_Integer;
/*
** state manipulation
*/
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
LUA_API void (lua_close) (lua_State *L);
LUA_API lua_State *(lua_newthread) (lua_State *L);
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
/*
** basic stack manipulation
*/
LUA_API int (lua_gettop) (lua_State *L);
LUA_API void (lua_settop) (lua_State *L, int idx);
LUA_API void (lua_pushvalue) (lua_State *L, int idx);
LUA_API void (lua_remove) (lua_State *L, int idx);
LUA_API void (lua_insert) (lua_State *L, int idx);
LUA_API void (lua_replace) (lua_State *L, int idx);
LUA_API int (lua_checkstack) (lua_State *L, int sz);
LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);
/*
** access functions (stack -> C)
*/
LUA_API int (lua_isnumber) (lua_State *L, int idx);
LUA_API int (lua_isstring) (lua_State *L, int idx);
LUA_API int (lua_iscfunction) (lua_State *L, int idx);
LUA_API int (lua_isuserdata) (lua_State *L, int idx);
LUA_API int (lua_type) (lua_State *L, int idx);
LUA_API const char *(lua_typename) (lua_State *L, int tp);
LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2);
LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx);
LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx);
LUA_API int (lua_toboolean) (lua_State *L, int idx);
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
LUA_API size_t (lua_objlen) (lua_State *L, int idx);
LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
LUA_API void *(lua_touserdata) (lua_State *L, int idx);
LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
LUA_API const void *(lua_topointer) (lua_State *L, int idx);
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushnil) (lua_State *L);
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l);
LUA_API void (lua_pushstring) (lua_State *L, const char *s);
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
va_list argp);
LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
LUA_API void (lua_pushboolean) (lua_State *L, int b);
LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
LUA_API int (lua_pushthread) (lua_State *L);
/*
** get functions (Lua -> stack)
*/
LUA_API void (lua_gettable) (lua_State *L, int idx);
LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawget) (lua_State *L, int idx);
LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
LUA_API void (lua_getfenv) (lua_State *L, int idx);
/*
** set functions (stack -> Lua)
*/
LUA_API void (lua_settable) (lua_State *L, int idx);
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawset) (lua_State *L, int idx);
LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
LUA_API int (lua_setfenv) (lua_State *L, int idx);
/*
** `load' and `call' functions (load and run Lua code)
*/
LUA_API void (lua_call) (lua_State *L, int nargs, int nresults);
LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname);
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
/*
** coroutine functions
*/
LUA_API int (lua_yield) (lua_State *L, int nresults);
LUA_API int (lua_resume) (lua_State *L, int narg);
LUA_API int (lua_status) (lua_State *L);
/*
** garbage-collection function and options
*/
#define LUA_GCSTOP 0
#define LUA_GCRESTART 1
#define LUA_GCCOLLECT 2
#define LUA_GCCOUNT 3
#define LUA_GCCOUNTB 4
#define LUA_GCSTEP 5
#define LUA_GCSETPAUSE 6
#define LUA_GCSETSTEPMUL 7
LUA_API int (lua_gc) (lua_State *L, int what, int data);
/*
** miscellaneous functions
*/
LUA_API int (lua_error) (lua_State *L);
LUA_API int (lua_next) (lua_State *L, int idx);
LUA_API void (lua_concat) (lua_State *L, int n);
LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
#define lua_pop(L,n) lua_settop(L, -(n)-1)
#define lua_newtable(L) lua_createtable(L, 0, 0)
#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
#define lua_strlen(L,i) lua_objlen(L, (i))
#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
#define lua_pushliteral(L, s) \
lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
/*
** compatibility macros and functions
*/
#define lua_open() luaL_newstate()
#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0)
#define lua_Chunkreader lua_Reader
#define lua_Chunkwriter lua_Writer
/*
** {======================================================================
** Debug API
** =======================================================================
*/
/*
** Event codes
*/
#define LUA_HOOKCALL 0
#define LUA_HOOKRET 1
#define LUA_HOOKLINE 2
#define LUA_HOOKCOUNT 3
#define LUA_HOOKTAILRET 4
/*
** Event masks
*/
#define LUA_MASKCALL (1 << LUA_HOOKCALL)
#define LUA_MASKRET (1 << LUA_HOOKRET)
#define LUA_MASKLINE (1 << LUA_HOOKLINE)
#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
typedef struct lua_Debug lua_Debug; /* activation record */
/* Functions to be called by the debuger in specific events */
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);
LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);
LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
LUA_API lua_Hook lua_gethook (lua_State *L);
LUA_API int lua_gethookmask (lua_State *L);
LUA_API int lua_gethookcount (lua_State *L);
struct lua_Debug {
int event;
const char *name; /* (n) */
const char *namewhat; /* (n) `global', `local', `field', `method' */
const char *what; /* (S) `Lua', `C', `main', `tail' */
const char *source; /* (S) */
int currentline; /* (l) */
int nups; /* (u) number of upvalues */
int linedefined; /* (S) */
int lastlinedefined; /* (S) */
char short_src[LUA_IDSIZE]; /* (S) */
/* private part */
int i_ci; /* active function */
};
/* }====================================================================== */
/******************************************************************************
* Copyright (C) 1994-2006 Lua.org, PUC-Rio. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************/
#endif

View File

@ -0,0 +1,9 @@
// lua.hpp
// Lua header files for C++
// <<extern "C">> not supplied automatically because Lua also compiles as C++
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

View File

@ -0,0 +1,736 @@
/*
** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
#ifndef lconfig_h
#define lconfig_h
#include <limits.h>
#include <stddef.h>
/*
** ==================================================================
** Search for "@@" to find all configurable definitions.
** ===================================================================
*/
/*
@@ LUA_ANSI controls the use of non-ansi features.
** CHANGE it (define it) if you want Lua to avoid the use of any
** non-ansi feature or library.
*/
#if defined(__STRICT_ANSI__)
#define LUA_ANSI
#endif
#if !defined(LUA_ANSI) && defined(_WIN32)
#define LUA_WIN
#endif
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
#endif
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_DL_DYLD /* does not need extra library */
#endif
/*
@@ LUA_USE_POSIX includes all functionallity listed as X/Open System
@* Interfaces Extension (XSI).
** CHANGE it (define it) if your system is XSI compatible.
*/
#if defined(LUA_USE_POSIX)
#define LUA_USE_MKSTEMP
#define LUA_USE_ISATTY
#define LUA_USE_POPEN
#define LUA_USE_ULONGJMP
#endif
/*
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
@* Lua libraries.
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
@* C libraries.
** CHANGE them if your machine has a non-conventional directory
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
#if defined(_WIN32)
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
#define LUA_LDIR "!\\lua\\"
#define LUA_CDIR "!\\"
#define LUA_PATH_DEFAULT \
".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
#define LUA_CPATH_DEFAULT \
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
#define LUA_ROOT "/usr/local/"
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \
"./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
#define LUA_CPATH_DEFAULT \
"./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#endif
/*
@@ LUA_DIRSEP is the directory separator (for submodules).
** CHANGE it if your machine does not use "/" as the directory separator
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
#define LUA_DIRSEP "\\"
#else
#define LUA_DIRSEP "/"
#endif
/*
@@ LUA_PATHSEP is the character that separates templates in a path.
@@ LUA_PATH_MARK is the string that marks the substitution points in a
@* template.
@@ LUA_EXECDIR in a Windows path is replaced by the executable's
@* directory.
@@ LUA_IGMARK is a mark to ignore all before it when bulding the
@* luaopen_ function name.
** CHANGE them if for some reason your system cannot use those
** characters. (E.g., if one of those characters is a common character
** in file/directory names.) Probably you do not need to change them.
*/
#define LUA_PATHSEP ";"
#define LUA_PATH_MARK "?"
#define LUA_EXECDIR "!"
#define LUA_IGMARK "-"
/*
@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
#define LUA_INTEGER ptrdiff_t
/*
@@ LUA_API is a mark for all core API functions.
@@ LUALIB_API is a mark for all standard library functions.
** CHANGE them if you need to define those functions in some special way.
** For instance, if you want to create one Windows DLL with the core and
** the libraries, you may want to use the following definition (define
** LUA_BUILD_AS_DLL to get it).
*/
#if defined(LUA_BUILD_AS_DLL)
#if defined(LUA_CORE) || defined(LUA_LIB)
#define LUA_API __declspec(dllexport)
#else
#define LUA_API __declspec(dllimport)
#endif
#else
#define LUA_API extern
#endif
/* more often than not the libs go together with the core */
#define LUALIB_API LUA_API
/*
@@ LUAI_FUNC is a mark for all extern functions that are not to be
@* exported to outside modules.
@@ LUAI_DATA is a mark for all extern (const) variables that are not to
@* be exported to outside modules.
** CHANGE them if you need to mark them in some special way. Elf/gcc
** (versions 3.2 and later) mark them as "hidden" to optimize access
** when Lua is compiled as a shared library.
*/
#if defined(luaall_c)
#define LUAI_FUNC static
#define LUAI_DATA /* empty */
#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__)
#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
#define LUAI_DATA LUAI_FUNC
#else
#define LUAI_FUNC extern
#define LUAI_DATA extern
#endif
/*
@@ LUA_QL describes how error messages quote program elements.
** CHANGE it if you want a different appearance.
*/
#define LUA_QL(x) "'" x "'"
#define LUA_QS LUA_QL("%s")
/*
@@ LUA_IDSIZE gives the maximum size for the description of the source
@* of a function in debug information.
** CHANGE it if you want a different size.
*/
#define LUA_IDSIZE 60
/*
** {==================================================================
** Stand-alone configuration
** ===================================================================
*/
#if defined(lua_c) || defined(luaall_c)
/*
@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
@* is, whether we're running lua interactively).
** CHANGE it if you have a better definition for non-POSIX/non-Windows
** systems.
*/
#if defined(LUA_USE_ISATTY)
#include <unistd.h>
#define lua_stdin_is_tty() isatty(0)
#elif defined(LUA_WIN)
#include <io.h>
#include <stdio.h>
#define lua_stdin_is_tty() _isatty(_fileno(stdin))
#else
#define lua_stdin_is_tty() 1 /* assume stdin is a tty */
#endif
/*
@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
** CHANGE them if you want different prompts. (You can also change the
** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
*/
#define LUA_PROMPT "> "
#define LUA_PROMPT2 ">> "
/*
@@ LUA_PROGNAME is the default name for the stand-alone Lua program.
** CHANGE it if your stand-alone interpreter has a different name and
** your system is not able to detect that name automatically.
*/
#define LUA_PROGNAME "lua"
/*
@@ LUA_MAXINPUT is the maximum length for an input line in the
@* stand-alone interpreter.
** CHANGE it if you need longer lines.
*/
#define LUA_MAXINPUT 512
/*
@@ lua_readline defines how to show a prompt and then read a line from
@* the standard input.
@@ lua_saveline defines how to "save" a read line in a "history".
@@ lua_freeline defines how to free a line read by lua_readline.
** CHANGE them if you want to improve this functionality (e.g., by using
** GNU readline and history facilities).
*/
#if defined(LUA_USE_READLINE)
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL)
#define lua_saveline(L,idx) \
if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
add_history(lua_tostring(L, idx)); /* add it to history */
#define lua_freeline(L,b) ((void)L, free(b))
#else
#define lua_readline(L,b,p) \
((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \
fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
#define lua_saveline(L,idx) { (void)L; (void)idx; }
#define lua_freeline(L,b) { (void)L; (void)b; }
#endif
#endif
/* }================================================================== */
/*
@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles
@* as a percentage.
** CHANGE it if you want the GC to run faster or slower (higher values
** mean larger pauses which mean slower collection.) You can also change
** this value dynamically.
*/
#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */
/*
@@ LUAI_GCMUL defines the default speed of garbage collection relative to
@* memory allocation as a percentage.
** CHANGE it if you want to change the granularity of the garbage
** collection. (Higher values mean coarser collections. 0 represents
** infinity, where each step performs a full collection.) You can also
** change this value dynamically.
*/
#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */
/*
@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.
** CHANGE it (define it) if you want exact compatibility with the
** behavior of setn/getn in Lua 5.0.
*/
#undef LUA_COMPAT_GETN
/*
@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.
** CHANGE it to undefined as soon as you do not need a global 'loadlib'
** function (the function is still available as 'package.loadlib').
*/
#undef LUA_COMPAT_LOADLIB
/*
@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
** CHANGE it to undefined as soon as your programs use only '...' to
** access vararg parameters (instead of the old 'arg' table).
*/
#define LUA_COMPAT_VARARG
/*
@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
** CHANGE it to undefined as soon as your programs use 'math.fmod' or
** the new '%' operator instead of 'math.mod'.
*/
#define LUA_COMPAT_MOD
/*
@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
@* facility.
** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
** off the advisory error when nesting [[...]].
*/
#define LUA_COMPAT_LSTR 1
/*
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
** CHANGE it to undefined as soon as you rename 'string.gfind' to
** 'string.gmatch'.
*/
#define LUA_COMPAT_GFIND
/*
@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
@* behavior.
** CHANGE it to undefined as soon as you replace to 'luaL_registry'
** your uses of 'luaL_openlib'
*/
#define LUA_COMPAT_OPENLIB
/*
@@ luai_apicheck is the assert macro used by the Lua-C API.
** CHANGE luai_apicheck if you want Lua to perform some checks in the
** parameters it gets from API calls. This may slow down the interpreter
** a bit, but may be quite useful when debugging C code that interfaces
** with Lua. A useful redefinition is to use assert.h.
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(L,o) { (void)L; assert(o); }
#else
#define luai_apicheck(L,o) { (void)L; }
#endif
/*
@@ LUAI_BITSINT defines the number of bits in an int.
** CHANGE here if Lua cannot automatically detect the number of bits of
** your machine. Probably you do not need to change this.
*/
/* avoid overflows in comparison */
#if INT_MAX-20 < 32760
#define LUAI_BITSINT 16
#elif INT_MAX > 2147483640L
/* int has at least 32 bits */
#define LUAI_BITSINT 32
#else
#error "you must define LUA_BITSINT with number of bits in an integer"
#endif
/*
@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
@@ LUAI_INT32 is an signed integer with at least 32 bits.
@@ LUAI_UMEM is an unsigned integer big enough to count the total
@* memory used by Lua.
@@ LUAI_MEM is a signed integer big enough to count the total memory
@* used by Lua.
** CHANGE here if for some weird reason the default definitions are not
** good enough for your machine. (The definitions in the 'else'
** part always works, but may waste space on machines with 64-bit
** longs.) Probably you do not need to change this.
*/
#if LUAI_BITSINT >= 32
#define LUAI_UINT32 unsigned int
#define LUAI_INT32 int
#define LUAI_MAXINT32 INT_MAX
#define LUAI_UMEM size_t
#define LUAI_MEM ptrdiff_t
#else
/* 16-bit ints */
#define LUAI_UINT32 unsigned long
#define LUAI_INT32 long
#define LUAI_MAXINT32 LONG_MAX
#define LUAI_UMEM unsigned long
#define LUAI_MEM long
#endif
/*
@@ LUAI_MAXCALLS limits the number of nested calls.
** CHANGE it if you need really deep recursive calls. This limit is
** arbitrary; its only purpose is to stop infinite recursion before
** exhausting memory.
*/
#define LUAI_MAXCALLS 20000
/*
@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
@* can use.
** CHANGE it if you need lots of (Lua) stack space for your C
** functions. This limit is arbitrary; its only purpose is to stop C
** functions to consume unlimited stack space.
*/
#define LUAI_MAXCSTACK 2048
/*
** {==================================================================
** CHANGE (to smaller values) the following definitions if your system
** has a small C stack. (Or you may want to change them to larger
** values if your system has a large C stack and these limits are
** too rigid for you.) Some of these constants control the size of
** stack-allocated arrays used by the compiler or the interpreter, while
** others limit the maximum number of recursive calls that the compiler
** or the interpreter can perform. Values too large may cause a C stack
** overflow for some forms of deep constructs.
** ===================================================================
*/
/*
@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
@* syntactical nested non-terminals in a program.
*/
#define LUAI_MAXCCALLS 200
/*
@@ LUAI_MAXVARS is the maximum number of local variables per function
@* (must be smaller than 250).
*/
#define LUAI_MAXVARS 200
/*
@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
@* (must be smaller than 250).
*/
#define LUAI_MAXUPVALUES 60
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
*/
#define LUAL_BUFFERSIZE BUFSIZ
/* }================================================================== */
/*
** {==================================================================
@@ LUA_NUMBER is the type of numbers in Lua.
** CHANGE the following definitions only if you want to build Lua
** with a number type different from double. You may also need to
** change lua_number2int & lua_number2integer.
** ===================================================================
*/
#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER double
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
#define LUAI_UACNUMBER double
/*
@@ LUA_NUMBER_SCAN is the format for reading numbers.
@@ LUA_NUMBER_FMT is the format for writing numbers.
@@ lua_number2str converts a number to a string.
@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
@@ lua_str2number converts a string to a number.
*/
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
#define lua_str2number(s,p) strtod((s), (p))
/*
@@ The luai_num* macros define the primitive operations over numbers.
*/
#if defined(LUA_CORE)
#include <math.h>
#define luai_numadd(a,b) ((a)+(b))
#define luai_numsub(a,b) ((a)-(b))
#define luai_nummul(a,b) ((a)*(b))
#define luai_numdiv(a,b) ((a)/(b))
#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b))
#define luai_numpow(a,b) (pow(a,b))
#define luai_numunm(a) (-(a))
#define luai_numeq(a,b) ((a)==(b))
#define luai_numlt(a,b) ((a)<(b))
#define luai_numle(a,b) ((a)<=(b))
#define luai_numisnan(a) (!luai_numeq((a), (a)))
#endif
/*
@@ lua_number2int is a macro to convert lua_Number to int.
@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
** CHANGE them if you know a faster way to convert a lua_Number to
** int (with any rounding method and without throwing errors) in your
** system. In Pentium machines, a naive typecast from double to int
** in C is extremely slow, so any alternative is worth trying.
*/
/* On a Pentium, resort to a trick */
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
#define lua_number2integer(i,n) lua_number2int(i, n)
/* this option always works, but may be slow */
#else
#define lua_number2int(i,d) ((i)=(int)(d))
#define lua_number2integer(i,d) ((i)=(lua_Integer)(d))
#endif
/* }================================================================== */
/*
@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
** CHANGE it if your system requires alignments larger than double. (For
** instance, if your system supports long doubles and they must be
** aligned in 16-byte boundaries, then you should add long double in the
** union.) Probably you do not need to change this.
*/
#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
/*
@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
** CHANGE them if you prefer to use longjmp/setjmp even with C++
** or if want/don't to use _longjmp/_setjmp instead of regular
** longjmp/setjmp. By default, Lua handles errors with exceptions when
** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
** and with longjmp/setjmp otherwise.
*/
#if defined(__cplusplus)
/* C++ exceptions */
#define LUAI_THROW(L,c) throw(c)
#define LUAI_TRY(L,c,a) try { a } catch(...) \
{ if ((c)->status == 0) (c)->status = -1; }
#define luai_jmpbuf int /* dummy variable */
#elif defined(LUA_USE_ULONGJMP)
/* in Unix, try _longjmp/_setjmp (more efficient) */
#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
#define luai_jmpbuf jmp_buf
#else
/* default handling with long jumps */
#define LUAI_THROW(L,c) longjmp((c)->b, 1)
#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
#define luai_jmpbuf jmp_buf
#endif
/*
@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern
@* can do during pattern-matching.
** CHANGE it if you need more captures. This limit is arbitrary.
*/
#define LUA_MAXCAPTURES 32
/*
@@ lua_tmpnam is the function that the OS library uses to create a
@* temporary name.
@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
** CHANGE them if you have an alternative to tmpnam (which is considered
** insecure) or if you want the original tmpnam anyway. By default, Lua
** uses tmpnam except when POSIX is available, where it uses mkstemp.
*/
#if defined(loslib_c) || defined(luaall_c)
#if defined(LUA_USE_MKSTEMP)
#include <unistd.h>
#define LUA_TMPNAMBUFSIZE 32
#define lua_tmpnam(b,e) { \
strcpy(b, "/tmp/lua_XXXXXX"); \
e = mkstemp(b); \
if (e != -1) close(e); \
e = (e == -1); }
#else
#define LUA_TMPNAMBUFSIZE L_tmpnam
#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
#endif
#endif
/*
@@ lua_popen spawns a new process connected to the current one through
@* the file streams.
** CHANGE it if you have a way to implement it in your system.
*/
#if defined(LUA_USE_POPEN)
#define lua_popen(L,c,m) ((void)L, popen(c,m))
#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
#elif defined(LUA_WIN)
#define lua_popen(L,c,m) ((void)L, _popen(c,m))
#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1))
#else
#define lua_popen(L,c,m) ((void)((void)c, m), \
luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
#define lua_pclose(L,file) ((void)((void)L, file), 0)
#endif
/*
@@ LUA_DL_* define which dynamic-library system Lua should use.
** CHANGE here if Lua has problems choosing the appropriate
** dynamic-library system for your platform (either Windows' DLL, Mac's
** dyld, or Unix's dlopen). If your system is some kind of Unix, there
** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
** it. To use dlopen you also need to adapt the src/Makefile (probably
** adding -ldl to the linker options), so Lua does not select it
** automatically. (When you change the makefile to add -ldl, you must
** also add -DLUA_USE_DLOPEN.)
** If you do not want any kind of dynamic library, undefine all these
** options.
** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
*/
#if defined(LUA_USE_DLOPEN)
#define LUA_DL_DLOPEN
#endif
#if defined(LUA_WIN)
#define LUA_DL_DLL
#endif
/*
@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
@* (the data goes just *before* the lua_State pointer).
** CHANGE (define) this if you really need that. This value must be
** a multiple of the maximum alignment required for your machine.
*/
#define LUAI_EXTRASPACE 0
/*
@@ luai_userstate* allow user-specific actions on threads.
** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
** extra when a thread is created/deleted/resumed/yielded.
*/
#define luai_userstateopen(L) ((void)L)
#define luai_userstateclose(L) ((void)L)
#define luai_userstatethread(L,L1) ((void)L)
#define luai_userstatefree(L) ((void)L)
#define luai_userstateresume(L,n) ((void)L)
#define luai_userstateyield(L,n) ((void)L)
/*
@@ LUA_INTFRMLEN is the length modifier for integer conversions
@* in 'string.format'.
@@ LUA_INTFRM_T is the integer type correspoding to the previous length
@* modifier.
** CHANGE them if your system supports long long or does not support long.
*/
#if defined(LUA_USELONGLONG)
#define LUA_INTFRMLEN "ll"
#define LUA_INTFRM_T long long
#else
#define LUA_INTFRMLEN "l"
#define LUA_INTFRM_T long
#endif
/* =================================================================== */
/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
*/
#endif

View File

@ -0,0 +1,53 @@
/*
** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
#ifndef lualib_h
#define lualib_h
#include "lua.h"
/* Key to file-handle type */
#define LUA_FILEHANDLE "FILE*"
#define LUA_COLIBNAME "coroutine"
LUALIB_API int (luaopen_base) (lua_State *L);
#define LUA_TABLIBNAME "table"
LUALIB_API int (luaopen_table) (lua_State *L);
#define LUA_IOLIBNAME "io"
LUALIB_API int (luaopen_io) (lua_State *L);
#define LUA_OSLIBNAME "os"
LUALIB_API int (luaopen_os) (lua_State *L);
#define LUA_STRLIBNAME "string"
LUALIB_API int (luaopen_string) (lua_State *L);
#define LUA_MATHLIBNAME "math"
LUALIB_API int (luaopen_math) (lua_State *L);
#define LUA_DBLIBNAME "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);
#define LUA_LOADLIBNAME "package"
LUALIB_API int (luaopen_package) (lua_State *L);
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
#ifndef lua_assert
#define lua_assert(x) ((void)0)
#endif
#endif

View File

@ -0,0 +1,155 @@
/*
-Header_File SpiceCK.h ( CSPICE CK definitions )
-Abstract
Perform CSPICE definitions to support CK wrapper interfaces.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines types that may be referenced in
application code that calls CSPICE CK functions.
Typedef
=======
Name Description
---- ----------
SpiceCK05Subtype Typedef for enum indicating the
mathematical representation used
in an CK type 05 segment. Possible
values and meanings are:
C05TP0:
Hermite interpolation, 8-
element packets containing
q0, q1, q2, q3,
dq0/dt, dq1/dt, dq2/dt dq3/dt
where q0, q1, q2, q3 represent
quaternion components and dq0/dt,
dq1/dt, dq2/dt, dq3/dt represent
quaternion time derivative components.
Quaternions are unitless. Quaternion
time derivatives have units of
1/second.
C05TP1:
Lagrange interpolation, 4-
element packets containing
q0, q1, q2, q3,
where q0, q1, q2, q3 represent
quaternion components. Quaternion
derivatives are obtained by
differentiating interpolating
polynomials.
C05TP2:
Hermite interpolation, 14-
element packets containing
q0, q1, q2, q3,
dq0/dt, dq1/dt, dq2/dt dq3/dt,
av0, av1, av2,
dav0/dt, dav1/dt, dav2/dt
where q0, q1, q2, q3 represent
quaternion components and dq0/dt,
dq1/dt, dq2/dt, dq3/dt represent
quaternion time derivative components,
av0, av1, av2 represent angular
velocity components, and
dav0/dt, dav1/dt, dav2/dt represent
angular acceleration components.
C05TP3:
Lagrange interpolation, 7-
element packets containing
q0, q1, q2, q3,
av0, av1, av2
where q0, q1, q2, q3 represent
quaternion components and
av0, av1, av2 represent angular
velocity components.
Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.0.0, 20-AUG-2002 (NJB)
*/
#ifndef HAVE_SPICE_CK_H
#define HAVE_SPICE_CK_H
/*
CK type 05 subtype codes:
*/
enum _SpiceCK05Subtype { C05TP0, C05TP1, C05TP2, C05TP3 };
typedef enum _SpiceCK05Subtype SpiceCK05Subtype;
#endif

View File

@ -0,0 +1,441 @@
/*
-Header_File SpiceCel.h ( CSPICE Cell definitions )
-Abstract
Perform CSPICE definitions for the SpiceCell data type.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
CELLS
-Particulars
This header defines structures, macros, and enumerated types that
may be referenced in application code that calls CSPICE cell
functions.
CSPICE cells are data structures that implement functionality
parallel to that of the cell abstract data type in SPICELIB. In
CSPICE, a cell is a C structure containing bookkeeping information,
including a pointer to an associated data array.
For numeric data types, the data array is simply a SPICELIB-style
cell, including a valid control area. For character cells, the data
array has the same number of elements as the corresponding
SPICELIB-style cell, but the contents of the control area are not
maintained, and the data elements are null-terminated C-style
strings.
CSPICE cells should be declared using the declaration macros
provided in this header file. See the table of macros below.
Structures
==========
Name Description
---- ----------
SpiceCell Structure containing CSPICE cell metadata.
The members are:
dtype: Data type of cell: character,
integer, or double precision.
dtype has type
SpiceCellDataType.
length: For character cells, the
declared length of the
cell's string array.
size: The maximum number of data
items that can be stored in
the cell's data array.
card: The cell's "cardinality": the
number of data items currently
present in the cell.
isSet: Boolean flag indicating whether
the cell is a CSPICE set.
Sets have no duplicate data
items, and their data items are
stored in increasing order.
adjust: Boolean flag indicating whether
the cell's data area has
adjustable size. Adjustable
size cell data areas are not
currently implemented.
init: Boolean flag indicating whether
the cell has been initialized.
base: is a void pointer to the
associated data array. base
points to the start of the
control area of this array.
data: is a void pointer to the
first data slot in the
associated data array. This
slot is the element following
the control area.
ConstSpiceCell A const SpiceCell.
Declaration Macros
==================
Name Description
---- ----------
SPICECHAR_CELL ( name, size, length ) Declare a
character CSPICE
cell having cell
name name,
maximum cell
cardinality size,
and string length
length. The
macro declares
both the cell and
the associated
data array. The
name of the data
array begins with
"SPICE_".
SPICEDOUBLE_CELL ( name, size ) Like SPICECHAR_CELL,
but declares a
double precision
cell.
SPICEINT_CELL ( name, size ) Like
SPICECHAR_CELL,
but declares an
integer cell.
Assignment Macros
=================
Name Description
---- ----------
SPICE_CELL_SET_C( item, i, cell ) Assign the ith
element of a
character cell.
Arguments cell
and item are
pointers.
SPICE_CELL_SET_D( item, i, cell ) Assign the ith
element of a
double precision
cell. Argument
cell is a
pointer.
SPICE_CELL_SET_I( item, i, cell ) Assign the ith
element of an
integer cell.
Argument cell is
a pointer.
Fetch Macros
==============
Name Description
---- ----------
SPICE_CELL_GET_C( cell, i, lenout, item ) Fetch the ith
element from a
character cell.
Arguments cell
and item are
pointers.
Argument lenout
is the available
space in item.
SPICE_CELL_GET_D( cell, i, item ) Fetch the ith
element from a
double precision
cell. Arguments
cell and item are
pointers.
SPICE_CELL_GET_I( cell, i, item ) Fetch the ith
element from an
integer cell.
Arguments cell
and item are
pointers.
Element Pointer Macros
======================
Name Description
---- ----------
SPICE_CELL_ELEM_C( cell, i ) Macro evaluates
to a SpiceChar
pointer to the
ith data element
of a character
cell. Argument
cell is a
pointer.
SPICE_CELL_ELEM_D( cell, i ) Macro evaluates
to a SpiceDouble
pointer to the
ith data element
of a double
precision cell.
Argument cell is
a pointer.
SPICE_CELL_ELEM_I( cell, i ) Macro evaluates
to a SpiceInt
pointer to the
ith data element
of an integer
cell. Argument
cell is a
pointer.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.0.0, 22-AUG-2002 (NJB)
*/
#ifndef HAVE_SPICE_CELLS_H
#define HAVE_SPICE_CELLS_H
/*
Data type codes:
*/
typedef enum _SpiceDataType SpiceCellDataType;
/*
Cell structure:
*/
struct _SpiceCell
{ SpiceCellDataType dtype;
SpiceInt length;
SpiceInt size;
SpiceInt card;
SpiceBoolean isSet;
SpiceBoolean adjust;
SpiceBoolean init;
void * base;
void * data; };
typedef struct _SpiceCell SpiceCell;
typedef const SpiceCell ConstSpiceCell;
/*
SpiceCell control area size:
*/
#define SPICE_CELL_CTRLSZ 6
/*
Declaration macros:
*/
#define SPICECHAR_CELL( name, size, length ) \
\
static SpiceChar SPICE_CELL_##name[SPICE_CELL_CTRLSZ + size][length]; \
\
static SpiceCell name = \
\
{ SPICE_CHR, \
length, \
size, \
0, \
SPICETRUE, \
SPICEFALSE, \
SPICEFALSE, \
(void *) &(SPICE_CELL_##name), \
(void *) &(SPICE_CELL_##name[SPICE_CELL_CTRLSZ]) }
#define SPICEDOUBLE_CELL( name, size ) \
\
static SpiceDouble SPICE_CELL_##name [SPICE_CELL_CTRLSZ + size]; \
\
static SpiceCell name = \
\
{ SPICE_DP, \
0, \
size, \
0, \
SPICETRUE, \
SPICEFALSE, \
SPICEFALSE, \
(void *) &(SPICE_CELL_##name), \
(void *) &(SPICE_CELL_##name[SPICE_CELL_CTRLSZ]) }
#define SPICEINT_CELL( name, size ) \
\
static SpiceInt SPICE_CELL_##name [SPICE_CELL_CTRLSZ + size]; \
\
static SpiceCell name = \
\
{ SPICE_INT, \
0, \
size, \
0, \
SPICETRUE, \
SPICEFALSE, \
SPICEFALSE, \
(void *) &(SPICE_CELL_##name), \
(void *) &(SPICE_CELL_##name[SPICE_CELL_CTRLSZ]) }
/*
Access macros for individual elements:
*/
/*
Data element pointer macros:
*/
#define SPICE_CELL_ELEM_C( cell, i ) \
\
( ( (SpiceChar *) (cell)->data ) + (i)*( (cell)->length ) )
#define SPICE_CELL_ELEM_D( cell, i ) \
\
( ( (SpiceDouble *) (cell)->data )[(i)] )
#define SPICE_CELL_ELEM_I( cell, i ) \
\
( ( (SpiceInt *) (cell)->data )[(i)] )
/*
"Fetch" macros:
*/
#define SPICE_CELL_GET_C( cell, i, lenout, item ) \
\
{ \
SpiceInt nBytes; \
\
nBytes = brckti_c ( (cell)->length, 0, (lenout-1) ) \
* sizeof ( SpiceChar ); \
\
memmove ( (item), SPICE_CELL_ELEM_C((cell), (i)), nBytes ); \
\
item[nBytes] = NULLCHAR; \
}
#define SPICE_CELL_GET_D( cell, i, item ) \
\
( (*item) = ( (SpiceDouble *) (cell)->data)[i] )
#define SPICE_CELL_GET_I( cell, i, item ) \
\
( (*item) = ( (SpiceInt *) (cell)->data)[i] )
/*
Assignment macros:
*/
#define SPICE_CELL_SET_C( item, i, cell ) \
\
{ \
SpiceChar * sPtr; \
SpiceInt nBytes; \
\
nBytes = brckti_c ( strlen(item), 0, (cell)->length - 1 ) \
* sizeof ( SpiceChar ); \
\
sPtr = SPICE_CELL_ELEM_C((cell), (i)); \
\
memmove ( sPtr, (item), nBytes ); \
\
sPtr[nBytes] = NULLCHAR; \
}
#define SPICE_CELL_SET_D( item, i, cell ) \
\
( ( (SpiceDouble *) (cell)->data)[i] = (item) )
#define SPICE_CELL_SET_I( item, i, cell ) \
\
( ( (SpiceInt *) (cell)->data)[i] = (item) )
/*
The enum SpiceTransDir is used to indicate language translation
direction: C to Fortran or vice versa.
*/
enum _SpiceTransDir { C2F = 0, F2C = 1 };
typedef enum _SpiceTransDir SpiceTransDir;
#endif

View File

@ -0,0 +1,448 @@
/*
-Header_File SpiceEK.h ( CSPICE EK-specific definitions )
-Abstract
Perform CSPICE EK-specific definitions, including macros and user-
defined types.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines macros, enumerated types, structures, and
typedefs that may be referenced in application code that calls CSPICE
EK functions.
Macros
======
General limits
--------------
Name Description
---- ----------
SPICE_EK_MXCLSG Maximum number of columns per segment.
SPICE_EK_TYPLEN Maximum length of a short string
indicating a data type (one of
{"CHR", "DP", "INT", "TIME"}). Such
strings are returned by some of the
Fortran SPICELIB EK routines, hence also
by their f2c'd counterparts.
Sizes of EK objects
-------------------
Name Description
---- ----------
SPICE_EK_CNAMSZ Maximum length of column name.
SPICE_EK_CSTRLN Length of string required to hold column
name.
SPICE_EK_TNAMSZ Maximum length of table name.
SPICE_EK_TSTRLN Length of string required to hold table
name.
Query-related limits
--------------------
Name Description
---- ----------
SPICE_EK_MAXQRY Maximum length of an input query. This
value is currently equivalent to
twenty-five 80-character lines.
SPICE_EK_MAXQSEL Maximum number of columns that may be
listed in the `SELECT clause' of a query.
SPICE_EK_MAXQTAB Maximum number of tables that may be
listed in the `FROM clause' of a query.
SPICE_EK_MAXQCON Maximum number of relational expressions
that may be listed in the `constraint
clause' of a query.
This limit applies to a query when it is
represented in `normalized form': that
is, the constraints have been expressed
as a disjunction of conjunctions of
relational expressions. The number of
relational expressions in a query that
has been expanded in this fashion may be
greater than the number of relations in
the query as orginally written. For
example, the expression
( ( A LT 1 ) OR ( B GT 2 ) )
AND
( ( C NE 3 ) OR ( D EQ 4 ) )
which contains 4 relational expressions,
expands to the equivalent normalized
constraint
( ( A LT 1 ) AND ( C NE 3 ) )
OR
( ( A LT 1 ) AND ( D EQ 4 ) )
OR
( ( B GT 2 ) AND ( C NE 3 ) )
OR
( ( B GT 2 ) AND ( D EQ 4 ) )
which contains eight relational
expressions.
SPICE_EK_MAXQJOIN Maximum number of tables that can be
joined.
SPICE_EK_MAXQJCON Maximum number of join constraints
allowed.
SPICE_EK_MAXQORD Maximum number of columns that may be
used in the `order-by clause' of a query.
SPICE_EK_MAXQTOK Maximum number of tokens in a query.
Tokens
are reserved words, column names,
parentheses, and values. Literal strings
and time values count as single tokens.
SPICE_EK_MAXQNUM Maximum number of numeric tokens in a
query.
SPICE_EK_MAXQCLN Maximum total length of character tokens
in a query.
SPICE_EK_MAXQSTR Maximum length of literal string values
allowed in queries.
Codes
-----
Name Description
---- ----------
SPICE_EK_VARSIZ Code used to indicate variable-size
objects. Usually this is used in a
context where a non-negative integer
indicates the size of a fixed-size object
and the presence of this code indicates a
variable-size object.
The value of this constant must match the
parameter IFALSE used in the Fortran
library SPICELIB.
Enumerated Types
================
Enumerated code values
----------------------
Name Description
---- ----------
SpiceEKDataType Codes for data types used in the EK
interface: character, double precision,
integer, and "time."
The values are:
{ SPICE_CHR = 0,
SPICE_DP = 1,
SPICE_INT = 2,
SPICE_TIME = 3 }
SpiceEKExprClass Codes for types of expressions that may
appear in the SELECT clause of EK
queries. Values and meanings are:
SPICE_EK_EXP_COL Selected item was a
column. The column
may qualified by a
table name.
SPICE_EK_EXP_FUNC Selected item was
a simple function
invocation of the
form
F ( <column> )
or else was
COUNT(*)
SPICE_EK_EXP_EXPR Selected item was a
more general
expression than
those shown above.
Numeric values are:
{ SPICE_EK_EXP_COL = 0,
SPICE_EK_EXP_FUNC = 1,
SPICE_EK_EXP_EXPR = 2 }
Structures
==========
EK API structures
-----------------
Name Description
---- ----------
SpiceEKAttDsc EK column attribute descriptor. Note
that this object is distinct from the EK
column descriptors used internally in
the EK routines; those descriptors
contain pointers as well as attribute
information.
The members are:
cclass: Column class code.
dtype: Data type code: has type
SpiceEKDataType.
strlen: String length. Applies to
SPICE_CHR type. Value is
SPICE_EK_VARSIZ for
variable-length strings.
size: Column entry size; this is
the number of array
elements in a column
entry. The value is
SPICE_EK_VARSIZ for
variable-size columns.
indexd: Index flag; value is
SPICETRUE if the column is
indexed, SPICEFALSE
otherwise.
nullok: Null flag; value is
SPICETRUE if the column
may contain null values,
SPICEFALSE otherwise.
SpiceEKSegSum EK segment summary. This structure
contains user interface level descriptive
information. The structure contains the
following members:
tabnam The name of the table to
which the segment belongs.
nrows The number of rows in the
segment.
ncols The number of columns in
the segment.
cnames An array of names of
columns in the segment.
Column names may contain
as many as SPICE_EK_CNAMSZ
characters. The array
contains room for
SPICE_EK_MXCLSG column
names.
cdescrs An array of column
attribute descriptors of
type SpiceEKAttDsc.
The array contains room
for SPICE_EK_MXCLSG
descriptors. The Ith
descriptor corresponds to
the column whose name is
the Ith element of the
array cnames.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 2.0.0 27-JUL-2002 (NJB)
Defined SpiceEKDataType using SpiceDataType. Removed declaration
of enum _SpiceEKDataType.
-CSPICE Version 1.0.0, 05-JUL-1999 (NJB)
Renamed _SpiceEKAttDsc member "class" to "cclass." The
former name is a reserved word in C++.
-CSPICE Version 1.0.0, 24-FEB-1999 (NJB)
*/
#ifndef HAVE_SPICE_EK_H
#define HAVE_SPICE_EK_H
/*
Constants
*/
/*
Sizes of EK objects:
*/
#define SPICE_EK_CNAMSZ 32
#define SPICE_EK_CSTRLN ( SPICE_EK_CNAMSZ + 1 )
#define SPICE_EK_TNAMSZ 64
#define SPICE_EK_TSTRLN ( SPICE_EK_TNAMSZ + 1 )
/*
Maximum number of columns per segment:
*/
#define SPICE_EK_MXCLSG 100
/*
Maximum length of string indicating data type:
*/
#define SPICE_EK_TYPLEN 4
/*
Query-related limits (see header for details):
*/
#define SPICE_EK_MAXQRY 2000
#define SPICE_EK_MAXQSEL 50
#define SPICE_EK_MAXQTAB 10
#define SPICE_EK_MAXQCON 1000
#define SPICE_EK_MAXQJOIN 10
#define SPICE_EK_MAXQJCON 100
#define SPICE_EK_MAXQORD 10
#define SPICE_EK_MAXQTOK 500
#define SPICE_EK_MAXQNUM 100
#define SPICE_EK_MAXQCLN SPICE_EK_MAXQRY
#define SPICE_EK_MAXQSTR 1024
/*
Code indicating "variable size":
*/
#define SPICE_EK_VARSIZ (-1)
/*
Data type codes:
*/
typedef SpiceDataType SpiceEKDataType;
/*
SELECT clause expression type codes:
*/
enum _SpiceEKExprClass{ SPICE_EK_EXP_COL = 0,
SPICE_EK_EXP_FUNC = 1,
SPICE_EK_EXP_EXPR = 2 };
typedef enum _SpiceEKExprClass SpiceEKExprClass;
/*
EK column attribute descriptor:
*/
struct _SpiceEKAttDsc
{ SpiceInt cclass;
SpiceEKDataType dtype;
SpiceInt strlen;
SpiceInt size;
SpiceBoolean indexd;
SpiceBoolean nullok; };
typedef struct _SpiceEKAttDsc SpiceEKAttDsc;
/*
EK segment summary:
*/
struct _SpiceEKSegSum
{ SpiceChar tabnam [SPICE_EK_TSTRLN];
SpiceInt nrows;
SpiceInt ncols;
SpiceChar cnames [SPICE_EK_MXCLSG][SPICE_EK_CSTRLN];
SpiceEKAttDsc cdescrs[SPICE_EK_MXCLSG]; };
typedef struct _SpiceEKSegSum SpiceEKSegSum;
#endif

View File

@ -0,0 +1,115 @@
/*
-Header_File SpiceEll.h ( CSPICE Ellipse definitions )
-Abstract
Perform CSPICE definitions for the SpiceEllipse data type.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines structures and typedefs that may be referenced in
application code that calls CSPICE Ellipse functions.
Structures
==========
Name Description
---- ----------
SpiceEllipse Structure representing an ellipse in 3-
dimensional space.
The members are:
center: Vector defining ellipse's
center.
semiMajor: Vector defining ellipse's
semi-major axis.
semiMinor: Vector defining ellipse's
semi-minor axis.
The ellipse is the set of points
{X: X = center
+ cos(theta) * semiMajor
+ sin(theta) * semiMinor,
theta in [0, 2*Pi) }
ConstSpiceEllipse A const SpiceEllipse.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.0.0, 04-MAR-1999 (NJB)
*/
#ifndef HAVE_SPICE_ELLIPSES
#define HAVE_SPICE_ELLIPSES
/*
Ellipse structure:
*/
struct _SpiceEllipse
{ SpiceDouble center [3];
SpiceDouble semiMajor [3];
SpiceDouble semiMinor [3]; };
typedef struct _SpiceEllipse SpiceEllipse;
typedef const SpiceEllipse ConstSpiceEllipse;
#endif

View File

@ -0,0 +1,106 @@
/*
-Header_File SpicePln.h ( CSPICE Plane definitions )
-Abstract
Perform CSPICE definitions for the SpicePlane data type.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines structures and typedefs that may be referenced in
application code that calls CSPICE Plane functions.
Structures
==========
Name Description
---- ----------
SpicePlane Structure representing a plane in 3-
dimensional space.
The members are:
normal: Vector normal to plane.
constant: Constant of plane equation
Plane =
{X: <normal,X> = constant}
ConstSpicePlane A const SpicePlane.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.0.0, 04-MAR-1999 (NJB)
*/
#ifndef HAVE_SPICE_PLANES
#define HAVE_SPICE_PLANES
/*
Plane structure:
*/
struct _SpicePlane
{ SpiceDouble normal [3];
SpiceDouble constant; };
typedef struct _SpicePlane SpicePlane;
typedef const SpicePlane ConstSpicePlane;
#endif

View File

@ -0,0 +1,128 @@
/*
-Header_File SpiceSPK.h ( CSPICE SPK definitions )
-Abstract
Perform CSPICE definitions to support SPK wrapper interfaces.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines types that may be referenced in
application code that calls CSPICE SPK functions.
Typedef
=======
Name Description
---- ----------
SpiceSPK18Subtype Typedef for enum indicating the
mathematical representation used
in an SPK type 18 segment. Possible
values and meanings are:
S18TP0:
Hermite interpolation, 12-
element packets containing
x, y, z, dx/dt, dy/dt, dz/dt,
vx, vy, vz, dvx/dt, dvy/dt, dvz/dt
where x, y, z represent Cartesian
position components and vx, vy, vz
represent Cartesian velocity
components. Note well: vx, vy, and
vz *are not necessarily equal* to the
time derivatives of x, y, and z.
This packet structure mimics that of
the Rosetta/MEX orbit file from which
the data are taken.
Position units are kilometers,
velocity units are kilometers per
second, and acceleration units are
kilometers per second per second.
S18TP1:
Lagrange interpolation, 6-
element packets containing
x, y, z, dx/dt, dy/dt, dz/dt
where x, y, z represent Cartesian
position components and vx, vy, vz
represent Cartesian velocity
components.
Position units are kilometers;
velocity units are kilometers per
second.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.0.0, 16-AUG-2002 (NJB)
*/
#ifndef HAVE_SPICE_SPK_H
#define HAVE_SPICE_SPK_H
/*
SPK type 18 subtype codes:
*/
enum _SpiceSPK18Subtype { S18TP0, S18TP1 };
typedef enum _SpiceSPK18Subtype SpiceSPK18Subtype;
#endif

View File

@ -0,0 +1,206 @@
/*
-Header_File SpiceUsr.h ( CSPICE user interface definitions )
-Abstract
Perform CSPICE user interface declarations, including type
definitions and function prototype declarations.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This file is an umbrella header that includes all header files
required to support the CSPICE application programming interface
(API). Users' application code that calls CSPICE need include only
this single header file. This file includes function prototypes for
the entire set of CSPICE routines. Typedef statements used to create
SPICE data types are also included.
About SPICE data types
======================
To assist with long-term maintainability of CSPICE, NAIF has elected
to use typedefs to represent data types occurring in argument lists
and as return values of CSPICE functions. These are:
SpiceBoolean
SpiceChar
SpiceDouble
SpiceInt
ConstSpiceBoolean
ConstSpiceChar
ConstSpiceDouble
ConstSpiceInt
The SPICE typedefs map in an arguably natural way to ANSI C types:
SpiceBoolean -> enum { SPICEFALSE = 0, SPICETRUE = 1 }
SpiceChar -> char
SpiceDouble -> double
SpiceInt -> int or long
ConstX -> const X (X = any of the above types)
The type SpiceInt is a special case: the corresponding type is picked
so as to be half the size of a double. On all currently supported
platforms, type double occupies 8 bytes and type int occupies 4
bytes. Other platforms may require a SpiceInt to map to type long.
While other data types may be used internally in CSPICE, no other
types appear in the API.
About CSPICE function prototypes
================================
Because CSPICE function prototypes enable substantial
compile-time error checking, we recommend that user
applications always reference them. Including the header
file SpiceUsr.h in any module that calls CSPICE will
automatically make the prototypes available.
About CSPICE C style
====================
CSPICE is written in ANSI C. No attempt has been made to support K&R
conventions or restrictions.
About C++ compatibility
=======================
The preprocessor directive -D__cplusplus should be used when
compiling C++ source code that includes this header file. This
directive will suppress mangling of CSPICE names, permitting linkage
to a CSPICE object library built from object modules produced by
an ANSI C compiler.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
E.D. Wright (JPL)
-Restrictions
The #include statements contained in this file are not part of
the CSPICE API. The set of files included may change without notice.
Users should not include these files directly in their own
application code.
-Version
-CSPICE Version 3.0.0, 19-AUG-2002 (NJB)
Updated to include header files
SpiceCel.h
SpiceCK.h
SpiceSPK.h
-CSPICE Version 3.0.0, 17-FEB-1999 (NJB)
Updated to support suppression of name mangling when included in
C++ source code. Also now interface macros to intercept function
calls and perform automatic type casting.
Now includes platform macro definition header file.
References to types SpiceVoid and ConstSpiceVoid were removed.
-CSPICE Version 2.0.0, 06-MAY-1998 (NJB) (EDW)
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HAVE_SPICE_USER
#define HAVE_SPICE_USER
/*
Include CSPICE platform macro definitions.
*/
#include "SpiceZpl.h"
/*
Include CSPICE data type definitions.
*/
#include "SpiceZdf.h"
/*
Include the CSPICE EK interface definitions.
*/
#include "SpiceEK.h"
/*
Include the CSPICE Cell interface definitions.
*/
#include "SpiceCel.h"
/*
Include the CSPICE CK interface definitions.
*/
#include "SpiceCK.h"
/*
Include the CSPICE SPK interface definitions.
*/
#include "SpiceSPK.h"
/*
Include CSPICE prototypes.
*/
#include "SpiceZpr.h"
/*
Define the CSPICE function interface macros.
*/
#include "SpiceZim.h"
#endif
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,217 @@
/*
-Header_File SpiceZdf.h ( CSPICE definitions )
-Abstract
Define CSPICE data types via typedefs; also define some user-visible
enumerated types.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
CSPICE data types
=================
To assist with long-term maintainability of CSPICE, NAIF has elected
to use typedefs to represent data types occurring in argument lists
and as return values of CSPICE functions. These are:
SpiceBoolean
SpiceChar
SpiceDouble
SpiceInt
ConstSpiceBoolean
ConstSpiceChar
ConstSpiceDouble
ConstSpiceInt
The SPICE typedefs map in an arguably natural way to ANSI C types:
SpiceBoolean -> int
SpiceChar -> char
SpiceDouble -> double
SpiceInt -> int or long
ConstX -> const X (X = any of the above types)
The type SpiceInt is a special case: the corresponding type is picked
so as to be half the size of a double. On most currently supported
platforms, type double occupies 8 bytes and type long occupies 4
bytes. Other platforms may require a SpiceInt to map to type int.
The Alpha/Digital Unix platform is an example of the latter case.
While other data types may be used internally in CSPICE, no other
types appear in the API.
CSPICE enumerated types
=======================
These are provided to enhance readability of the code.
Type name Value set
--------- ---------
_Spicestatus { SPICEFAILURE = -1, SPICESUCCESS = 0 }
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
E.D. Wright (JPL)
-Restrictions
None.
-Version
-CSPICE Version 1.2.0, 27-JAN-2003 (NJB)
Updated to support the Sun Solaris 64 bit mode/gcc platform.
-CSPICE Version 4.0.0 27-JUL-2002 (NJB)
Added definition of SpiceDataType.
-CSPICE Version 3.0.0 18-SEP-1999 (NJB)
SpiceBoolean implementation changed from enumerated type to
typedef mapping to int.
-CSPICE Version 2.0.0 29-JAN-1999 (NJB)
Made definition of SpiceInt and ConstSpiceInt platform
dependent to accommodate the Alpha/Digital Unix platform.
Removed definitions of SpiceVoid and ConstSpiceVoid.
-CSPICE Version 1.0.0 25-OCT-1997 (KRG) (NJB) (EDW)
*/
#ifndef HAVE_SPICEDEFS_H
#define HAVE_SPICEDEFS_H
/*
Include platform definitions, if they haven't been executed already.
*/
#ifndef HAVE_PLATFORM_MACROS_H
#include "SpiceZpl.h"
#endif
/*
Basic data types. These are defined to be compatible with the
types used by f2c, and so they follow the Fortran notion of what
these things are. See the f2c documentation for the details
about the choices for the sizes of these types.
*/
typedef char SpiceChar;
typedef double SpiceDouble;
typedef float SpiceFloat;
#if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) )
typedef int SpiceInt;
#else
typedef long SpiceInt;
#endif
typedef const char ConstSpiceChar;
typedef const double ConstSpiceDouble;
typedef const float ConstSpiceFloat;
#if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) )
typedef const int ConstSpiceInt;
#else
typedef const long ConstSpiceInt;
#endif
/*
More basic data types. These give mnemonics for some other data
types in C that are not used in Fortran written by NAIF or
supported by ANSI Fortran 77. These are for use in C functions
but should not be passed to any C SPICE wrappers, ``*_c.c''
since they are not Fortran compatible.
*/
typedef long SpiceLong;
typedef short SpiceShort;
/*
Unsigned data types
*/
typedef unsigned char SpiceUChar;
typedef unsigned int SpiceUInt;
typedef unsigned long SpiceULong;
typedef unsigned short SpiceUShort;
/*
Signed data types
*/
typedef signed char SpiceSChar;
/*
Other basic types
*/
typedef int SpiceBoolean;
typedef const int ConstSpiceBoolean;
#define SPICETRUE 1
#define SPICEFALSE 0
enum _Spicestatus { SPICEFAILURE = -1, SPICESUCCESS = 0 };
typedef enum _Spicestatus SpiceStatus;
enum _SpiceDataType { SPICE_CHR = 0,
SPICE_DP = 1,
SPICE_INT = 2,
SPICE_TIME = 3,
SPICE_BOOL = 4 };
typedef enum _SpiceDataType SpiceDataType;
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,975 @@
/*
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
*/
/*
CSPICE private macro file.
-Particulars
Current list of macros (spelling counts)
BLANK
C2F_MAP_CELL
C2F_MAP_CELL2
C2F_MAP_CELL3
CELLINIT
CELLINIT2
CELLINIT3
CELLISSETCHK
CELLISSETCHK2
CELLISSETCHK2_VAL
CELLISSETCHK3
CELLISSETCHK3_VAL
CELLISSETCHK_VAL
CELLMATCH2
CELLMATCH2_VAL
CELLMATCH3
CELLMATCH3_VAL
CELLTYPECHK
CELLTYPECHK2
CELLTYPECHK2_VAL
CELLTYPECHK3
CELLTYPECHK3_VAL
CELLTYPECHK_VAL
CHKFSTR
CHKFSTR_VAL
CHKOSTR
CHKOSTR_VAL
CHKPTR
Constants
Even
F2C_MAP_CELL
Index values
MOVED
MOVEI
MaxAbs
MaxVal
MinAbs
MinVal
Odd
SpiceError
TolOrFail
-Restrictions
This is a private macro file for use within CSPICE.
Do not use or alter any entry. Or else!
-Author_and_Institution
N.J. Bachman (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 4.2.0, 16-FEB-2005 (NJB)
Bug fix: in the macro C2F_MAP_CELL, error checking has been
added after the sequence of calls to ssizec_ and scardc_.
If either of these routines signals an error, the dynamically
allocated memory for the "Fortran cell" is freed.
-CSPICE Version 4.1.0, 06-DEC-2002 (NJB)
Bug fix: added previous missing, bracketing parentheses to
references to input cell pointer argument in macro
CELLINIT.
Changed CELLINIT macro so it no longer initializes to zero
length all strings in data array of a character cell. Instead,
strings are terminated with a null in their final element.
-CSPICE Version 4.0.0, 22-AUG-2002 (NJB)
Added macro definitions to support CSPICE cells and sets:
C2F_MAP_CELL
C2F_MAP_CELL2
C2F_MAP_CELL3
CELLINIT
CELLINIT2
CELLINIT3
CELLISSETCHK
CELLISSETCHK2
CELLISSETCHK2_VAL
CELLISSETCHK3
CELLISSETCHK3_VAL
CELLISSETCHK_VAL
CELLMATCH2
CELLMATCH2_VAL
CELLMATCH3
CELLMATCH3_VAL
CELLTYPECHK
CELLTYPECHK2
CELLTYPECHK2_VAL
CELLTYPECHK3
CELLTYPECHK3_VAL
CELLTYPECHK_VAL
F2C_MAP_CELL
-CSPICE Version 3.0.0, 09-JAN-1998 (NJB)
Added output string check macros CHKOSTR and CHKOSTR_VAL.
Removed variable name arguments from macros
CHKPTR
CHKPTR_VAL
CHKFSTR
CHKRSTR_VAL
The strings containing names of the checked variables are now
generated from the variables themselves via the # operator.
-CSPICE Version 2.0.0, 03-DEC-1997 (NJB)
Added pointer check macro CHKPTR and Fortran string check macro
CHKFSTR.
-CSPICE Version 1.0.0, 25-OCT-1997 (EDW)
*/
#include <math.h>
#include <string.h>
#include "SpiceZdf.h"
#define MOVED( arrfrm, ndim, arrto ) \
\
( memmove ( (void*) (arrto) , \
(void*) (arrfrm), \
sizeof (SpiceDouble) * (ndim) ) )
#define MOVEI( arrfrm, ndim, arrto ) \
\
( memmove ( (void*) (arrto) , \
(void*) (arrfrm), \
sizeof (SpiceInt) * (ndim) ) )
/*
Define a tolerance test for those pesky double precision reals.
True if the difference is less than the tolerance, false otherwise.
The tolerance refers to a percentage. x, y and tol should be declared
double. All values are assumed to be non-zero. Okay?
*/
#define TolOrFail( x, y, tol ) \
\
( fabs( x-y ) < ( tol * fabs(x) ) )
/*
Simple error output through standard SPICE error system . Set the error
message and the type
*/
#define SpiceError( errmsg, errtype ) \
\
{ \
setmsg_c ( errmsg ); \
sigerr_c ( errtype ); \
}
/*
Return a value which is the maximum/minimum of the absolute values of
two values.
*/
#define MaxAbs(a,b) ( fabs(a) >= fabs(b) ? fabs(a) : fabs(b) )
#define MinAbs(a,b) ( fabs(a) < fabs(b) ? fabs(a) : fabs(b) )
/*
Return a value which is the maximum/minimum value of two values.
*/
#define MaxVal(A,B) ( (A) >= (B) ? (A) : (B) )
#define MinVal(A,B) ( (A) < (B) ? (A) : (B) )
/*
Determine whether a value is even or odd
*/
#define Even( x ) ( ( (x) & 1 ) == 0 )
#define Odd ( x ) ( ( (x) & 1 ) != 0 )
/*
Array indexes for vectors.
*/
#define SpiceX 0
#define SpiceY 1
#define SpiceZ 2
#define SpiceVx 3
#define SpiceVy 4
#define SpiceVz 5
/*
Physical constants and dates.
*/
#define B1900 2415020.31352
#define J1900 2415020.0
#define JYEAR 31557600.0
#define TYEAR 31556925.9747
#define J1950 2433282.5
#define SPD 86400.0
#define B1950 2433282.42345905
#define J2100 2488070.0
#define CLIGHT 299792.458
#define J2000 2451545.0
/*
Common literal values.
*/
#define NULLCHAR ( (SpiceChar ) 0 )
#define NULLCPTR ( (SpiceChar * ) 0 )
#define BLANK ( (SpiceChar ) ' ' )
/*
Macro CHKPTR is used for checking for a null pointer. CHKPTR uses
the constants
CHK_STANDARD
CHK_DISCOVER
CHK_REMAIN
to control tracing behavior. Values and meanings are:
CHK_STANDARD Standard tracing. If an error
is found, signal it, check out
and return.
CHK_DISCOVER Discovery check-in. If an
error is found, check in, signal
the error, check out, and return.
CHK_REMAIN If an error is found, signal it.
Do not check out or return. This
would allow the caller to clean up
before returning, if necessary.
In such cases the caller must test
failed_c() after the macro call.
CHKPTR should be used in void functions. In non-void functions,
use CHKPTR_VAL, which is defined below.
*/
#define CHK_STANDARD 1
#define CHK_DISCOVER 2
#define CHK_REMAIN 3
#define CHKPTR( errHandling, modname, pointer ) \
\
if ( (void *)(pointer) == (void *)0 ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Pointer \"#\" is null; a non-null " \
"pointer is required." ); \
errch_c ( "#", (#pointer) ); \
sigerr_c ( "SPICE(NULLPOINTER)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKPTR_VAL( errHandling, modname, pointer, retval ) \
\
if ( (void *)(pointer) == (void *)0 ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Pointer \"#\" is null; a non-null " \
"pointer is required." ); \
errch_c ( "#", (#pointer) ); \
sigerr_c ( "SPICE(NULLPOINTER)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Macro CHKFSTR checks strings that are to be passed to Fortran or
f2c'd Fortran routines. Such strings must have non-zero length,
and their pointers must be non-null.
CHKFSTR should be used in void functions. In non-void functions,
use CHKFSTR_VAL, which is defined below.
*/
#define CHKFSTR( errHandling, modname, string ) \
\
CHKPTR ( errHandling, modname, string ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( strlen(string) == 0 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length zero." ); \
errch_c ( "#", (#string) ); \
sigerr_c ( "SPICE(EMPTYSTRING)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKFSTR_VAL( errHandling, modname, string, retval ) \
\
CHKPTR_VAL( errHandling, modname, string, retval); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( strlen(string) == 0 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length zero." ); \
errch_c ( "#", (#string) ); \
sigerr_c ( "SPICE(EMPTYSTRING)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Macro CHKOSTR checks output string pointers and the associated
string length values supplied as input arguments. Output string
pointers must be non-null, and the string lengths must be at
least 2, so Fortran routine can write at least one character to
the output string, and so a null terminator can be appended.
CHKOSTR should be used in void functions. In non-void functions,
use CHKOSTR_VAL, which is defined below.
*/
#define CHKOSTR( errHandling, modname, string, length ) \
\
CHKPTR ( errHandling, modname, string ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( length < 2 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length #; must be >= 2." ); \
errch_c ( "#", (#string) ); \
errint_c ( "#", (length) ); \
sigerr_c ( "SPICE(STRINGTOOSHORT)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKOSTR_VAL( errHandling, modname, string, length, retval ) \
\
CHKPTR_VAL( errHandling, modname, string, retval ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( length < 2 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length #; must be >= 2." ); \
errch_c ( "#", (#string) ); \
errint_c ( "#", (length) ); \
sigerr_c ( "SPICE(STRINGTOOSHORT)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Definitions for Cells and Sets
*/
/*
Cell initialization macros
*/
#define CELLINIT( cellPtr ) \
\
if ( !( (cellPtr)->init ) ) \
{ \
if ( (cellPtr)->dtype == SPICE_CHR ) \
{ \
/* \
Make sure all elements of the data array, including \
the control area, start off null-terminated. We place \
the null character in the final element of each string, \
so as to avoid wiping out data that may have been \
assigned to the data array prior to initialization. \
*/ \
SpiceChar * sPtr; \
SpiceInt i; \
SpiceInt nmax; \
\
nmax = SPICE_CELL_CTRLSZ + (cellPtr)->size; \
\
for ( i = 1; i <= nmax; i++ ) \
{ \
sPtr = (SpiceChar *)((cellPtr)->base) \
+ i * (cellPtr)->length \
- 1; \
\
*sPtr = NULLCHAR; \
} \
} \
else \
{ \
zzsynccl_c ( C2F, (cellPtr) ); \
} \
\
(cellPtr)->init = SPICETRUE; \
}
#define CELLINIT2( cellPtr1, cellPtr2 ) \
\
CELLINIT ( cellPtr1 ); \
CELLINIT ( cellPtr2 );
#define CELLINIT3( cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLINIT ( cellPtr1 ); \
CELLINIT ( cellPtr2 ); \
CELLINIT ( cellPtr3 );
/*
Data type checking macros:
*/
#define CELLTYPECHK( errHandling, modname, dType, cellPtr1 ) \
\
if ( (cellPtr1)->dtype != (dType) ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; expected type " \
"is #." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", typstr[ dType ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLTYPECHK_VAL( errHandling, modname, \
dType, cellPtr1, retval ) \
\
if ( (cellPtr1)->dtype != (dType) ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; expected type " \
"is #." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", typstr[ dType ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return (retval); \
} \
}
#define CELLTYPECHK2( errHandling, modname, dtype, \
cellPtr1, cellPtr2 ) \
\
CELLTYPECHK( errHandling, modname, dtype, cellPtr1 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr2 );
#define CELLTYPECHK2_VAL( errHandling, modname, dtype, \
cellPtr1, cellPtr2, retval ) \
\
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr1, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr2, \
retval );
#define CELLTYPECHK3( errHandling, modname, dtype, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLTYPECHK( errHandling, modname, dtype, cellPtr1 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr2 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr3 );
#define CELLTYPECHK3_VAL( errHandling, modname, dtype, \
cellPtr1, cellPtr2, cellPtr3, \
retval ) \
\
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr1, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr2, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr3 \
retval );
#define CELLMATCH2( errHandling, modname, cellPtr1, cellPtr2 ) \
\
if ( (cellPtr1)->dtype != (cellPtr2)->dtype ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; data type of # " \
"is #, but types must match." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", (#cellPtr2) ); \
errch_c ( "#", typstr[ (cellPtr2)->dtype ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLMATCH2_VAL( errHandling, modname, \
cellPtr1, cellPtr2, retval ) \
\
if ( (cellPtr1)->dtype != (cellPtr2)->dtype ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; data type of # " \
"is #, but types must match." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr [ (cellPtr1)->dtype ] ); \
errch_c ( "#", (#cellPtr2) ); \
errch_c ( "#", typstr [ (cellPtr2)->dtype ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
#define CELLMATCH3( errHandling, modname, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLMATCH2 ( errHandling, modname, cellPtr1, cellPtr2 ); \
CELLMATCH2 ( errHandling, modname, cellPtr2, cellPtr3 );
#define CELLMATCH3_VAL( errHandling, modname, cellPtr1, \
cellPtr2, cellPtr3, retval ) \
\
CELLMATCH2_VAL ( errHandling, modname, \
cellPtr1, cellPtr2, retval ); \
\
CELLMATCH2_VAL ( errHandling, modname, \
cellPtr2, cellPtr3, retval );
/*
Set checking macros:
*/
#define CELLISSETCHK( errHandling, modname, cellPtr1 ) \
\
if ( !(cellPtr1)->isSet ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Cell # must be sorted and have unique " \
"values in order to be a CSPICE set. " \
"The isSet flag in this cell is SPICEFALSE, " \
"indicating the cell may have been modified " \
"by a routine that doesn't preserve these " \
"properties." ); \
errch_c ( "#", (#cellPtr1) ); \
sigerr_c ( "SPICE(NOTASET)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLISSETCHK_VAL( errHandling, modname, \
cellPtr1, retval ) \
\
if ( !(cellPtr1)->isSet ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Cell # must be sorted and have unique " \
"values in order to be a CSPICE set. " \
"The isSet flag in this cell is SPICEFALSE, " \
"indicating the cell may have been modified " \
"by a routine that doesn't preserve these " \
"properties." ); \
errch_c ( "#", (#cellPtr1) ); \
sigerr_c ( "SPICE(NOTASET)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return (retval); \
} \
}
#define CELLISSETCHK2( errHandling, modname, \
cellPtr1, cellPtr2 ) \
\
CELLISSETCHK( errHandling, modname, cellPtr1 ); \
CELLISSETCHK( errHandling, modname, cellPtr2 );
#define CELLISSETCHK2_VAL( errHandling, modname, \
cellPtr1, cellPtr2, retval ) \
\
CELLISSETCHK_VAL( errHandling, modname, cellPtr1, retval ); \
CELLISSETCHK_VAL( errHandling, modname, cellPtr2, retval ); \
#define CELLISSETCHK3( errHandling, modname, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLISSETCHK ( errHandling, modname, cellPtr1 ); \
CELLISSETCHK ( errHandling, modname, cellPtr2 ); \
CELLISSETCHK ( errHandling, modname, cellPtr3 );
#define CELLISSETCHK3_VAL( errHandling, modname, cellPtr1, \
cellPtr2, cellPtr3, retval ) \
\
CELLISSETCHK_VAL ( errHandling, modname, cellPtr1, retval ); \
CELLISSETCHK_VAL ( errHandling, modname, cellPtr2, retval ); \
CELLISSETCHK_VAL ( errHandling, modname, cellPtr3, retval );
/*
C-to-Fortran and Fortran-to-C character cell translation macros:
*/
/*
Macros that map one or more character C cells to dynamically
allocated Fortran-style character cells:
*/
#define C2F_MAP_CELL( caller, CCell, fCell, fLen ) \
\
{ \
/* \
fCell and fLen are to be passed by reference, as if this \
macro were a function. \
\
\
Caution: dynamically allocates array fCell, which is to be \
freed by caller! \
*/ \
SpiceInt ndim; \
SpiceInt lenvals; \
\
\
ndim = (CCell)->size + SPICE_CELL_CTRLSZ; \
lenvals = (CCell)->length; \
\
C2F_MapFixStrArr ( (caller), ndim, lenvals, \
(CCell)->base, (fLen), (fCell) ); \
\
if ( !failed_c() ) \
{ \
/* \
Explicitly set the control area info in the Fortran cell.\
*/ \
ssizec_ ( ( integer * ) &((CCell)->size), \
( char * ) *(fCell), \
( ftnlen ) *(fLen) ); \
\
scardc_ ( ( integer * ) &((CCell)->card), \
( char * ) *(fCell), \
( ftnlen ) *(fLen) ); \
\
if ( failed_c() ) \
{ \
/* \
Setting size or cardinality of the Fortran cell \
can fail, for example if the cell's string length \
is too short. \
*/ \
free ( *(fCell) ); \
} \
} \
}
#define C2F_MAP_CELL2( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2 ) \
\
{ \
C2F_MAP_CELL( caller, CCell1, fCell1, fLen1 ); \
\
if ( !failed_c() ) \
{ \
C2F_MAP_CELL( caller, CCell2, fCell2, fLen2 ); \
\
if ( failed_c() ) \
{ \
free ( *(fCell1) ); \
} \
} \
}
#define C2F_MAP_CELL3( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2, \
CCell3, fCell3, fLen3 ) \
\
{ \
C2F_MAP_CELL2( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2 ); \
\
if ( !failed_c() ) \
{ \
C2F_MAP_CELL( caller, CCell3, fCell3, fLen3 ); \
\
if ( failed_c() ) \
{ \
free ( *(fCell1) ); \
free ( *(fCell2) ); \
} \
} \
}
/*
Macro that maps a Fortran-style character cell to a C cell
(Note: this macro frees the Fortran cell):
*/
#define F2C_MAP_CELL( fCell, fLen, CCell ) \
\
{ \
SpiceInt card; \
SpiceInt lenvals; \
SpiceInt ndim; \
SpiceInt nBytes; \
SpiceInt size; \
void * array; \
\
ndim = (CCell)->size + SPICE_CELL_CTRLSZ; \
lenvals = (CCell)->length; \
array = (CCell)->base; \
\
/* \
Capture the size and cardinality of the Fortran cell. \
*/ \
if ( !failed_c() ) \
{ \
size = sizec_ ( ( char * ) (fCell), \
( ftnlen ) fLen ); \
\
card = cardc_ ( ( char * ) (fCell), \
( ftnlen ) fLen ); \
} \
\
\
/* \
Copy the Fortran array into the output array. \
*/ \
\
nBytes = ndim * fLen * sizeof(SpiceChar); \
memmove ( array, fCell, nBytes ); \
/* \
Convert the output array from Fortran to C style. \
*/ \
F2C_ConvertTrStrArr ( ndim, lenvals, (SpiceChar *)array ); \
\
/* \
Sync the size and cardinality of the C cell. \
*/ \
if ( !failed_c() ) \
{ \
(CCell)->size = size; \
(CCell)->card = card; \
} \
}
/*
End of header SpiceZmc.h
*/

View File

@ -0,0 +1,89 @@
/*
-Header_File SpiceZpl.h ( CSPICE platform macros )
-Abstract
Define macros identifying the host platform for which this
version of CSPICE is targeted.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Literature_References
None.
-Particulars
This header file defines macros that enable CSPICE code to be
compiled conditionally based on the identity of the host platform.
The macros defined here ARE visible in the macro name space of
any file that includes SpiceUsr.h. The names are prefixed with
the string CSPICE_ to help prevent conflicts with macros defined
by users' applications.
-Author_and_Institution
N.J. Bachman (JPL)
B.V. Semenov (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 1.3.0, 06-MAR-2005 (NJB)
Updated for SUN-SOLARIS-64BIT-GCC_C environment.
-CSPICE Version 1.2.0, 03-JAN-2005 (BVS)
Updated for PC-CYGWIN_C environment.
-CSPICE Version 1.1.0, 27-JUL-2002 (BVS)
Updated for MAC-OSX-NATIVE_C environment.
-CSPICE Version 1.0.0, 26-FEB-1999 (NJB) (EDW)
-Index_Entries
platform ID macros for CSPICE
*/
#ifndef HAVE_PLATFORM_MACROS_H
#define HAVE_PLATFORM_MACROS_H
#define CSPICE_PC_MS
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
/*
-Header_File SpiceZst.h ( Fortran/C string conversion utilities )
-Abstract
Define prototypes for CSPICE Fortran/C string conversion utilities.
Caution: these prototypes are subject to revision without notice.
These are private routines and are not part of the official CSPICE
user interface.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
None.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
K.R. Gehringer (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 6.0.0, 10-JUL-2002 (NJB)
Added prototype for new functions C2F_MapStrArr and
C2F_MapFixStrArr.
-CSPICE Version 5.0.0, 18-MAY-2001 (WLT)
Added #ifdef's to add namespace specification for C++ compilation.
-CSPICE Version 4.0.0, 14-FEB-2000 (NJB)
Added prototype for new function C2F_CreateStrArr_Sig.
-CSPICE Version 3.0.0, 12-JUL-1999 (NJB)
Added prototype for function C2F_CreateFixStrArr.
Added prototype for function F2C_ConvertTrStrArr.
Removed reference in comments to C2F_CreateStrArr_Sig, which
does not exist.
-CSPICE Version 2.0.1, 06-MAR-1998 (NJB)
Type SpiceVoid was changed to void.
-CSPICE Version 2.0.1, 09-FEB-1998 (EDW)
Added prototype for F2C_ConvertStrArr.
-CSPICE Version 2.0.0, 04-JAN-1998 (NJB)
Added prototype for F2C_ConvertStr.
-CSPICE Version 1.0.0, 25-OCT-1997 (NJB) (KRG) (EDW)
-Index_Entries
protoypes of CSPICE Fortran/C string conversion utilities
*/
#include <stdlib.h>
#include <string.h>
#include "SpiceZdf.h"
#ifndef HAVE_FCSTRINGS_H
#define HAVE_FCSTRINGS_H
#ifdef __cplusplus
namespace Jpl_NAIF_CSpice {
#endif
SpiceStatus C2F_CreateStr ( ConstSpiceChar *,
SpiceInt *,
SpiceChar ** );
void C2F_CreateStr_Sig ( ConstSpiceChar *,
SpiceInt *,
SpiceChar ** );
void C2F_CreateFixStrArr ( SpiceInt nStr,
SpiceInt cStrDim,
ConstSpiceChar ** cStrArr,
SpiceInt * fStrLen,
SpiceChar ** fStrArr );
SpiceStatus C2F_CreateStrArr ( SpiceInt,
ConstSpiceChar **,
SpiceInt *,
SpiceChar ** );
void C2F_CreateStrArr_Sig ( SpiceInt nStr,
ConstSpiceChar ** cStrArr,
SpiceInt * fStrLen,
SpiceChar ** fStrArr );
void C2F_MapFixStrArr ( ConstSpiceChar * caller,
SpiceInt nStr,
SpiceInt cStrLen,
const void * cStrArr,
SpiceInt * fStrLen,
SpiceChar ** fStrArr );
void C2F_MapStrArr ( ConstSpiceChar * caller,
SpiceInt nStr,
SpiceInt cStrLen,
const void * cStrArr,
SpiceInt * fStrLen,
SpiceChar ** fStrArr );
SpiceStatus C2F_StrCpy ( ConstSpiceChar *,
SpiceInt,
SpiceChar * );
void F_Alloc ( SpiceInt,
SpiceChar** );
void F2C_ConvertStr ( SpiceInt,
SpiceChar * );
void F2C_ConvertStrArr ( SpiceInt n,
SpiceInt lenout,
SpiceChar * cvals );
void F2C_ConvertTrStrArr ( SpiceInt n,
SpiceInt lenout,
SpiceChar * cvals );
SpiceStatus F2C_CreateStr ( SpiceInt,
ConstSpiceChar *,
SpiceChar ** );
void F2C_CreateStr_Sig ( SpiceInt,
ConstSpiceChar *,
SpiceChar ** );
SpiceStatus F2C_CreateStrArr ( SpiceInt,
SpiceInt,
ConstSpiceChar *,
SpiceChar *** );
void F2C_CreateStrArr_Sig ( SpiceInt,
SpiceInt,
ConstSpiceChar *,
SpiceChar *** );
void F2C_FreeStrArr ( SpiceChar **cStrArr );
SpiceStatus F2C_StrCpy ( SpiceInt,
ConstSpiceChar *,
SpiceInt,
SpiceChar * );
SpiceInt F_StrLen ( SpiceInt,
ConstSpiceChar * );
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,638 @@
/*
-Header_File f2c.h ( CSPICE version of the f2c standard header file )
-Abstract
Perform standard f2c declarations, customized for the host
environment.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
The standard f2c header file f2c.h must be included by every function
generated by running f2c on Fortran source code. The header f2c.h
includes typedefs used to provide a level of indirection in mapping
Fortran data types to native C data types. For example, Fortran
INTEGER variables are mapped to variables of type integer, where
integer is a C typedef. In the standard f2c.h header, the typedef
integer tranlates to the C type long.
Because the standard version of f2c.h does not work on all platforms,
this header file contains two platform-dependent versions of it,
meant to be selected at build time via precompiler switches. The
precompiler switches reference macros defined in SpiceZpl.h to
determine for which host platform the code is targeted. The first
version of f2c.h, which works on most platforms, is copied directly
from the standard version of f2c.h. The second version is intended
for use on the DEC Alpha running Digital Unix and the Sun/Solaris
platform using 64 bit mode and running gcc. On those systems, longs
occupy 8 bytes, as do doubles. Because the Fortran standard requires
that INTEGERS occupy half the storage of DOUBLE PRECISION numbers,
INTEGERS should be mapped to 4-byte ints rather than 8-byte longs
on the platforms having 8-byte longs. In order to achieve this, the
header f2c.h was transformed using the sed command
sed 's/long //' f2c.h
The high-level structure of this file is then:
# if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) )
[ Alpha/Digital Unix and Sun Solaris 64 bit mode/gcc
version of f2c.h source code ]
# else
[ Standard version of f2c.h source code ]
# endif
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
1) This header file must be updated whenever the f2c processor
or the f2c libraries libI77 and libF77 are updated.
2) This header may need to be updated to support new platforms.
The supported platforms at the time of the 31-JAN-1999 release
are:
ALPHA-DIGITAL-UNIX
HP
NEXT
PC-LINUX
PC-MS
SGI-IRIX-N32
SGI-IRIX-NO2
SUN-SOLARIS
-Version
-CSPICE Version 1.2.0, 27-JAN-2003 (NJB)
Updated to support the Sun Solaris 64 bit mode/gcc platform.
-CSPICE Version 2.0.0, 19-DEC-2001 (NJB)
Updated to support linking CSPICE into executables that
also link in objects compiled from Fortran, in particular
ones that perform Fortran I/O. To enable this odd mix,
one defines the preprocessor flag
MIX_C_AND_FORTRAN
This macro is undefined by default, since the action it invokes
is usually not desirable. See the header
f2cMang.h
for further information.
-CSPICE Version 1.0.0, 07-FEB-1999 (NJB)
*/
/*
Optionally include name-mangling macros for f2c external symbols.
*/
#ifdef MIX_C_AND_FORTRAN
#include "f2cMang.h"
#endif
/*
Include CSPICE platform macro definitions.
*/
#include "SpiceZpl.h"
# if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) )
/*
The following code is intended to be used on the Alpha/Digital Unix
platform, where a long is the size of a double and an int is half the
size of a double.
Note that the comment line below indicating that the header is
"Standard" has been retained from the original, but is no longer
true.
*/
/* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
typedef int integer;
typedef unsigned uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
typedef int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#if 0 /* Adjust for integer*8. */
typedef long longint; /* system-dependent */
typedef unsigned long ulongint; /* system-dependent */
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
#endif
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
#ifdef f2c_i2
/* for -i2 */
typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
typedef int flag;
typedef int ftnlen;
typedef int ftnint;
#endif
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
/*typedef int Long;*/ /* No longer used; formerly in Namelist */
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x)
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (doublereal)min(a,b)
#define dmax(a,b) (doublereal)max(a,b)
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef int /* Unknown procedure type */ (*U_fp)(...);
typedef shortint (*J_fp)(...);
typedef integer (*I_fp)(...);
typedef real (*R_fp)(...);
typedef doublereal (*D_fp)(...), (*E_fp)(...);
typedef /* Complex */ VOID (*C_fp)(...);
typedef /* Double Complex */ VOID (*Z_fp)(...);
typedef logical (*L_fp)(...);
typedef shortlogical (*K_fp)(...);
typedef /* Character */ VOID (*H_fp)(...);
typedef /* Subroutine */ int (*S_fp)(...);
#else
typedef int /* Unknown procedure type */ (*U_fp)();
typedef shortint (*J_fp)();
typedef integer (*I_fp)();
typedef real (*R_fp)();
typedef doublereal (*D_fp)(), (*E_fp)();
typedef /* Complex */ VOID (*C_fp)();
typedef /* Double Complex */ VOID (*Z_fp)();
typedef logical (*L_fp)();
typedef shortlogical (*K_fp)();
typedef /* Character */ VOID (*H_fp)();
typedef /* Subroutine */ int (*S_fp)();
#endif
/* E_fp is for real functions when -R is not specified */
typedef VOID C_f; /* complex function */
typedef VOID H_f; /* character function */
typedef VOID Z_f; /* double complex function */
typedef doublereal E_f; /* real function with -R not specified */
/* undef any lower-case symbols that your C compiler predefines, e.g.: */
#ifndef Skip_f2c_Undefs
#undef cray
#undef gcos
#undef mc68010
#undef mc68020
#undef mips
#undef pdp11
#undef sgi
#undef sparc
#undef sun
#undef sun2
#undef sun3
#undef sun4
#undef u370
#undef u3b
#undef u3b2
#undef u3b5
#undef unix
#undef vax
#endif
#endif
/*
This marks the end of the Alpha/Digital Unix version of f2c.h.
*/
#else
/*
The following code is the standard f2c.h header. In this
header, an "integer" is defined to be of type long.
Because the code is copied verbatim, it does not follow the usual
CSPICE indentation pattern.
*/
/* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
typedef long int integer;
typedef unsigned long uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
typedef long int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#if 0 /* Adjust for integer*8. */
typedef long long longint; /* system-dependent */
typedef unsigned long long ulongint; /* system-dependent */
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
#endif
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
#ifdef f2c_i2
/* for -i2 */
typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
typedef long int flag;
typedef long int ftnlen;
typedef long int ftnint;
#endif
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x)
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (doublereal)min(a,b)
#define dmax(a,b) (doublereal)max(a,b)
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef int /* Unknown procedure type */ (*U_fp)(...);
typedef shortint (*J_fp)(...);
typedef integer (*I_fp)(...);
typedef real (*R_fp)(...);
typedef doublereal (*D_fp)(...), (*E_fp)(...);
typedef /* Complex */ VOID (*C_fp)(...);
typedef /* Double Complex */ VOID (*Z_fp)(...);
typedef logical (*L_fp)(...);
typedef shortlogical (*K_fp)(...);
typedef /* Character */ VOID (*H_fp)(...);
typedef /* Subroutine */ int (*S_fp)(...);
#else
typedef int /* Unknown procedure type */ (*U_fp)();
typedef shortint (*J_fp)();
typedef integer (*I_fp)();
typedef real (*R_fp)();
typedef doublereal (*D_fp)(), (*E_fp)();
typedef /* Complex */ VOID (*C_fp)();
typedef /* Double Complex */ VOID (*Z_fp)();
typedef logical (*L_fp)();
typedef shortlogical (*K_fp)();
typedef /* Character */ VOID (*H_fp)();
typedef /* Subroutine */ int (*S_fp)();
#endif
/* E_fp is for real functions when -R is not specified */
typedef VOID C_f; /* complex function */
typedef VOID H_f; /* character function */
typedef VOID Z_f; /* double complex function */
typedef doublereal E_f; /* real function with -R not specified */
/* undef any lower-case symbols that your C compiler predefines, e.g.: */
#ifndef Skip_f2c_Undefs
#undef cray
#undef gcos
#undef mc68010
#undef mc68020
#undef mips
#undef pdp11
#undef sgi
#undef sparc
#undef sun
#undef sun2
#undef sun3
#undef sun4
#undef u370
#undef u3b
#undef u3b2
#undef u3b5
#undef unix
#undef vax
#endif
#endif
#endif

View File

@ -0,0 +1,385 @@
/*
-Header_File f2cMang.h ( f2c external symbol mangling )
-Abstract
Define macros that mangle the external symbols in the f2c F77 and I77
libraries.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header supports linking CSPICE into executables that
also link in objects compiled from Fortran, in particular
ones that perform Fortran I/O. To enable this odd mix,
one defines the preprocessor flag
MIX_C_AND_FORTRAN
This macro is undefined by default, since the action it invokes
is usually not desirable. When the flag is defined, this header
defines macros that mangle the f2c library external symbols:
the symbol
xxx
gets mapped to
xxx_f2c
This mangling prevents name collisions between the f2c
implementations of the F77 and I77 library routines and those
in the corresponding Fortran libraries on a host system.
The set of external symbols defined in the f2c libraries can
be determined by combining objects from both F77 and I77 into
a single Unix archive libarary, then running the Unix utility
nm on the that archive. If available, an nm option that selects
only external symbols should be invoked.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
1) It is recommended that use of the features implemented by this
header be avoided if at all possible. There are robustness and
portability problems associated with linking Fortran and C objects
together in one executable.
2) When f2c external symbol name mangling is invoked, objects
derived from C code translated from Fortran by f2c won't
link against CSPICE any longer, if these objects reference
the standard f2c external symbols.
3) The features implemented by this header have been tested only
under the Sun Solaris GCC and Sun Solaris native ANSI C
environments.
-Version
-CSPICE Version 2.0.0, 19-DEC-2001 (NJB)
*/
/*
Define masking macros for f2c external symbols.
*/
#ifdef MIX_C_AND_FORTRAN
/*
Define the macros only once, if they need to be defined.
*/
#ifndef F2C_MANGLING_DONE
#define F77_aloc F77_aloc_f2c
#define F_err F_err_f2c
#define L_len L_len_f2c
#define abort_ abort__f2c
#define b_char b_char_f2c
#define c_abs c_abs_f2c
#define c_cos c_cos_f2c
#define c_dfe c_dfe_f2c
#define c_div c_div_f2c
#define c_due c_due_f2c
#define c_exp c_exp_f2c
#define c_le c_le_f2c
#define c_log c_log_f2c
#define c_sfe c_sfe_f2c
#define c_si c_si_f2c
#define c_sin c_sin_f2c
#define c_sqrt c_sqrt_f2c
#define c_sue c_sue_f2c
#define d_abs d_abs_f2c
#define d_acos d_acos_f2c
#define d_asin d_asin_f2c
#define d_atan d_atan_f2c
#define d_atn2 d_atn2_f2c
#define d_cnjg d_cnjg_f2c
#define d_cos d_cos_f2c
#define d_cosh d_cosh_f2c
#define d_dim d_dim_f2c
#define d_exp d_exp_f2c
#define d_imag d_imag_f2c
#define d_int d_int_f2c
#define d_lg10 d_lg10_f2c
#define d_log d_log_f2c
#define d_mod d_mod_f2c
#define d_nint d_nint_f2c
#define d_prod d_prod_f2c
#define d_sign d_sign_f2c
#define d_sin d_sin_f2c
#define d_sinh d_sinh_f2c
#define d_sqrt d_sqrt_f2c
#define d_tan d_tan_f2c
#define d_tanh d_tanh_f2c
#define derf_ derf__f2c
#define derfc_ derfc__f2c
#define do_fio do_fio_f2c
#define do_lio do_lio_f2c
#define do_ud do_ud_f2c
#define do_uio do_uio_f2c
#define do_us do_us_f2c
#define dtime_ dtime__f2c
#define e_rdfe e_rdfe_f2c
#define e_rdue e_rdue_f2c
#define e_rsfe e_rsfe_f2c
#define e_rsfi e_rsfi_f2c
#define e_rsle e_rsle_f2c
#define e_rsli e_rsli_f2c
#define e_rsue e_rsue_f2c
#define e_wdfe e_wdfe_f2c
#define e_wdue e_wdue_f2c
#define e_wsfe e_wsfe_f2c
#define e_wsfi e_wsfi_f2c
#define e_wsle e_wsle_f2c
#define e_wsli e_wsli_f2c
#define e_wsue e_wsue_f2c
#define ef1asc_ ef1asc__f2c
#define ef1cmc_ ef1cmc__f2c
#define en_fio en_fio_f2c
#define erf_ erf__f2c
#define erfc_ erfc__f2c
#define err__fl err__fl_f2c
#define etime_ etime__f2c
#define exit_ exit__f2c
#define f__Aquote f__Aquote_f2c
#define f__buflen f__buflen_f2c
#define f__cabs f__cabs_f2c
#define f__canseek f__canseek_f2c
#define f__cblank f__cblank_f2c
#define f__cf f__cf_f2c
#define f__cnt f__cnt_f2c
#define f__cp f__cp_f2c
#define f__cplus f__cplus_f2c
#define f__cursor f__cursor_f2c
#define f__curunit f__curunit_f2c
#define f__doed f__doed_f2c
#define f__doend f__doend_f2c
#define f__doned f__doned_f2c
#define f__donewrec f__donewrec_f2c
#define f__dorevert f__dorevert_f2c
#define f__elist f__elist_f2c
#define f__external f__external_f2c
#define f__fatal f__fatal_f2c
#define f__fmtbuf f__fmtbuf_f2c
#define f__formatted f__formatted_f2c
#define f__getn f__getn_f2c
#define f__hiwater f__hiwater_f2c
#define f__icend f__icend_f2c
#define f__icnum f__icnum_f2c
#define f__icptr f__icptr_f2c
#define f__icvt f__icvt_f2c
#define f__init f__init_f2c
#define f__inode f__inode_f2c
#define f__lchar f__lchar_f2c
#define f__lcount f__lcount_f2c
#define f__lioproc f__lioproc_f2c
#define f__lquit f__lquit_f2c
#define f__ltab f__ltab_f2c
#define f__ltype f__ltype_f2c
#define f__lx f__lx_f2c
#define f__ly f__ly_f2c
#define f__nonl f__nonl_f2c
#define f__nowreading f__nowreading_f2c
#define f__nowwriting f__nowwriting_f2c
#define f__parenlvl f__parenlvl_f2c
#define f__pc f__pc_f2c
#define f__putbuf f__putbuf_f2c
#define f__putn f__putn_f2c
#define f__r_mode f__r_mode_f2c
#define f__reading f__reading_f2c
#define f__reclen f__reclen_f2c
#define f__recloc f__recloc_f2c
#define f__recpos f__recpos_f2c
#define f__ret f__ret_f2c
#define f__revloc f__revloc_f2c
#define f__rp f__rp_f2c
#define f__scale f__scale_f2c
#define f__sequential f__sequential_f2c
#define f__svic f__svic_f2c
#define f__typesize f__typesize_f2c
#define f__units f__units_f2c
#define f__w_mode f__w_mode_f2c
#define f__workdone f__workdone_f2c
#define f_back f_back_f2c
#define f_clos f_clos_f2c
#define f_end f_end_f2c
#define f_exit f_exit_f2c
#define f_init f_init_f2c
#define f_inqu f_inqu_f2c
#define f_open f_open_f2c
#define f_rew f_rew_f2c
#define fk_open fk_open_f2c
#define flush_ flush__f2c
#define fmt_bg fmt_bg_f2c
#define fseek_ fseek__f2c
#define ftell_ ftell__f2c
#define g_char g_char_f2c
#define getenv_ getenv__f2c
#define h_abs h_abs_f2c
#define h_dim h_dim_f2c
#define h_dnnt h_dnnt_f2c
#define h_indx h_indx_f2c
#define h_len h_len_f2c
#define h_mod h_mod_f2c
#define h_nint h_nint_f2c
#define h_sign h_sign_f2c
#define hl_ge hl_ge_f2c
#define hl_gt hl_gt_f2c
#define hl_le hl_le_f2c
#define hl_lt hl_lt_f2c
#define i_abs i_abs_f2c
#define i_dim i_dim_f2c
#define i_dnnt i_dnnt_f2c
#define i_indx i_indx_f2c
#define i_len i_len_f2c
#define i_mod i_mod_f2c
#define i_nint i_nint_f2c
#define i_sign i_sign_f2c
#define iw_rev iw_rev_f2c
#define l_eof l_eof_f2c
#define l_ge l_ge_f2c
#define l_getc l_getc_f2c
#define l_gt l_gt_f2c
#define l_le l_le_f2c
#define l_lt l_lt_f2c
#define l_read l_read_f2c
#define l_ungetc l_ungetc_f2c
#define l_write l_write_f2c
#define lbit_bits lbit_bits_f2c
#define lbit_cshift lbit_cshift_f2c
#define lbit_shift lbit_shift_f2c
#define mk_hashtab mk_hashtab_f2c
#define nml_read nml_read_f2c
#define pars_f pars_f_f2c
#define pow_ci pow_ci_f2c
#define pow_dd pow_dd_f2c
#define pow_di pow_di_f2c
#define pow_hh pow_hh_f2c
#define pow_ii pow_ii_f2c
#define pow_ri pow_ri_f2c
#define pow_zi pow_zi_f2c
#define pow_zz pow_zz_f2c
#define r_abs r_abs_f2c
#define r_acos r_acos_f2c
#define r_asin r_asin_f2c
#define r_atan r_atan_f2c
#define r_atn2 r_atn2_f2c
#define r_cnjg r_cnjg_f2c
#define r_cos r_cos_f2c
#define r_cosh r_cosh_f2c
#define r_dim r_dim_f2c
#define r_exp r_exp_f2c
#define r_imag r_imag_f2c
#define r_int r_int_f2c
#define r_lg10 r_lg10_f2c
#define r_log r_log_f2c
#define r_mod r_mod_f2c
#define r_nint r_nint_f2c
#define r_sign r_sign_f2c
#define r_sin r_sin_f2c
#define r_sinh r_sinh_f2c
#define r_sqrt r_sqrt_f2c
#define r_tan r_tan_f2c
#define r_tanh r_tanh_f2c
#define rd_ed rd_ed_f2c
#define rd_ned rd_ned_f2c
#define s_cat s_cat_f2c
#define s_cmp s_cmp_f2c
#define s_copy s_copy_f2c
#define s_paus s_paus_f2c
#define s_rdfe s_rdfe_f2c
#define s_rdue s_rdue_f2c
#define s_rnge s_rnge_f2c
#define s_rsfe s_rsfe_f2c
#define s_rsfi s_rsfi_f2c
#define s_rsle s_rsle_f2c
#define s_rsli s_rsli_f2c
#define s_rsne s_rsne_f2c
#define s_rsni s_rsni_f2c
#define s_rsue s_rsue_f2c
#define s_stop s_stop_f2c
#define s_wdfe s_wdfe_f2c
#define s_wdue s_wdue_f2c
#define s_wsfe s_wsfe_f2c
#define s_wsfi s_wsfi_f2c
#define s_wsle s_wsle_f2c
#define s_wsli s_wsli_f2c
#define s_wsne s_wsne_f2c
#define s_wsni s_wsni_f2c
#define s_wsue s_wsue_f2c
#define sig_die sig_die_f2c
#define signal_ signal__f2c
#define system_ system__f2c
#define t_getc t_getc_f2c
#define t_runc t_runc_f2c
#define w_ed w_ed_f2c
#define w_ned w_ned_f2c
#define wrt_E wrt_E_f2c
#define wrt_F wrt_F_f2c
#define wrt_L wrt_L_f2c
#define x_endp x_endp_f2c
#define x_getc x_getc_f2c
#define x_putc x_putc_f2c
#define x_rev x_rev_f2c
#define x_rsne x_rsne_f2c
#define x_wSL x_wSL_f2c
#define x_wsne x_wsne_f2c
#define xrd_SL xrd_SL_f2c
#define y_getc y_getc_f2c
#define y_rsk y_rsk_f2c
#define z_abs z_abs_f2c
#define z_cos z_cos_f2c
#define z_div z_div_f2c
#define z_exp z_exp_f2c
#define z_getc z_getc_f2c
#define z_log z_log_f2c
#define z_putc z_putc_f2c
#define z_rnew z_rnew_f2c
#define z_sin z_sin_f2c
#define z_sqrt z_sqrt_f2c
#define z_wnew z_wnew_f2c
#define F2C_MANGLING_DONE
#endif
#endif

View File

@ -0,0 +1,107 @@
#include "stdio.h"
#include "errno.h"
#ifndef NULL
/* ANSI C */
#include "stddef.h"
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#ifdef MSDOS
#ifndef NON_UNIX_STDIO
#define NON_UNIX_STDIO
#endif
#endif
#ifdef UIOLEN_int
typedef int uiolen;
#else
typedef long uiolen;
#endif
/*units*/
typedef struct
{ FILE *ufd; /*0=unconnected*/
char *ufnm;
#ifndef MSDOS
long uinode;
int udev;
#endif
int url; /*0=sequential*/
flag useek; /*true=can backspace, use dir, ...*/
flag ufmt;
flag urw; /* (1 for can read) | (2 for can write) */
flag ublnk;
flag uend;
flag uwrt; /*last io was write*/
flag uscrtch;
} unit;
extern flag f__init;
extern cilist *f__elist; /*active external io list*/
extern flag f__reading,f__external,f__sequential,f__formatted;
#undef Void
#ifdef KR_headers
#define Void /*void*/
extern int (*f__getn)(); /* for formatted input */
extern void (*f__putn)(); /* for formatted output */
extern void x_putc();
extern long f__inode();
extern VOID sig_die();
extern int (*f__donewrec)(), t_putc(), x_wSL();
extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf();
#else
#define Void void
#ifdef __cplusplus
extern "C" {
#endif
extern int (*f__getn)(void); /* for formatted input */
extern void (*f__putn)(int); /* for formatted output */
extern void x_putc(int);
extern long f__inode(char*,int*);
extern void sig_die(char*,int);
extern void f__fatal(int,char*);
extern int t_runc(alist*);
extern int f__nowreading(unit*), f__nowwriting(unit*);
extern int fk_open(int,int,ftnint);
extern int en_fio(void);
extern void f_init(void);
extern int (*f__donewrec)(void), t_putc(int), x_wSL(void);
extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*);
extern int c_sfe(cilist*), z_rnew(void);
extern int isatty(int);
extern int err__fl(int,int,char*);
extern int xrd_SL(void);
extern int f__putbuf(int);
#ifdef __cplusplus
}
#endif
#endif
extern int (*f__doend)(Void);
extern FILE *f__cf; /*current file*/
extern unit *f__curunit; /*current unit*/
extern unit f__units[];
#define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);}
#define errfl(f,m,s) return err__fl((int)f,m,s)
/*Table sizes*/
#define MXUNIT 100
extern int f__recpos; /*position in current record*/
extern int f__cursor; /* offset to move to */
extern int f__hiwater; /* so TL doesn't confuse us */
#define WRITE 1
#define READ 2
#define SEQ 3
#define DIR 4
#define FMT 5
#define UNF 6
#define EXT 7
#define INT 8
#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)

View File

@ -0,0 +1,100 @@
struct syl
{ int op;
int p1;
union { int i[2]; char *s;} p2;
};
#define RET1 1
#define REVERT 2
#define GOTO 3
#define X 4
#define SLASH 5
#define STACK 6
#define I 7
#define ED 8
#define NED 9
#define IM 10
#define APOS 11
#define H 12
#define TL 13
#define TR 14
#define T 15
#define COLON 16
#define S 17
#define SP 18
#define SS 19
#define P 20
#define BN 21
#define BZ 22
#define F 23
#define E 24
#define EE 25
#define D 26
#define G 27
#define GE 28
#define L 29
#define A 30
#define AW 31
#define O 32
#define NONL 33
#define OM 34
#define Z 35
#define ZM 36
extern int f__pc,f__parenlvl,f__revloc;
typedef union
{ real pf;
doublereal pd;
} ufloat;
typedef union
{ short is;
#ifndef KR_headers
signed
#endif
char ic;
integer il;
#ifdef Allow_TYQUAD
longint ili;
#endif
} Uint;
#ifdef KR_headers
extern int (*f__doed)(),(*f__doned)();
extern int (*f__dorevert)();
extern int rd_ed(),rd_ned();
extern int w_ed(),w_ned();
#else
#ifdef __cplusplus
extern "C" {
#endif
extern int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
extern int (*f__dorevert)(void);
extern void fmt_bg(void);
extern int pars_f(char*);
extern int rd_ed(struct syl*, char*, ftnlen),rd_ned(struct syl*);
extern int w_ed(struct syl*, char*, ftnlen),w_ned(struct syl*);
extern int wrt_E(ufloat*, int, int, int, ftnlen);
extern int wrt_F(ufloat*, int, int, ftnlen);
extern int wrt_L(Uint*, int, ftnlen);
#ifdef __cplusplus
}
#endif
#endif
extern flag f__cblank,f__cplus,f__workdone, f__nonl;
extern char *f__fmtbuf;
extern int f__scale;
#define GET(x) if((x=(*f__getn)())<0) return(x)
#define VAL(x) (x!='\n'?x:' ')
#define PUT(x) (*f__putn)(x)
extern int f__cursor;
#undef TYQUAD
#ifndef Allow_TYQUAD
#undef longint
#define longint long
#else
#define TYQUAD 14
#endif
#ifdef KR_headers
extern char *f__icvt();
#else
extern char *f__icvt(longint, int*, int*, int);
#endif

View File

@ -0,0 +1,28 @@
#define FMAX 40
#define EXPMAXDIGS 8
#define EXPMAX 99999999
/* FMAX = max number of nonzero digits passed to atof() */
/* EXPMAX = 10^EXPMAXDIGS - 1 = largest allowed exponent absolute value */
#ifdef V10 /* Research Tenth-Edition Unix */
#include "local.h"
#endif
/* MAXFRACDIGS and MAXINTDIGS are for wrt_F -- bounds (not necessarily
tight) on the maximum number of digits to the right and left of
* the decimal point.
*/
#ifdef VAX
#define MAXFRACDIGS 56
#define MAXINTDIGS 38
#else
#ifdef CRAY
#define MAXFRACDIGS 9880
#define MAXINTDIGS 9864
#else
/* values that suffice for IEEE double */
#define MAXFRACDIGS 344
#define MAXINTDIGS 308
#endif
#endif

View File

@ -0,0 +1,74 @@
/* copy of ftypes from the compiler */
/* variable types
* numeric assumptions:
* int < reals < complexes
* TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX
*/
/* 0-10 retain their old (pre LOGICAL*1, etc.) */
/* values to allow mixing old and new objects. */
#define TYUNKNOWN 0
#define TYADDR 1
#define TYSHORT 2
#define TYLONG 3
#define TYREAL 4
#define TYDREAL 5
#define TYCOMPLEX 6
#define TYDCOMPLEX 7
#define TYLOGICAL 8
#define TYCHAR 9
#define TYSUBR 10
#define TYINT1 11
#define TYLOGICAL1 12
#define TYLOGICAL2 13
#ifdef Allow_TYQUAD
#undef TYQUAD
#define TYQUAD 14
#endif
#define LINTW 24
#define LINE 80
#define LLOGW 2
#ifdef Old_list_output
#define LLOW 1.0
#define LHIGH 1.e9
#define LEFMT " %# .8E"
#define LFFMT " %# .9g"
#else
#define LGFMT "%.9G"
#endif
/* LEFBL 20 should suffice; 24 overcomes a NeXT bug. */
#define LEFBL 24
typedef union
{
char flchar;
short flshort;
ftnint flint;
#ifdef Allow_TYQUAD
longint fllongint;
#endif
real flreal;
doublereal fldouble;
} flex;
extern int f__scale;
#ifdef KR_headers
extern int (*f__lioproc)(), (*l_getc)(), (*l_ungetc)();
extern int l_read(), l_write();
#else
#ifdef __cplusplus
extern "C" {
#endif
extern int (*f__lioproc)(ftnint*, char*, ftnlen, ftnint);
extern int l_write(ftnint*, char*, ftnlen, ftnint);
extern void x_wsne(cilist*);
extern int c_le(cilist*), (*l_getc)(void), (*l_ungetc)(int,FILE*);
extern int l_read(ftnint*,char*,ftnlen,ftnint);
extern integer e_rsle(void), e_wsle(void), s_wsne(cilist*);
extern int z_rnew(void);
#ifdef __cplusplus
}
#endif
#endif
extern ftnint L_len;

View File

@ -0,0 +1,41 @@
#ifndef KR_headers
#ifdef MSDOS
#include "io.h"
#ifndef WATCOM
#define close _close
#define creat _creat
#define open _open
#define read _read
#define write _write
#endif /*WATCOM*/
#endif /*MSDOS*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MSDOS
#ifdef OPEN_DECL
extern int creat(const char*,int), open(const char*,int);
#endif
extern int close(int);
extern int read(int,void*,size_t), write(int,void*,size_t);
extern int unlink(const char*);
#ifndef _POSIX_SOURCE
#ifndef NON_UNIX_STDIO
extern FILE *fdopen(int, const char*);
#endif
#endif
#endif /*KR_HEADERS*/
extern char *mktemp(char*);
#ifdef __cplusplus
}
#endif
#endif
#include "fcntl.h"
#ifndef O_WRONLY
#define O_RDONLY 0
#define O_WRONLY 1
#endif

View File

@ -0,0 +1,118 @@
/*
-Header_File signal1.h (CSPICE version of the f2c signal1.h header file)
-Abstract
Define macros associated with signal handling, customized for the
host environment.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines the macro signal1 referenced in main.c,
which is a generic main routine used in CSPICE executables that
link to code generated by f2c.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
-Restrictions
1) This header file must be updated whenever the f2c processor
or the f2c libraries libI77 and libF77 are updated.
2) This header may need to be updated to support new platforms.
The supported platforms at the time of the 03-FEB-2000 release
are:
ALPHA-DIGITAL-UNIX_C
HP_C
NEXT_C
PC-LINUX_C
PC-MS_C
SGI-IRIX-N32_C
SGI-IRIX-NO2_C
SUN-SOLARIS-GCC_C
SUN-SOLARIS-NATIVE_C
-Version
-CSPICE Version 1.0.0, 03-FEB-2000 (NJB)
*/
/* You may need to adjust the definition of signal1 to supply a */
/* cast to the correct argument type. This detail is system- and */
/* compiler-dependent. The #define below assumes signal.h declares */
/* type SIG_PF for the signal function's second argument. */
#include <signal.h>
#ifndef Sigret_t
#define Sigret_t void
#endif
#ifndef Sigarg_t
#ifdef KR_headers
#define Sigarg_t
#else
#ifdef __cplusplus
#define Sigarg_t ...
#else
#define Sigarg_t int
#endif
#endif
#endif /*Sigarg_t*/
#ifdef USE_SIG_PF /* compile with -DUSE_SIG_PF under IRIX */
#define sig_pf SIG_PF
#else
typedef Sigret_t (*sig_pf)(Sigarg_t);
#endif
#define signal1(a,b) signal(a,(sig_pf)b)
#ifdef __cplusplus
#define Sigarg ...
#define Use_Sigarg
#else
#define Sigarg Int n
#define Use_Sigarg n = n /* shut up compiler warning */
#endif

View File

@ -0,0 +1,113 @@
/*
-Abstract
The memory allocation prototypes and macros for use in CSPICE.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Particulars
The routines maintain a count of the number of mallocs vs. free,
signalling an error if any unreleased memory exists at the end
of an Icy interface call.
The macro ALLOC_CHECK performs malloc/free test. If used, the macro
should exists at the end of any routine using these memory management
routines.
Prototypes in this file:
alloc_count
alloc_SpiceMemory
alloc_SpiceString_C_array
alloc_SpiceString_C_Copy_array
alloc_SpiceDouble_C_array
alloc_SpiceInt_C_array
alloc_SpiceString
alloc_SpiceString_Pointer_array
free_SpiceString_C_array
free_SpiceMemory
-Version
CSPICE 1.0.1 23-JUN-2005 (EDW)
Add prototype for alloc_SpiceString_Pointer_array, allocate
an array of pointers to SpiceChar.
Icy 1.0.0 December 19, 2003 (EDW)
Initial release.
*/
#ifndef ZZALLOC_H
#define ZZALLOC_H
/* Allocation call prototypes: */
int alloc_count ( SpiceChar* op );
SpiceChar ** alloc_SpiceString_C_array ( int string_length,
int string_count );
SpiceChar ** alloc_SpiceString_C_Copy_array ( int array_len ,
int string_len,
SpiceChar ** array );
SpiceDouble * alloc_SpiceDouble_C_array ( int rows,
int cols );
SpiceInt * alloc_SpiceInt_C_array ( int rows,
int cols );
SpiceChar * alloc_SpiceString ( int length );
SpiceChar ** alloc_SpiceString_Pointer_array( int array_len );
void free_SpiceString_C_array ( int dim,
SpiceChar ** array );
void * alloc_SpiceMemory ( unsigned size );
void free_SpiceMemory ( void * ptr );
/*
Simple macro to ensure a zero value alloc count at end of routine.
Note, the need to use this macro exists only in those routines
allocating/deallocating memory.
*/
#define ALLOC_CHECK if ( alloc_count( "=" ) != 0 ) \
{ \
setmsg_c ( "Malloc/Free count not zero at end of routine." \
" Malloc count = #."); \
errint_c ( "#", alloc_count ( "=" ) ); \
sigerr_c ( "SPICE(MALLOCCOUNT)" ); \
}
#endif

View File

@ -0,0 +1,80 @@
/*
-Abstract
The error control routine prototypes for use in CSPICE.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Particulars
Routines prototyped in this file:
zzerrorinit
zzerror
-Examples
See the examples section in zzerror() and zzerrorinit().
-Restrictions
None.
-Exceptions
None.
-Files
None.
-Author_and_Institution
E. D. Wright (JPL)
-Literature_References
None.
-Version
CSPICE 1.0.0 17-OCT-2005 (EDW)
Initial release.
*/
#ifndef ZZERROR_H
#define ZZERROR_H
const char * zzerror( long cnt );
void zzerrorinit();
#endif