20typedef void (*spPrintFunc)(
const char *message);
40typedef unsigned long spPaperOrientation;
41#define SP_PAPER_ORIENTATION_HORIZONTAL_MASK (1L<<4)
42#define SP_PAPER_ORIENTATION_REVERSE_MASK (1L<<5)
43#define SP_PAPER_ORIENTATION_UNKNOWN_MASK (1L<<6)
44#define SP_PAPER_ORIENTATION_PORTRAIT (0L)
45#define SP_PAPER_ORIENTATION_LANDSCAPE SP_PAPER_ORIENTATION_HORIZONTAL_MASK
46#define SP_PAPER_ORIENTATION_SEASCAPE (SP_PAPER_ORIENTATION_HORIZONTAL_MASK|SP_PAPER_ORIENTATION_REVERSE_MASK)
47#define SP_PAPER_ORIENTATION_UPSIDE_DOWN SP_PAPER_ORIENTATION_REVERSE_MASK
48#define SP_PAPER_ORIENTATION_UNKNOWN SP_PAPER_ORIENTATION_UNKNOWN_MASK
50#define spIsPaperOrientationHorizontal(orient) (((orient) & SP_PAPER_ORIENTATION_HORIZONTAL_MASK) ? SP_TRUE : SP_FALSE)
53#define SP_PAPER_SIZE_STRING_UNIT_BOTH (1L<<0)
54#define SP_PAPER_SIZE_STRING_UNIT_SYMBOL (1L<<1)
55#define SP_PAPER_SIZE_STRING_NO_UNIT (1L<<2)
56#define SP_PAPER_SIZE_STRING_NO_SPACE (1L<<3)
57#define SP_PAPER_SIZE_STRING_INCLUDE_SIZE (1L<<6)
58#define SP_PAPER_SIZE_STRING_INCH (1L<<8)
60typedef unsigned long spPaperSize;
61#define SP_PAPER_SIZE_NUMBER_MASK 0xf
62#define SP_PAPER_SIZE_MASK 0xfff
63#define SP_PAPER_TYPE_MASK 0xf000
64#define SP_PAPER_SIZE_0_MASK (0L)
65#define SP_PAPER_SIZE_1_MASK (1L)
66#define SP_PAPER_SIZE_2_MASK (2L)
67#define SP_PAPER_SIZE_3_MASK (3L)
68#define SP_PAPER_SIZE_4_MASK (4L)
69#define SP_PAPER_SIZE_5_MASK (5L)
70#define SP_PAPER_SIZE_6_MASK (6L)
71#define SP_PAPER_SIZE_7_MASK (7L)
72#define SP_PAPER_SIZE_8_MASK (8L)
73#define SP_PAPER_SIZE_9_MASK (9L)
74#define SP_PAPER_SIZE_10_MASK (10L)
75#define SP_PAPER_SIZE_2_0_MASK (11L)
76#define SP_PAPER_SIZE_4_0_MASK (12L)
77#define SP_PAPER_SIZE_LETTER_MASK (1L<<4)
78#define SP_PAPER_SIZE_LEGAL_MASK (1L<<5)
79#define SP_PAPER_SIZE_TABLOID_MASK (1L<<6)
80#define SP_PAPER_SIZE_HAGAKI_MASK (1L<<7)
81#define SP_PAPER_SIZE_STATEMENT_MASK (1L<<8)
82#define SP_PAPER_SIZE_QUARTO_MASK (1L<<9)
83#define SP_PAPER_SIZE_FOOLSCAP_MASK (1L<<10)
84#define SP_PAPER_SIZE_EXECUTIVE_MASK (1L<<11)
85#define SP_PAPER_SIZE_POST_MASK (1L<<12)
86#define SP_PAPER_SIZE_CROWN_MASK (1L<<13)
87#define SP_PAPER_SIZE_ROYAL_MASK (1L<<14)
88#define SP_PAPER_SIZE_DEMY_MASK (1L<<15)
89#define SP_PAPER_SIZE_ELEPHANT_MASK (1L<<16)
90#define SP_PAPER_SIZE_PRINCESS_MASK (1L<<17)
91#define SP_PAPER_SIZE_EMPEROR_MASK (1L<<18)
92#define SP_PAPER_SIZE_SMALL_MASK (1L<<19)
93#define SP_PAPER_SIZE_MEDIUM_MASK (1L<<20)
94#define SP_PAPER_SIZE_DOUBLE_MASK (1L<<21)
95#define SP_PAPER_SIZE_LARGE_MASK (1L<<22)
96#define SP_PAPER_SIZE_CUSTOM_MASK (1L<<23)
97#define SP_PAPER_TYPE_A_MASK (1L<<24)
98#define SP_PAPER_TYPE_B_MASK (1L<<25)
99#define SP_PAPER_TYPE_C_MASK (1L<<26)
100#define SP_PAPER_TYPE_JIS_B_MASK (1L<<27)
101#define SP_PAPER_TYPE_ANSI_MASK (1L<<28)
102#define SP_PAPER_TYPE_ARCH_MASK (1L<<29)
103#define SP_PAPER_TYPE_PA_MASK (1L<<30)
104#define SP_PAPER_TYPE_US_MASK (1L<<31)
106#define SP_PAPER_SIZE_UNKNOWN 0L
107#define SP_PAPER_SIZE_A0 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_0_MASK)
108#define SP_PAPER_SIZE_A1 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_1_MASK)
109#define SP_PAPER_SIZE_A2 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_2_MASK)
110#define SP_PAPER_SIZE_A3 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_3_MASK)
111#define SP_PAPER_SIZE_A4 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_4_MASK)
112#define SP_PAPER_SIZE_A5 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_5_MASK)
113#define SP_PAPER_SIZE_A6 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_6_MASK)
114#define SP_PAPER_SIZE_2A0 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_2_0_MASK)
115#define SP_PAPER_SIZE_4A0 (SP_PAPER_TYPE_A_MASK | SP_PAPER_SIZE_4_0_MASK)
117#define SP_PAPER_SIZE_B0 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_0_MASK)
118#define SP_PAPER_SIZE_B1 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_1_MASK)
119#define SP_PAPER_SIZE_B2 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_2_MASK)
120#define SP_PAPER_SIZE_B3 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_3_MASK)
121#define SP_PAPER_SIZE_B4 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_4_MASK)
122#define SP_PAPER_SIZE_B5 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_5_MASK)
123#define SP_PAPER_SIZE_B6 (SP_PAPER_TYPE_B_MASK | SP_PAPER_SIZE_6_MASK)
125#define SP_PAPER_SIZE_JIS_B0 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_0_MASK)
126#define SP_PAPER_SIZE_JIS_B1 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_1_MASK)
127#define SP_PAPER_SIZE_JIS_B2 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_2_MASK)
128#define SP_PAPER_SIZE_JIS_B3 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_3_MASK)
129#define SP_PAPER_SIZE_JIS_B4 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_4_MASK)
130#define SP_PAPER_SIZE_JIS_B5 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_5_MASK)
131#define SP_PAPER_SIZE_JIS_B6 (SP_PAPER_TYPE_JIS_B_MASK | SP_PAPER_SIZE_6_MASK)
133#define SP_PAPER_SIZE_ANSI_A (SP_PAPER_TYPE_ANSI_MASK | SP_PAPER_SIZE_4_MASK)
134#define SP_PAPER_SIZE_ANSI_B (SP_PAPER_TYPE_ANSI_MASK | SP_PAPER_SIZE_3_MASK)
135#define SP_PAPER_SIZE_ANSI_C (SP_PAPER_TYPE_ANSI_MASK | SP_PAPER_SIZE_2_MASK)
136#define SP_PAPER_SIZE_ANSI_D (SP_PAPER_TYPE_ANSI_MASK | SP_PAPER_SIZE_1_MASK)
137#define SP_PAPER_SIZE_ANSI_E (SP_PAPER_TYPE_ANSI_MASK | SP_PAPER_SIZE_0_MASK)
139#define SP_PAPER_SIZE_ARCH_A (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_4_MASK)
140#define SP_PAPER_SIZE_ARCH_B (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_3_MASK)
141#define SP_PAPER_SIZE_ARCH_C (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_2_MASK)
142#define SP_PAPER_SIZE_ARCH_D (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_1_MASK)
143#define SP_PAPER_SIZE_ARCH_E (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_0_MASK)
144#define SP_PAPER_SIZE_ARCH_E1 (SP_PAPER_TYPE_ARCH_MASK | SP_PAPER_SIZE_5_MASK)
146#define SP_PAPER_SIZE_PA0 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_0_MASK)
147#define SP_PAPER_SIZE_PA1 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_1_MASK)
148#define SP_PAPER_SIZE_PA2 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_2_MASK)
149#define SP_PAPER_SIZE_PA3 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_3_MASK)
150#define SP_PAPER_SIZE_PA4 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_4_MASK)
151#define SP_PAPER_SIZE_PA5 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_5_MASK)
152#define SP_PAPER_SIZE_PA6 (SP_PAPER_TYPE_PA_MASK | SP_PAPER_SIZE_6_MASK)
154#define SP_PAPER_SIZE_LETTER SP_PAPER_SIZE_LETTER_MASK
155#define SP_PAPER_SIZE_GOVERNMENT_LETTER (SP_PAPER_TYPE_US_MASK | SP_PAPER_SIZE_LETTER_MASK)
156#define SP_PAPER_SIZE_LEGAL SP_PAPER_SIZE_LEGAL_MASK
157#define SP_PAPER_SIZE_TABLOID SP_PAPER_SIZE_TABLOID_MASK
158#define SP_PAPER_SIZE_HAGAKI SP_PAPER_SIZE_HAGAKI_MASK
159#define SP_PAPER_SIZE_STATEMENT SP_PAPER_SIZE_STATEMENT_MASK
160#define SP_PAPER_SIZE_QUARTO SP_PAPER_SIZE_QUARTO_MASK
161#define SP_PAPER_SIZE_FOOLSCAP SP_PAPER_SIZE_FOOLSCAP_MASK
162#define SP_PAPER_SIZE_EXECUTIVE SP_PAPER_SIZE_EXECUTIVE_MASK
163#define SP_PAPER_SIZE_CUSTOM SP_PAPER_SIZE_CUSTOM_MASK
169extern void spsetstdio(FILE *in, FILE *out, FILE *err);
170extern FILE *spgetstdin(
void);
171extern FILE *spgetstdout(
void);
172extern FILE *spgetstderr(
void);
173extern void spSetPrintFunc(spPrintFunc func);
174extern void spPrint(
const char *message, FILE *fp);
188extern void spError(
int status,
const char *format, ...);
190extern void spProgError(
const char *func_name,
const char *format, ...);
198extern void spDebug(
int level,
const char *func_name,
const char *format, ...);
235extern char *
xspStrCat(
const char *orig,
const char *src);
237extern char *
spStrCat(
char *dest,
int destsize,
const char *src);
239extern char *
spStrCopy(
char *dest,
int destsize,
const char *src);
272extern void spStrPToC(
const unsigned char *in_p,
char *out_c);
273extern void spStrCToP(
const char *in_c,
unsigned char *out_p);
274extern void spCopyPStr(
const unsigned char *source,
unsigned char *dest);
275extern void spCatPStr(
unsigned char *target,
const unsigned char *source);
276extern spBool spGetMacFileInfo(
const char *filename,
unsigned long *creator,
unsigned long *file_type);
277extern spBool spSetMacFileInfo(
const char *filename,
unsigned long creator,
unsigned long file_type);
287extern int spSeekFile(FILE *stream, spFileOffset offset,
int origin);
288#ifdef SP_SUPPORT_64BIT_INT
293extern int spSeekFileC64(FILE *stream,
char offset_c64[8],
int swap_endian,
int origin);
295extern void spAddC64(
char offset_c64[8],
long value,
int swap_endian);
297extern spULong spC64ToULong(
char value_c64[8],
int swap_endian);
299extern void spULongToC64(spULong value,
char value_c64[8],
int swap_endian);
300#ifdef SP_SUPPORT_64BIT_INT
302extern spLong64 spC64ToLong64(
char value_c64[8],
int swap_endian);
304extern void spLong64ToC64(spLong64 value,
char value_c64[8],
int swap_endian);
313extern spBool spIsExist(
const char *path);
351extern spBool spSetMacReadableEncoding(
unsigned int encoding);
362extern char *xspPrependPathList(
const char *pathlist,
const char *new_list);
373extern const char *spGetDefaultDir(
void);
391extern const char *spGetApplicationLibDir(
void);
392extern const char *spGetApplicationDocDir(
void);
394extern spBool spGetApplicationPath(
char *application_path,
int path_size,
spBool *id_depend,
395 const char *application_id,
const char *company_id,
spBool create_dir);
396extern spBool spGetVersionApplicationPath(
char *version_application_path,
int path_size,
397 const char *application_path,
const char *version_id,
spBool create_dir);
398extern spBool spGetApplicationTempPath(
char *application_temp_path,
int path_size,
399 const char *application_path,
const char *application_id,
const char *version_id,
429extern double spRem(
double x,
double y);
433extern void spNFtos(
char *buf,
int bufsize,
double x);
449extern long spConvertDoubleToBitWeighted(
double *idata,
long length,
void *odata,
int samp_bit,
double weight);
451extern long spConvertDoubleToBit(
double *idata,
long length,
void *odata,
int samp_bit,
double max);
453extern long spConvertDoubleToClippedBitWeighted(
double *idata,
long length,
void *odata,
int samp_bit,
double weight);
455extern long spConvertDoubleToClippedBit(
double *idata,
long length,
void *odata,
int samp_bit,
double max);
457extern long spConvertBitToDoubleWeighted(
void *idata,
long length,
double *odata,
int samp_bit,
double weight);
459extern long spConvertBitToDouble(
void *idata,
long length,
double *odata,
int samp_bit,
double max);
464extern spBool spGetPaperDimensions(spPaperSize paper_size, spPaperOrientation paper_orientation,
465 double *width_mm,
double *height_mm);
466extern spBool spGetPaperSizeString(spPaperSize paper_size,
unsigned long options,
char *buf,
int buf_size);
467extern spBool spGetPaperDimensionString(spPaperSize paper_size,
unsigned long options,
char *buf,
int buf_size);
468extern spBool spGetPaperFromDimensions(
double width_mm,
double height_mm,
469 spPaperSize *paper_size, spPaperOrientation *paper_orientation);
472extern spBool spIsAltiVecSupportedMac(
void);
473extern spBool spIsAltiVecDoubleSupportedMac(
void);
476#if defined(MACOS) && !defined(MACOSX64)
477extern spBool spFSSpecToExactNameMac(
void *fsspec,
char *filename);
482#define spStrCaseEq(s1, s2) ((s1 != NULL) && (s2 != NULL) && (spStrCaseCmp((s1), (s2)) == 0) ? 1 : 0)
483#define spStrNCaseEq(s1, s2, n) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), n) == 0) ? 1 : 0)
484#define spStrVCaseEq(s1, s2) ((s1 != NULL) && (s2 != NULL) && (spStrNCaseCmp((s1), (s2), (int)strlen(s2)) == 0) ? 1 : 0)
488#if !defined(SP_DISABLE_ABBREVIATION)
490#define strcaseeq spStrCaseEq
493#define strncaseeq spStrNCaseEq
496#define strvcaseeq spStrVCaseEq
500#define strwhite spStrWhite
504#define xstrcat xspStrCat
spFileOffset spTellFile(FILE *stream)
spBool spRemoveFile(const char *path)
char * spGetBaseName(const char *name)
spBool spGetFileInfo(const char *path, spBool *dir_flag, spFileOffset *size)
char * spSkipWhite(const char *string)
void spSetMessageFlag(int flag)
int spStrNCaseCmp(const char *s1, const char *s2, int n)
const char * spGetCompanyId(void)
char * xspGetTempDir(void)
spBool spRemoveDirSeparator(char *dir)
char * spGetDirName(char *filename)
const char * spCreateApplicationDir(spBool *id_depend, spBool *version_depend)
const char * spGetVersionId(void)
void spFtos(char *buf, double x)
double spRem(double x, double y)
char * xspGetRealPath(const char *readable_path)
void spError(int status, const char *format,...)
void spSetDebugLevel(int level)
char * spStrCat(char *dest, int destsize, const char *src)
const char * spGetCurrentDir(void)
void spSetDebugStdout(int flag)
int spConvertFromEscapedString(char *string, int bufsize, const char *escaped, const char *charlist)
char * xspGetReadablePath(const char *real_path)
const char * spGetApplicationTempDir(void)
spBool spAddDirSeparator(char *dir)
void spWarning(const char *format,...)
char * spStrCopy(char *dest, int destsize, const char *src)
void spSetWarningFlag(int flag)
const char * spGetTempDir(void)
spBool spSetApplicationId(const char *id)
char * xspGetCurrentDir(void)
spBool spIsDir(const char *path)
spBool spSetApplicationTempDir(const char *dir)
void spMessage(const char *format,...)
int spSeekFile(FILE *stream, spFileOffset offset, int origin)
int spStrWhite(const char *string)
spBool spRemoveDir(const char *path)
spBool spCreateDirRecursive(const char *path, unsigned short mode)
char * xspGetDirName(const char *filename)
long spGetProcessId(void)
spFileKind
Definition spBase.h:23
char * xspGetApplicationDir(spBool *version_depend)
int spStrCaseCmp(const char *s1, const char *s2)
void spNFtos(char *buf, int bufsize, double x)
spBool spCreateDir(const char *path, unsigned short mode)
char * xspGetBaseName(const char *name)
spBool spExecBrowser(const char *base_url, const char *sub_url, spBool local_path)
int spGetBitByte(int samp_bit, spBool *float_flag)
FILE * spOpenFile(const char *path, const char *mode)
void spProgError(const char *func_name, const char *format,...)
spBool spIsExactName(const char *name)
char * xspCutPathList(const char *pathlist, int col)
int spGetDebugLevel(void)
spBool spExists(const char *path)
spBool spRenameFile(const char *oldpath, const char *newpath)
const char * spGetApplicationDir(spBool *version_depend)
int spSeekFile64(FILE *stream, spLong64 offset, int origin)
const char * spGetApplicationId(void)
char * xspGetApplicationTempDir(void)
char * xspGetDocumentDir(spFileKind file_kind)
double spGetBitNormalizeFactor(int samp_bit)
spBool spRemoveNSuffix(char *path, char *removed_suffix, int suffixsize)
char * xspGetHomeDir(void)
const char * spGetHomeDir(void)
int spConvertToEscapedString(char *escaped, int bufsize, const char *string, const char *charlist)
spBool spRemoveSuffix(char *path, char *removed_suffix)
spBool spIsFile(const char *path)
void spDebug(int level, const char *func_name, const char *format,...)
spBool spReplaceNSuffix(char *path, int pathsize, const char *suffix)
char * xspGetExactName(const char *name)
spBool spReplaceSuffix(char *path, const char *suffix)
char * xspStrCat(const char *orig, const char *src)
char * spGetSuffix(const char *name)
int spEqSuffix(const char *file1, const char *file2)
char * xspAppendPathList(const char *pathlist, const char *new_list)
int spCloseFile(FILE *stream)
@ SP_FILE_KIND_MOVIE
Definition spBase.h:33
@ SP_FILE_KIND_SOUND
Definition spBase.h:32
@ SP_FILE_KIND_INCLUDE
Definition spBase.h:28
@ SP_FILE_KIND_DOCUMENT
Definition spBase.h:25
@ SP_FILE_KIND_URI
Definition spBase.h:37
@ SP_FILE_KIND_APPLICATION
Definition spBase.h:34
@ SP_FILE_KIND_PICTURE
Definition spBase.h:29
@ SP_FILE_KIND_SOURCE
Definition spBase.h:26
@ SP_FILE_KIND_LIBRARY
Definition spBase.h:35
@ SP_FILE_KIND_FIGURE
Definition spBase.h:30
@ SP_FILE_KIND_CONFIG
Definition spBase.h:27
@ SP_FILE_KIND_UNKNOWN
Definition spBase.h:24
@ SP_FILE_KIND_MUSIC
Definition spBase.h:31
@ SP_FILE_KIND_ARCHIVE
Definition spBase.h:36
int spBool
Definition spDefs.h:248