Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

project_walk(3project) [plan9 man page]

project_walk(3PROJECT)													    project_walk(3PROJECT)

NAME
project_walk - visit active project IDs on current system SYNOPSIS
cc [ flag ... ] file... -lproject [ library ... ] #include <project.h> int project_walk(int (*callback)(const projid_t project, void *walk_data), void *init_data); The project_walk() function provides a mechanism for the application author to examine all active projects on the current system. The callback function provided by the application is given the ID of an active project at each invocation and can use the walk_data to record its own state. The callback function should return non-zero if it encounters an error condition or attempts to terminate the walk prema- turely; otherwise the callback function should return 0. Upon successful completion, project_walk() returns 0. It returns -1 if the callback function returned a non-zero value or if the walk encountered an error, in which case errno is set to indicate the error. The project_walk() function will fail if: ENOMEM There is insufficient memory available to set up the initial data for the walk. Other returned error values are presumably caused by the callback function. Example 1: Count the number of projects available on the system. The following example counts the number of projects available on the system. #include <sys/types.h> #include <project.h> #include <stdio.h> typedef struct wdata { uint_t count; } wdata_t; wdata_t total_count; int simple_callback(const projid_t p, void *pvt) { wdata_t *w = (wdata_t *)pvt; w->count++; return(0); } ... total_count.count = 0; errno = 0; if ((n = project_walk(simple_callback, &total_count)) >= 0) (void) printf("count = %u ", total_count.count); See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ getprojid(2), libproject(3LIB), settaskid(2), attributes(5) 7 Oct 2003 project_walk(3PROJECT)

Check Out this Related Man Page

project_walk(3PROJECT)													    project_walk(3PROJECT)

NAME
project_walk - visit active project IDs on current system SYNOPSIS
cc [ flag ... ] file... -lproject [ library ... ] #include <project.h> int project_walk(int (*callback)(const projid_t project, void *walk_data), void *init_data); The project_walk() function provides a mechanism for the application author to examine all active projects on the current system. The callback function provided by the application is given the ID of an active project at each invocation and can use the walk_data to record its own state. The callback function should return non-zero if it encounters an error condition or attempts to terminate the walk prema- turely; otherwise the callback function should return 0. Upon successful completion, project_walk() returns 0. It returns -1 if the callback function returned a non-zero value or if the walk encountered an error, in which case errno is set to indicate the error. The project_walk() function will fail if: ENOMEM There is insufficient memory available to set up the initial data for the walk. Other returned error values are presumably caused by the callback function. Example 1: Count the number of projects available on the system. The following example counts the number of projects available on the system. #include <sys/types.h> #include <project.h> #include <stdio.h> typedef struct wdata { uint_t count; } wdata_t; wdata_t total_count; int simple_callback(const projid_t p, void *pvt) { wdata_t *w = (wdata_t *)pvt; w->count++; return(0); } ... total_count.count = 0; errno = 0; if ((n = project_walk(simple_callback, &total_count)) >= 0) (void) printf("count = %u ", total_count.count); See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ getprojid(2), libproject(3LIB), settaskid(2), attributes(5) 7 Oct 2003 project_walk(3PROJECT)
Man Page