NAME
Query Results -
List results are returned as globus_list_t’s, list datums depend on the
type of query (eg globus_rls_string2_t, globus_rls_attribute_t, etc).
Data Structures
struct globus_rls_attribute_object_t
globus_rls_client_lrc_attr_search() returns a list of these
structures which include the object name (LFN or PFN) and attribute
value found by the query.
struct globus_rls_string2_t
String pair result.
struct globus_rls_string2_bulk_t
String pair result with return code, returned by bulk query
operations.
Functions
globus_result_t globus_rls_client_free_list (globus_list_t *list)
Detailed Description
List results are returned as globus_list_t’s, list datums depend on the
type of query (eg globus_rls_string2_t, globus_rls_attribute_t, etc).
A list result should be freed with globus_rls_client_free_list() when
it’s no longer needed. RLS supports limiting the number of results
returned by a single query using an offset and reslimit. The offset
specifies which result to begin with, reslimit specifies how many
results to return. Offset should begin at 0 to retrieve all records. If
reslimit is 0 then all results are returned at once, unless the server
has a limit on results configured. If NULL is passed as the offset
argument then the API will repeatedly call the query function until are
results are retrieved. The following are equivalent examples of how to
print the lfn,pfn pairs returned by globus_rls_client_lrc_get_lfn():
globus_list_t *str2_list;
globus_list_t *p;
globus_rls_string2_t *str2;
// Retrieve all results, API will handle looping through partial results
// if the server has a limit configured. Error handling has been omitted.
globus_rls_client_lrc_get_lfn(h, "somepfn", NULL, 0, &str2_list);
for (p = str2_list; p; p = globus_list_rest(p)) {
str2 = (globus_rls_string2_t *) globus_list_first(p);
printf("lfn: %s pfn:%s0, str2->s1, str2->s2);
}
globus_rls_client_free_list(str2_list);
// This code fragment retrieves results 5 at a time. Note offset is set
// to -1 when the server has no more results to return.
int offset = 0;
while (globus_rls_client_lrc_get_lfn(h, "somepfn", &offset, 5, &str2_list) == GLOBUS_SUCCESS) {
for (p = str2_list; p; p = globus_list_rest(p)) {
str2 = (globus_rls_string2_t *) globus_list_first(p);
printf("lfn: %s pfn:%s0, str2->s1, str2->s2);
}
globus_rls_client_free_list(str2_list);
if (offset == -1)
break;
}
.fi
Function Documentation
globus_result_t globus_rls_client_free_list (globus_list_t * list)
Free result list returned by one of the query functions. Parameters:
list List returned by one of the query functions.
Return values:
GLOBUS_SUCCESS List and contents successfully freed.
Author
Generated automatically by Doxygen for globus rls client from the
source code.