Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getvec(3C) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

acc_vector(4)

getvec(3C)

NAME

getvec, getvecid, setvec, endvec, fgetvec − get access vector file entry

SYNOPSIS

#include <acc_vec.h>

struct vector ∗getvec ( )

struct vector ∗getvecid (uid, gid)
int uid, gid;

void setvec ( )

void endvec ( )

struct vector ∗fgetvec (f)
FILE ∗f;

DESCRIPTION

getvec and getvecid each return a pointer to an object with the following structure containing the broken-out fields of a line in the /etc/acc_vector file.  Each line in the file contains a vector structure, declared in the <acc_vec.h> header file:

struct vector {
intvec_uid;
intvec_gid;
intvec_priv[2];
};

This structure is declared in <acc_vec.h> so it is not necessary to redeclare it.  The fields have meanings described in acc_vector(4). 

getvec when first called returns a pointer to the first vector structure in the file; thereafter, it returns a pointer to the next vector structure in the file; so successive calls can be used to search the entire file.  If an end-of-file or an error is encountered on reading, a NULL pointer is returned. 

Getvecid searches from the beginning of the file until a numerical user id matching uid is found and returns a pointer to the particular structure in which it was found.  If there is no match for uid, then getvecid searches for a numerical group id matching gid. Setting either uid or gid to -1 will cause that parameter to be ignored.  If an end-of-file or an error is encountered on reading, a NULL pointer is returned. 

A negative value returned for the vec_uid or vec_gid field implies a null value for that field in the acc_vector file. 

A call to setvec has the effect of rewinding the acc_vector file to allow repeated searches.  Endvec may be called to close the acc_vector file when processing is complete. 

Fgetvec returns a pointer to the next vector structure in the stream f, which matches the format of /etc/acc_vector. 

FILES

/etc/acc_vector

SEE ALSO

acc_vector(4). 

DIAGNOSTICS

A NULL pointer is returned on EOF or error. 

WARNING

The above routines use <stdio.h>, which causes them to increase the size of programs, not otherwise using standard I/O, more than might be expected. 

BUGS

All information is contained in a static area, so it must be copied if it is to be saved. 

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026