mostly indenting
This commit is contained in:
parent
3f2dbba042
commit
b2369175e5
76
os/yapio.h
76
os/yapio.h
@ -41,21 +41,19 @@ typedef struct AliasDescS {
|
|||||||
int alias_stream;
|
int alias_stream;
|
||||||
} * AliasDesc;
|
} * AliasDesc;
|
||||||
|
|
||||||
|
|
||||||
#define MAX_ISO_LATIN1 255
|
#define MAX_ISO_LATIN1 255
|
||||||
|
|
||||||
|
|
||||||
/* parser stack, used to be AuxSp, now is ASP */
|
/* parser stack, used to be AuxSp, now is ASP */
|
||||||
#define ParserAuxSp LOCAL_ScannerStack
|
#define ParserAuxSp LOCAL_ScannerStack
|
||||||
|
|
||||||
/* routines in parser.c */
|
/* routines in parser.c */
|
||||||
VarEntry *Yap_LookupVar(const char *);
|
VarEntry *Yap_LookupVar(const char *);
|
||||||
Term Yap_VarNames(VarEntry *,Term);
|
Term Yap_VarNames(VarEntry *, Term);
|
||||||
Term Yap_Variables(VarEntry *,Term);
|
Term Yap_Variables(VarEntry *, Term);
|
||||||
Term Yap_Singletons(VarEntry *,Term);
|
Term Yap_Singletons(VarEntry *, Term);
|
||||||
|
|
||||||
/* routines in scanner.c */
|
/* routines in scanner.c */
|
||||||
TokEntry *Yap_tokenizer( struct stream_desc *, bool, Term *d);
|
TokEntry *Yap_tokenizer(struct stream_desc *, bool, Term *d);
|
||||||
void Yap_clean_tokenizer(TokEntry *, VarEntry *, VarEntry *);
|
void Yap_clean_tokenizer(TokEntry *, VarEntry *, VarEntry *);
|
||||||
char *Yap_AllocScannerMemory(unsigned int);
|
char *Yap_AllocScannerMemory(unsigned int);
|
||||||
|
|
||||||
@ -80,15 +78,17 @@ int Yap_PlGetWchar(void);
|
|||||||
int Yap_PlFGetchar(void);
|
int Yap_PlFGetchar(void);
|
||||||
int Yap_GetCharForSIGINT(void);
|
int Yap_GetCharForSIGINT(void);
|
||||||
Int Yap_StreamToFileNo(Term);
|
Int Yap_StreamToFileNo(Term);
|
||||||
int Yap_OpenStream(FILE *,char *,Term,int);
|
int Yap_OpenStream(FILE *, char *, Term, int);
|
||||||
char *Yap_TermToString(Term t, char *s, size_t sz, size_t *length, encoding_t *encoding, int flags);
|
char *Yap_TermToString(Term t, char *s, size_t sz, size_t *length,
|
||||||
char *Yap_HandleToString(yhandle_t l, size_t sz, size_t *length, encoding_t *encoding, int flags);
|
encoding_t *encoding, int flags);
|
||||||
|
char *Yap_HandleToString(yhandle_t l, size_t sz, size_t *length,
|
||||||
|
encoding_t *encoding, int flags);
|
||||||
int Yap_GetFreeStreamD(void);
|
int Yap_GetFreeStreamD(void);
|
||||||
int Yap_GetFreeStreamDForReading(void);
|
int Yap_GetFreeStreamDForReading(void);
|
||||||
|
|
||||||
Term Yap_WStringToList(wchar_t *);
|
Term Yap_WStringToList(wchar_t *);
|
||||||
Term Yap_WStringToListOfAtoms(wchar_t *);
|
Term Yap_WStringToListOfAtoms(wchar_t *);
|
||||||
Atom Yap_LookupWideAtom( const wchar_t * );
|
Atom Yap_LookupWideAtom(const wchar_t *);
|
||||||
|
|
||||||
#define Quote_illegal_f 0x01
|
#define Quote_illegal_f 0x01
|
||||||
#define Ignore_ops_f 0x02
|
#define Ignore_ops_f 0x02
|
||||||
@ -107,37 +107,39 @@ Atom Yap_LookupWideAtom( const wchar_t * );
|
|||||||
#define Fullstop_f 0x4000
|
#define Fullstop_f 0x4000
|
||||||
#define New_Line_f 0x8000
|
#define New_Line_f 0x8000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* grow.c */
|
/* grow.c */
|
||||||
int Yap_growheap_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
int Yap_growheap_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
||||||
int Yap_growstack_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
int Yap_growstack_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
||||||
int Yap_growtrail_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
int Yap_growtrail_in_parser(tr_fr_ptr *, TokEntry **, VarEntry **);
|
||||||
|
|
||||||
bool Yap_IsAbsolutePath(const char *p);
|
bool Yap_IsAbsolutePath(const char *p);
|
||||||
Atom Yap_TemporaryFile( const char *prefix, int *fd);
|
Atom Yap_TemporaryFile(const char *prefix, int *fd);
|
||||||
char *Yap_AbsoluteFile(const char *spec, char *tmp);
|
char *Yap_AbsoluteFile(const char *spec, char *tmp);
|
||||||
|
|
||||||
typedef enum mem_buf_source {
|
typedef enum mem_buf_source {
|
||||||
MEM_BUF_CODE=1,
|
MEM_BUF_CODE = 1,
|
||||||
MEM_BUF_MALLOC=2,
|
MEM_BUF_MALLOC = 2,
|
||||||
MEM_BUF_USER=4
|
MEM_BUF_USER = 4
|
||||||
} memBufSource;
|
} memBufSource;
|
||||||
|
|
||||||
char * Yap_MemStreamBuf( int sno );
|
char *Yap_MemStreamBuf(int sno);
|
||||||
|
|
||||||
extern Term Yap_StringToTerm(const char *s, size_t len, encoding_t* encp, int prio, Term *bindings_p);
|
extern Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp,
|
||||||
|
int prio, Term *bindings_p);
|
||||||
extern Term Yap_StringToNumberTerm(char *s, encoding_t *encp);
|
extern Term Yap_StringToNumberTerm(char *s, encoding_t *encp);
|
||||||
int Yap_FormatFloat(Float f, char **s, size_t sz);
|
int Yap_FormatFloat(Float f, char **s, size_t sz);
|
||||||
int Yap_open_buf_read_stream(const char *nbuf, size_t nchars, encoding_t *encp, memBufSource src);
|
int Yap_open_buf_read_stream(const char *nbuf, size_t nchars, encoding_t *encp,
|
||||||
int Yap_open_buf_write_stream( char *nbuf, size_t nchars, encoding_t *encp, memBufSource src);
|
memBufSource src);
|
||||||
|
int Yap_open_buf_write_stream(char *nbuf, size_t nchars, encoding_t *encp,
|
||||||
|
memBufSource src);
|
||||||
Term Yap_ReadFromAtom(Atom a, Term opts);
|
Term Yap_ReadFromAtom(Atom a, Term opts);
|
||||||
FILE *Yap_GetInputStream(Term t, const char *m);
|
FILE *Yap_GetInputStream(Term t, const char *m);
|
||||||
FILE *Yap_GetOutputStream(Term t,const char *m);
|
FILE *Yap_GetOutputStream(Term t, const char *m);
|
||||||
char * Yap_guessFileName(int f, int sno, char *nameb, size_t max);
|
char *Yap_guessFileName(int f, int sno, char *nameb, size_t max);
|
||||||
void Yap_plwrite(Term t, struct stream_desc *mywrite, int max_depth, int flags, int priority);
|
void Yap_plwrite(Term t, struct stream_desc *mywrite, int max_depth, int flags,
|
||||||
|
int priority);
|
||||||
|
|
||||||
int Yap_CheckSocketStream(Term stream, const char * error);
|
int Yap_CheckSocketStream(Term stream, const char *error);
|
||||||
void Yap_init_socks(char *host, long interface_port);
|
void Yap_init_socks(char *host, long interface_port);
|
||||||
|
|
||||||
#ifdef HAVE_ERRNO_H
|
#ifdef HAVE_ERRNO_H
|
||||||
@ -149,9 +151,7 @@ extern int errno;
|
|||||||
INLINE_ONLY EXTERN UInt inline HashFunction(const unsigned char *);
|
INLINE_ONLY EXTERN UInt inline HashFunction(const unsigned char *);
|
||||||
INLINE_ONLY EXTERN UInt inline WideHashFunction(wchar_t *);
|
INLINE_ONLY EXTERN UInt inline WideHashFunction(wchar_t *);
|
||||||
|
|
||||||
INLINE_ONLY EXTERN inline UInt
|
INLINE_ONLY EXTERN inline UInt HashFunction(const unsigned char *CHP) {
|
||||||
HashFunction(const unsigned char *CHP)
|
|
||||||
{
|
|
||||||
/* djb2 */
|
/* djb2 */
|
||||||
UInt hash = 5381;
|
UInt hash = 5381;
|
||||||
UInt c;
|
UInt c;
|
||||||
@ -168,9 +168,7 @@ HashFunction(const unsigned char *CHP)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
INLINE_ONLY EXTERN UInt inline
|
INLINE_ONLY EXTERN UInt inline WideHashFunction(wchar_t *CHP) {
|
||||||
WideHashFunction(wchar_t *CHP)
|
|
||||||
{
|
|
||||||
UInt hash = 5381;
|
UInt hash = 5381;
|
||||||
|
|
||||||
UInt c;
|
UInt c;
|
||||||
@ -181,4 +179,22 @@ WideHashFunction(wchar_t *CHP)
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INLINE_ONLY inline EXTERN Term MkCharTerm(Int c);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MkCharTerm: convert a character into a single atom.
|
||||||
|
*
|
||||||
|
* @param c the character code
|
||||||
|
*
|
||||||
|
* @return the term.
|
||||||
|
*/
|
||||||
|
INLINE_ONLY inline EXTERN Term MkCharTerm(Int c) {
|
||||||
|
wchar_t cs[2];
|
||||||
|
if (c < 0)
|
||||||
|
return MkAtomTerm(AtomEof);
|
||||||
|
cs[0] = c;
|
||||||
|
cs[1] = '\0';
|
||||||
|
return MkAtomTerm(Yap_LookupMaybeWideAtom(cs));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user