yap_kernl + docs
This commit is contained in:
parent
9560aa026e
commit
25a2b68b15
79
os/stream.h
79
os/stream.h
@ -1,79 +0,0 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* File: stream.h *
|
||||
* Last rev: 5/2/88 *
|
||||
* mods: *
|
||||
* comments: Stream core routunes *
|
||||
* *
|
||||
*************************************************************************/
|
||||
#ifdef SCCS
|
||||
static char SccsId[] = "%W% %G%";
|
||||
#endif
|
||||
|
||||
#if __ANDROID__
|
||||
#undef HAVE_FMEMOPEN
|
||||
#undef HAVE_OPEN_MEMSTREAM
|
||||
#endif
|
||||
|
||||
#if _WIN32
|
||||
#undef MAY_WRITE
|
||||
#undef MAY_READ
|
||||
#endif
|
||||
|
||||
typedef struct mem_desc {
|
||||
char *buf; /* where the file is being read from/written to */
|
||||
int src; /* where the space comes from, 0 code space, 1 malloc */
|
||||
Int max_size; /* maximum buffer size (may be changed dynamically) */
|
||||
UInt pos; /* cursor */
|
||||
volatile void *error_handler;
|
||||
} memHandle;
|
||||
|
||||
typedef struct stream_desc {
|
||||
Atom name;
|
||||
Term user_name;
|
||||
FILE *file;
|
||||
// useful in memory streams
|
||||
char *nbuf;
|
||||
size_t nsize;
|
||||
union {
|
||||
struct {
|
||||
#define PLGETC_BUF_SIZE 4096
|
||||
unsigned char *buf, *ptr;
|
||||
int left;
|
||||
} file;
|
||||
memHandle mem_string;
|
||||
struct {
|
||||
int fd;
|
||||
} pipe;
|
||||
#if HAVE_SOCKET
|
||||
struct {
|
||||
socket_domain domain;
|
||||
socket_info flags;
|
||||
int fd;
|
||||
} socket;
|
||||
#endif
|
||||
struct {
|
||||
const unsigned char *buf, *ptr;
|
||||
} irl;
|
||||
} u;
|
||||
|
||||
Int charcount, linecount, linepos;
|
||||
stream_flags_t status;
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
lockvar streamlock; /* protect stream access */
|
||||
#endif
|
||||
int (*stream_putc)(
|
||||
int, int); /** function the stream uses for writing a single octet */
|
||||
int (*stream_wputc)(
|
||||
int, wchar_t); /** function the stream uses for writing a character */
|
||||
int (*stream_getc)(int); /** function the stream uses for reading an octet. */
|
||||
int (*stream_wgetc)(
|
||||
int); /** function the stream uses for reading a character. */
|
||||
struct vfs *vfs; /** stream belongs to a space */
|
||||
void *vfs_handle; /** direct handle to stream in that space. */
|
||||
int (*stream_wgetc_for_read)(
|
||||
int); /* function the stream uses for parser. It may be different
|
||||
from above if the ISO character conversion is on */
|
||||
encoding_t encoding; /** current encoding for stream */
|
||||
} StreamDesc;
|
||||
|
@ -1,97 +0,0 @@
|
||||
"""A setuptools based setup module.
|
||||
|
||||
See:
|
||||
https://packaging.python.org/en/latest/distributing.html
|
||||
https://github.com/pypa/sampleproject
|
||||
"""
|
||||
|
||||
# Always prefer setuptools over distutils
|
||||
from setuptools import setup
|
||||
from setuptools.extension import Extension
|
||||
# To use a consistent encoding
|
||||
from codecs import open
|
||||
from os import path, makedirs, walk
|
||||
from shutil import copytree, rmtree, copy2, move
|
||||
from glob import glob
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import os.path
|
||||
|
||||
my_extra_link_args = []
|
||||
if platform.system() == 'Darwin':
|
||||
my_extra_link_args = ['-Wl,-rpath','-Wl,${_ABS_PYTHON_MODULE_PATH}']
|
||||
so = 'dylib'
|
||||
#or dll in glob('yap/dlls/*'):
|
||||
# move( dll ,'lib' )
|
||||
pls = []
|
||||
for (r,d,fs) in walk('yap/pl'):
|
||||
for f in fs:
|
||||
pls += [os.path.join(r, f)]
|
||||
for (r,d,fs) in walk('yap'):
|
||||
for f in fs:
|
||||
pls += [os.path.join(r, f)]
|
||||
# for f in glob( 'lib*.*' ):
|
||||
# ofile.write(f+"\n")
|
||||
cplus=['${RELATIVE_SOURCE}CXX/yapi.cpp']
|
||||
py2yap=['${RELATIVE_SOURCE}packages/python/python.c',
|
||||
'${RELATIVE_SOURCE}packages/python/pl2py.c',
|
||||
'${RELATIVE_SOURCE}packages/python/pybips.c',
|
||||
'${RELATIVE_SOURCE}packages/python/py2pl.c',
|
||||
'${RELATIVE_SOURCE}packages/python/pl2pl.c',
|
||||
'${RELATIVE_SOURCE}packages/python/pypreds.c'
|
||||
]
|
||||
python_sources = ['yapPYTHON_wrap.cxx']+py2yap+cplus
|
||||
here = path.abspath(path.dirname(__file__))
|
||||
|
||||
# Get the long description from the README file
|
||||
|
||||
extensions=[Extension '_yap', python_sources,
|
||||
define_macros = [('MAJOR_VERSION', '1'),
|
||||
('MINOR_VERSION', '0'),
|
||||
('_YAP_NOT_INSTALLED_', '1'),
|
||||
('YAP_PYTHON', '1')],
|
||||
runtime_library_dirs=['yap4py','${libdir}','${bindir}'],
|
||||
swig_opts=['-modern', '-c++', '-py3','-I${RELATIVE_SOURCE}/CXX'],
|
||||
library_dirs=['../../..','../../../CXX','../../packages/python',"${dlls}","${bindir}", '.'],
|
||||
extra_link_args=my_extra_link_args,
|
||||
extra_compile_args=['-g3','-O0'],
|
||||
libraries=['Yap','${GMP_LIBRARIES}'],
|
||||
include_dirs=['../../..',
|
||||
'${GMP_INCLUDE_DIRS}',
|
||||
'${RELATIVE_SOURCE}H',
|
||||
'${RELATIVE_SOURCE}H/generated',
|
||||
'${RELATIVE_SOURCE}OPTYap',
|
||||
'${RELATIVE_SOURCE}os',
|
||||
'${RELATIVE_SOURCE}include',
|
||||
'${RELATIVE_SOURCE}CXX', '.']
|
||||
)]
|
||||
|
||||
setup(
|
||||
name='YAP4Py',
|
||||
version='${YAP_FULL_VERSION}',
|
||||
description='The YAP Prolog compiler as a Python Library',
|
||||
url='https://github.com/vscosta/yap-6.3',
|
||||
author='Vitor Santos Costa',
|
||||
author_email='vsc@dcc.fc.up.pt',
|
||||
license='Artistic',
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Intended Audience :: Developers',
|
||||
'Topic :: Software Development :: Build Tools',
|
||||
'License :: OSI Approved :: Artistic License',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7'],
|
||||
keywords=['Logic Programing'],
|
||||
#package_data={'yap4py':['*.*'] },
|
||||
include_package_data=True,
|
||||
ext_modules = extensions,
|
||||
#py_modules = ['yap'],
|
||||
zip_safe=False,
|
||||
eager_resources = [''],
|
||||
#packages=['yap4py'] # find_packages()
|
||||
#package_dir = {'':'yap4py'}
|
||||
)
|
Reference in New Issue
Block a user