Retrieves the next project from the specified project database.
The libaacct.a library.
The getnextprojdb subroutine retrieves the next project definitions from the project database named through the handle parameter. The caller must initialize the project database prior to calling this routine with the projdballoc routine. Upon successful completion, the project information is copied to the project structure specified by the caller. In addition, the associated project comment, if present, is copied to the buffer pointed to by the comm parameter. The comment buffer is allocated by the caller and must have a length of 1024 bytes.
There is an internal state (that is, the current project) associated with the project database. When the project database is initialized, the current project is the first project in the database. The getnextprojdb subroutine returns the current project and advances the current project assignment to the next project in the database so that successive calls read each project entry in the database. When the last project is read, the current project assignment is advanced to the end of the database. Any attempt to read beyond the end of the project database results in a failure.
Item | Description |
---|---|
handle | Pointer to the projdb handle. |
project | Pointer to project structure where the retrieved data is stored. |
comm | Comment associated with the project in the database. |
No restriction. Any user can call this function.
Item | Description |
---|---|
0 | Success |
-1 | Failure |
Item | Description |
---|---|
EINVAL | Invalid arguments, if passed pointer is NULL. |
ENOENT | End of the project database. |
ENOENT | No projects available. |