allow access to argc and argv in the c-interface.

This commit is contained in:
Vitor Santos Costa
2011-10-13 16:46:39 +01:00
parent 98cc029b66
commit 72afe868ec
3 changed files with 18 additions and 2 deletions

View File

@@ -543,6 +543,7 @@ X_API void *STD_PROTO(YAP_ExternalDataInStackFromTerm,(Term));
X_API int STD_PROTO(YAP_NewOpaqueType,(void *));
X_API Term STD_PROTO(YAP_NewOpaqueObject,(int, size_t));
X_API void *STD_PROTO(YAP_OpaqueObjectFromTerm,(Term));
X_API int STD_PROTO(YAP_Argv,(char *** argvp));
static int
dogc( USES_REGS1 )
@@ -1942,6 +1943,7 @@ YAP_ReadBuffer(char *s, Term *tp)
Term t;
BACKUP_H();
LOCAL_ErrorMessage=NULL;
while ((t = Yap_StringToTerm(s,tp)) == 0L) {
if (LOCAL_ErrorMessage) {
if (!strcmp(LOCAL_ErrorMessage,"Stack Overflow")) {
@@ -3715,7 +3717,8 @@ int YAP_MaxOpPriority(Atom at, Term module)
return ret;
}
int YAP_OpInfo(Atom at, Term module, int opkind, int *yap_type, int *prio)
int
YAP_OpInfo(Atom at, Term module, int opkind, int *yap_type, int *prio)
{
AtomEntry *ae = RepAtom(at);
OpEntry *info;
@@ -3779,4 +3782,11 @@ int YAP_OpInfo(Atom at, Term module, int opkind, int *yap_type, int *prio)
}
int
YAP_Argv(char ***argvp)
{
if (argvp) {
*argvp = GLOBAL_argv;
}
return GLOBAL_argc;
}