MapleLibName - set or query libname in external code
|
Calling Sequence
|
|
MapleLibName(kv, val)
|
|
Parameters
|
|
kv
|
-
|
kernel handle of type MKernelVector
|
val
|
-
|
expression sequence object containing strings
|
|
|
|
|
Description
|
|
•
|
MapleLibName returns the currently assigned value of libname, which controls the location of Maple libraries. If val is not NULL, then it also tries to assign .
|
•
|
Never directly modify the expression sequence returned by MapleLibName. Always create a new expression sequence to change the value.
|
|
|
Examples
|
|
#include <string.h>
|
#include "maplec.h"
|
ALGEB M_DECL MyLoadPackage( MKernelVector kv, ALGEB *args )
|
{
|
M_INT n, i;
|
ALGEB libname, newlibname;
|
char *mylib, buf[1024];
|
mylib = getenv("HOME");
|
if( mylib ) {
|
mylib = strncpy(buf,mylib,1010);
|
mylib[1010] = '0';
|
}
|
else {
|
mylib = strcpy(buf,"/usr/local");
|
}
|
strcat(mylib,"/tool_lib");
|
libname = MapleLibName(kv,NULL);
|
n = MapleNumArgs(kv,libname);
|
newlibname = NewMapleExpressionSequence(kv,n+1);
|
for( i=1; i<=n; ++i ) {
|
newlibname[i] = libname[i];
|
}
|
((ALGEB*)newlibname)[i] = ToMapleString(kv,mylib);
|
MapleLibName(kv,newlibname);
|
return( ToMapleBoolean(kv,TRUE) );
|
}
|
|
|
Execute the external function from Maple.
>
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
|
|
Download Help Document
Was this information helpful?