|
From: Vitor S. C. <vs...@us...> - 2008-07-24 16:02:29
|
Update of /cvsroot/yap/include In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7875/include Modified Files: SWI-Prolog.h SWI-Stream.h YapInterface.h Log Message: improve C-interface and SWI comptaibility a bit. Index: SWI-Prolog.h =================================================================== RCS file: /cvsroot/yap/include/SWI-Prolog.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SWI-Prolog.h 12 Feb 2008 17:03:54 -0000 1.2 +++ SWI-Prolog.h 24 Jul 2008 16:02:02 -0000 1.3 @@ -28,11 +28,13 @@ #include <time.h> #endif +#ifndef X_API #if defined(_MSC_VER) && defined(YAP_EXPORTS) #define X_API __declspec(dllexport) #else #define X_API #endif +#endif typedef unsigned long fid_t; typedef unsigned long term_t; @@ -115,6 +117,8 @@ #define CVT_ALL (CVT_ATOMIC|CVT_LIST) #define CVT_MASK 0x00ff +#define CVT_EXCEPTION 0x10000 + #define BUF_DISCARDABLE 0x0000 #define BUF_RING 0x0100 #define BUF_MALLOC 0x0200 @@ -216,6 +220,7 @@ extern X_API int PL_unify_pointer(term_t, void *); extern X_API int PL_unify_string_chars(term_t, const char *); extern X_API int PL_unify_term(term_t,...); +extern X_API int PL_unify_wchars(term_t, int, size_t, const pl_wchar_t *); /* end PL_unify_* functions =============================*/ /* begin PL_is_* functions =============================*/ extern X_API int PL_is_atom(term_t); Index: SWI-Stream.h =================================================================== RCS file: /cvsroot/yap/include/SWI-Stream.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SWI-Stream.h 12 Feb 2008 17:03:54 -0000 1.2 +++ SWI-Stream.h 24 Jul 2008 16:02:03 -0000 1.3 @@ -2,6 +2,14 @@ #ifndef _PL_STREAM_H #define _PL_STREAM_H +#ifndef X_API +#if defined(_MSC_VER) && defined(YAP_EXPORTS) +#define X_API __declspec(dllexport) +#else +#define X_API +#endif +#endif + /* This appears to make the wide-character support compile and work on HPUX 11.23. There really should be a cleaner way ... */ @@ -138,5 +146,8 @@ intptr_t reserved[3]; /* reserved for extension */ } IOSTREAM; +#define PL_EXPORT(type) extern X_API type + +extern X_API int PL_unify_stream(term_t t, IOSTREAM *s); #endif /*_PL_STREAM_H*/ Index: YapInterface.h =================================================================== RCS file: /cvsroot/yap/include/YapInterface.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- YapInterface.h 11 Jul 2008 17:02:07 -0000 1.30 +++ YapInterface.h 24 Jul 2008 16:02:03 -0000 1.31 @@ -287,7 +287,7 @@ /* void YAP_Write(YAP_Term,void (*)(int),int) */ extern X_API void PROTO(YAP_Write,(YAP_Term,void (*)(int),int)); -/* void YAP_WriteBuffer(YAP_Term,char *,unsgined int,int) */ +/* void YAP_WriteBufffer(YAP_Term,char *,unsgined int,int) */ extern X_API void PROTO(YAP_WriteBuffer,(YAP_Term,char *,unsigned int,int)); /* void YAP_Term(YAP_Term) */ @@ -323,12 +323,42 @@ /* int BufferToString(const char *) */ extern X_API YAP_Term PROTO(YAP_BufferToString,(CONST char *)); -/* YAP_Term BufferToTerm(const char *) */ -extern X_API YAP_Term PROTO(YAP_ReadBuffer,(CONST char *,YAP_Term *)); +/* int BufferToString(const char *) */ +extern X_API YAP_Term PROTO(YAP_NBufferToString,(CONST char *, size_t len)); + +/* int BufferToString(const char *) */ +extern X_API YAP_Term PROTO(YAP_WideBufferToString,(CONST wchar_t *)); + +/* int BufferToString(const char *) */ +extern X_API YAP_Term PROTO(YAP_NWideBufferToString,(CONST wchar_t *, size_t len)); /* int BufferToAtomList(const char *) */ extern X_API YAP_Term PROTO(YAP_BufferToAtomList,(CONST char *)); +/* int BufferToAtomList(const char *) */ +extern X_API YAP_Term PROTO(YAP_NBufferToAtomList,(CONST char *, size_t len)); + +/* int BufferToAtomList(const char *) */ +extern X_API YAP_Term PROTO(YAP_WideBufferToAtomList,(CONST wchar_t *)); + +/* int BufferToAtomList(const char *) */ +extern X_API YAP_Term PROTO(YAP_NWideBufferToAtomList,(CONST wchar_t *, size_t len)); + +/* int BufferToDiffList(const char *) */ +extern X_API YAP_Term PROTO(YAP_BufferToDiffList,(CONST char *)); + +/* int BufferToDiffList(const char *) */ +extern X_API YAP_Term PROTO(YAP_NBufferToDiffList,(CONST char *, size_t len)); + +/* int BufferToDiffList(const char *) */ +extern X_API YAP_Term PROTO(YAP_WideBufferToDiffList,(CONST wchar_t *)); + +/* int BufferToDiffList(const char *) */ +extern X_API YAP_Term PROTO(YAP_NWideBufferToDiffList,(CONST wchar_t *, size_t len)); + +/* YAP_Term BufferToTerm(const char *) */ +extern X_API YAP_Term PROTO(YAP_ReadBuffer,(CONST char *,YAP_Term *)); + /* void YAP_InitSocks(const char *,long) */ extern X_API int PROTO(YAP_InitSocks,(CONST char *,long)); |