/*
 * prot.h
 *
 * Version 1.0.1 : Frederick Roeber : 14 May 1993
 *
 * This file contains the type definitions and function call prototypes
 * for the unreleased prot_$ calls.
 */

#ifndef PROT_H
#define PROT_H

#include <apollo/base.h>

typedef enum
{
    prot_$user_owner = 0,
    prot_$user_project = 1,
    prot_$user_organization = 2,
    prot_$user_world = 3
} prot_$user_class_t;

typedef long prot_$user_class_set_t;

#define prot_$user_owner_mask           (1 << prot_$user_owner)
#define prot_$user_project_mask         (1 << prot_$user_project)
#define prot_$user_organization_mask    (1 << prot_$user_organization)
#define prot_$user_world_mask           (1 << prot_$user_world)

typedef long prot_$rights_t;

#define prot_$rights_read       0x01
#define prot_$rights_write      0x02
#define prot_$rights_execute    0x04
#define prot_$rights_search     0x08
#define prot_$rights_modify     0x10
#define prot_$rights_setid      0x20    /* setuid/setgid */
#define prot_$rights_sticky     0x20    /* same as prot_$rights_setid */

typedef prot_$rights_t prot_$rights_vec_t[4]; /* owner, project, org, world */

typedef uid_$t prot_$user_class_id_t;
typedef prot_$user_class_id_t prot_$user_class_id_vec_t[4];

void
prot_$inq_rights
(
    ios_$id_t &id,
    prot_$rights_vec_t rights_vector,
    prot_$user_class_set_t *valid_entries,  /* valid vector entries */
    status_$t *status
);

void
prot_$inq_user_class_ids
(
    ios_$id_t &id,
    prot_$user_class_set_t *valid_entries,  /* valid vector entries */
    prot_$user_class_id_vec_t uids,
    status_$t *status
);

/*
 * prot_$isa .. to be determined
 */

void
prot_$set_rights
(
    ios_$id_t &id,
    prot_$rights_vec_t rights_vector,
    prot_$user_class_set_t &valid_entries,  /* set only *these* rights */
    status_$t *status
);

void
prot_$set_user_class_ids
(
    ios_$id_t &id,
    prot_$user_class_set_t &valid_entries,  /* set only *these* uids */
    prot_$user_class_id_vec_t uids,
    status_$t *status
);

#endif /* PROT_H */

