win...
This commit is contained in:
parent
477772e703
commit
f3b0e962a7
20
C/load_dll.c
20
C/load_dll.c
@ -43,11 +43,10 @@ void *
|
|||||||
Yap_LoadForeignFile(char *file, int flags)
|
Yap_LoadForeignFile(char *file, int flags)
|
||||||
{
|
{
|
||||||
char *buf = malloc(1024);
|
char *buf = malloc(1024);
|
||||||
printf("file=%s\n" , file );
|
|
||||||
void *ptr= (void *)LoadLibrary(file);
|
void *ptr= (void *)LoadLibrary(file);
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL, GetLastError(),
|
NULL, GetLastError(),
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -76,12 +75,20 @@ Yap_CloseForeignFile(void *handle)
|
|||||||
*/
|
*/
|
||||||
static Int
|
static Int
|
||||||
LoadForeign(StringList ofiles, StringList libs,
|
LoadForeign(StringList ofiles, StringList libs,
|
||||||
char *proc_name, YapInitProc *init_proc)
|
const char *proc_name, YapInitProc *init_proc)
|
||||||
{
|
{
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
while (ofiles) {
|
while (ofiles) {
|
||||||
HINSTANCE handle;
|
HINSTANCE handle;
|
||||||
|
|
||||||
|
if (*init_proc == NULL &&
|
||||||
|
(*init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name)))
|
||||||
|
{
|
||||||
|
YapInitProc f = *init_proc;
|
||||||
|
f();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const char *file = AtomName(ofiles->name);
|
const char *file = AtomName(ofiles->name);
|
||||||
if (Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) &&
|
if (Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) &&
|
||||||
(handle=LoadLibrary(LOCAL_FileNameBuf)) != 0)
|
(handle=LoadLibrary(LOCAL_FileNameBuf)) != 0)
|
||||||
@ -90,9 +97,9 @@ LoadForeign(StringList ofiles, StringList libs,
|
|||||||
if (*init_proc == NULL)
|
if (*init_proc == NULL)
|
||||||
*init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name);
|
*init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name);
|
||||||
} else {
|
} else {
|
||||||
char *buf = malloc(1024);
|
char *buf = malloc(1024);
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL, GetLastError(),
|
NULL, GetLastError(),
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
|
||||||
NULL);
|
NULL);
|
||||||
//fprintf(stderr,"WinError: %s\n", LOCAL_ErrorSay);
|
//fprintf(stderr,"WinError: %s\n", LOCAL_ErrorSay);
|
||||||
@ -139,7 +146,7 @@ Yap_LoadForeign(StringList ofiles, StringList libs,
|
|||||||
return LoadForeign(ofiles, libs, proc_name, init_proc);
|
return LoadForeign(ofiles, libs, proc_name, init_proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_ShutdownLoadForeign(void)
|
Yap_ShutdownLoadForeign(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -152,4 +159,3 @@ Yap_ReLoadForeign(StringList ofiles, StringList libs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ set ( REGEX_INCLUDES
|
|||||||
yapregex.h
|
yapregex.h
|
||||||
engine.c
|
engine.c
|
||||||
)
|
)
|
||||||
|
|
||||||
set ( REGEX_SOURCES
|
set ( REGEX_SOURCES
|
||||||
regcomp.c
|
regcomp.c
|
||||||
regerror.c
|
regerror.c
|
||||||
@ -15,19 +15,17 @@ set ( REGEX_SOURCES
|
|||||||
regfree.c
|
regfree.c
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(BEFORE
|
|
||||||
.
|
|
||||||
)
|
|
||||||
add_library (regexp SHARED regexp.c ${REGEX_SOURCES})
|
add_library (regexp SHARED regexp.c ${REGEX_SOURCES})
|
||||||
|
|
||||||
target_link_libraries(regexp libYap)
|
target_link_libraries(regexp libYap)
|
||||||
|
|
||||||
set_target_properties (regexp PROPERTIES PREFIX "")
|
set_target_properties (regexp PROPERTIES PREFIX "")
|
||||||
set_target_properties (regexp PROPERTIES INCLUDE_DIRECTORIES ".")
|
TARGET_INCLUDE_DIRECTORIES (regexp PUBLIC BEFORE
|
||||||
set_target_properties (regexp PROPERTIES INCLUDE_DIRECTORIES "${CURRENT_BINARY}")
|
${CMAKE_TOP_SOURCE_DIR}/include;${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
|
|
||||||
install(TARGETS regexp
|
install(TARGETS regexp
|
||||||
LIBRARY DESTINATION ${libdir}
|
LIBRARY DESTINATION ${libdir}
|
||||||
RUNTIME DESTINATION ${dlls}
|
RUNTIME DESTINATION ${dlls}
|
||||||
ARCHIVE DESTINATION ${dlls} )
|
ARCHIVE DESTINATION ${dlls} )
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "c_interface.h"
|
#include "YapInterface.h"
|
||||||
#include "yapregex.h"
|
#include "yapregex.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
@ -44,7 +44,6 @@ static char sccsid[] = "@(#)regfree.c 8.3 (Berkeley) 3/20/94";
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "c_interface.h"
|
|
||||||
#include "yapregex.h"
|
#include "yapregex.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
@ -93,6 +93,8 @@ typedef struct {
|
|||||||
#define REG_LARGE 01000 /* force large representation */
|
#define REG_LARGE 01000 /* force large representation */
|
||||||
#define REG_BACKR 02000 /* force use of backref code */
|
#define REG_BACKR 02000 /* force use of backref code */
|
||||||
|
|
||||||
|
#include "YapInterface.h"
|
||||||
|
|
||||||
int yap_regcomp(regex_t *, const char *, int);
|
int yap_regcomp(regex_t *, const char *, int);
|
||||||
size_t yap_regerror(int, const regex_t *, char *, size_t);
|
size_t yap_regerror(int, const regex_t *, char *, size_t);
|
||||||
int yap_regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
|
int yap_regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
|
||||||
|
@ -406,7 +406,7 @@ LeafNode::weight() const
|
|||||||
// ancester that is not set. This can only
|
// ancester that is not set. This can only
|
||||||
// happen when calculating the weights
|
// happen when calculating the weights
|
||||||
// for the edge labels in graphviz
|
// for the edge labels in graphviz
|
||||||
return nan(NULL);
|
return nan("SetOrNode::isSet() == false");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double weight = clause_->literals()[0].isPositive()
|
double weight = clause_->literals()[0].isPositive()
|
||||||
@ -1580,4 +1580,3 @@ LiftedKc::printSolverFlags() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Horus
|
} // namespace Horus
|
||||||
|
|
||||||
|
@ -23,4 +23,3 @@ class LiftedKc : public LiftedSolver {
|
|||||||
} // namespace Horus
|
} // namespace Horus
|
||||||
|
|
||||||
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDKC_H_
|
#endif // YAP_PACKAGES_CLPBN_HORUS_LIFTEDKC_H_
|
||||||
|
|
||||||
|
@ -42,9 +42,18 @@ add_subdirectory(yap_kernel)
|
|||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
install(TARGETS YAPPython
|
install(TARGETS YAPPython
|
||||||
LIBRARY DESTINATION ${dlls}
|
LIBRARY DESTINATION ${dlls}
|
||||||
RUNTIME DESTINATION ${dlls}
|
RUNTIME DESTINATION ${bindir}
|
||||||
|
ARCHIVE DESTINATION ${dlls} )
|
||||||
|
else()
|
||||||
|
install(TARGETS YAPPython
|
||||||
|
LIBRARY DESTINATION ${dlls}
|
||||||
|
RUNTIME DESTINATION ${dlls}
|
||||||
ARCHIVE DESTINATION ${dlls} )
|
ARCHIVE DESTINATION ${dlls} )
|
||||||
|
endif()
|
||||||
|
|
||||||
endif (PYTHONLIBS_FOUND)
|
endif (PYTHONLIBS_FOUND)
|
||||||
|
Reference in New Issue
Block a user