6.3 Legion context space

The following section provides a C interface to Legion context space.

int
ContextSpaceActive();

Determines whether or not a valid context space exists.

Parameters: None

Return Values:
0 if Context space is NOT active
1 if Context space is active

User Responsibility: None

ContextLookup(char *LookupPath);

Look up the LOID of a name in the current context (does not allow paths in the name).

Parameters:
Context name of an object to lookup in the current context.

Return Values:
LOID of the object indicated context space.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the LOID return value.

char*
ContextPathLookup(char *LookupPath);

Look up the LOID of the object named in the given "Unix-like" context path. This command will allow both absolute, and relative naming.

Parameters:
context path name of an object to lookup in context space.

Return Values:
LOID of the object indicated context space.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the LOID return value.

char**
ContextMultiLookup(char *LkupPath);

Look up the LOIDs of a number of objects named in the current context (not path specified, however). It's somewhat confusing as to why this command takes a string at all, but the string basically needs to contain "* " as its parameter.

Parameters:
Unclear, but give it "* "

Return Values:
NULL terminated array of context space names for
objects in the indicated context. In other words,
each element of the array is a char*, which is
either the context name of an object, or NULL if it is
the end of the list.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing each non-NULL entry
in the array, as well as the array itself.

char**
ContextPathMultiLookup(char *LkupPath);

Look up the LOIDs of a number of objects named in a "Unix-like" context path (absolute or relative path names are perfectly valid here). It's somewhat confusing as to what the parameter to this command means. Basically, the thing to do here is to indicate the context path you want a listing for, and append "/" and "*" to it.

Parameters:
Unclear, but basically the path you want a listing of with
"/ *" appended to it. I.e., if you want a listing of
/home/mark, the parameter should be
"/home/mark/ *".

(NOTE, in the above paragraph, there are spaces
between / and * that should be removed. These are there
to keep the C compiler from thinking we are commenting.)

Return Values:
NULL terminated array of context space names for
objects in the indicated context. In other words, each
element of the array is a char*, which is either
the context name of an object, or NULL if it is the end of
the list.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing each non-NULL entry
in the array, as well as the array itself.

int
ContextAdd(char *Name, char *Loid);

Add an entry to the current context. This new entry will have the indicated name, and will point to the object with the given LOID. This command assumes that the name is in the current context (not a full path).

Parameters:
Name = The name to add to the current context
Loid = The LOID of the object to link into context
space.

Return Values:
1 on Success
0 on Failure

User Responsibility:
None

int
ContextRemove(char *Name);

Remove an entry from the current context. This entry must be in the current context. It cannot be a path name, but only a current context entry.

Parameters:
Name = The name to remove from context space.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
ContextPathAdd(char *Name, char *Loid);

Add an entry to context space. This new entry will have the indicated name, and will point to the object with the given LOID. This command allows relative and absolute paths in context space to be added.

Parameters:
Name = The name to path to add to context space
LOID = The LOID of the object to link into context
space.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
ContextPathRemove(char *Name);

Remove a path from context space.

Parameters:
Name = The path to remove from context space.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

char*
ContextSingleReverseLookup(
LegionIdType IdType, char *ObjName
);

Try and obtain a context path name for a given object. This command uses the object's attributes to determine this name and only returns the first name found. Note that the attribute database may or may not actually reflect the object's actual context space names

Parameters:
IdType = Indicates whether the ObjName gives a
context path name or a LOID.
ObjName = Either the context name, or the LOID of the
object to reverse lookup.

Return Values:
First context path name of the object looked up.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the name returned.

char**
ContextMultiReverseLookup(
LegionIdType, char *ObjName, int MaxNum
);

Try and obtain a list of context path names for a given object. This command uses the object's attributes to determine these names and only returns the first "MaxNum" entries found. Note that the attribute database may or may not actually reflect the object's actual context space names.

Parameters:
IdType = Indicates whether the ObjName gives a
context path name or a LOID.
ObjName = Either the context name, or the LOID of the
object to reverse lookup.
MaxNum = Maximum number of entries to return.

Return Values:
First "MaxNum" context path names of the object. These
paths are stored in a NULL terminated array of strings.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing each name returned
in the list well as the list itself.

char*
ContextPWD();

Return the context path name of the current context.

Parameters: None

Return Values:
context path name of the current context.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the context path
name returned.

char*
legion_mkdir(char *PathName);

Creates a new context named by the given path.

Parameters:
PathName = The new context's path name.

Return Values:
LOID of the new context that was created.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the context LOID.

int
legion_cd(char *PathName);

Change the current context to the one named in the path. NOTE that this only changes the current context for the running program, not for the shell or program that executed the program.

Parameters:
Pathname of the context to change to.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

Directory of Legion 1.6.4 Manuals
[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

Free JavaScripts provided by The JavaScript Source

legion@Virginia.edu
http://legion.virginia.edu/