typedef struct header {
	/* put contents of header here.  Don't need anything for now */
} PhFormHead, *PhHeader;

Typedef	PhHeader **PhHeaderListr;

typedef struct template {
	/* put contents of template here.  Don't need anything for now */
} PhFormTemplate, *PhTemplate;

typedef struct value {
	/* contents will be a fieldname/fieldvalue pair */
	/* Don't need anything for now */
} FormValue, *PhValue, **PhValuelist;

typedef struct form {
	PhHeader	header;
	PhTemplate	template;
	PhValuelist	valuelist;
} PhForm;

Typedef	PhHeader *PhHeaderList;


Global notes:  Unless otherwise noted, routines malloc space for their
return values, and the calling routine is responsible for freeing this space.


PhHeaderList	PhListFormsByType(type)
char	*type;
/*
** Returns a list of all forms of the given type.
*/


PhHeaderList	PhListFormsByOwner(owner)
char	*owner;
/*
** Returns a list of all forms assigned to this owner.
*/

PhHeaderList	PhListFormsByValues(type, valuelist)
char		*type;
PhValueList	valuelist;
/*
** Returns a list of all forms of the given type, and whose field/value pairs
** match the field/value pairs given in the valuelist;
*/

char	**PhListFormTypes()
/*
** Returns a list of all types of forms currently in Phaedo.
*/


PhForm	PhNewForm(type)
char	*type;
/*
**  Returns a new form of the specified type, with default values filled
**  in.
*/


int	PhCheckinForm(form)
PhForm	form;

int	PhCheckoutForm(form)
PhForm	form;
/*
**  Check in and check out the designated form.  Return value is 0 if
**  everything went okay, an error code if something went wrong.
*/


int	PhDeleteForm(form)
PhForm	form;
/*
**  Delete the designated form from Phaedo's records.  Return value is 0 if
**  everything went okay, an error code if something went wrong.
*/


PhTemplate	PhGetTemplate(type)
char	*type;
/*
**  Return the template for the specified type of form.
*/


PhForm	PhGetForm(header)
PhHeader	header;
/*
**  Get the body of the form pointed to by the passed header.
*/


void	PhRecalculate(inform,outform)
PhForm	inform;
PhForm	outform;

/*
** Run queries to recalculate new values of the form's automatically-filled-in
** fields  (For example, someone's phone number would be recalculated
** once the user was done filling in the name.  The UI module is assumed
** to do the local-only recalculations and redisplays, such as making fields
** appear and disappear if they only depend on other fields w/in the form,
** and maintaining running totals if a field displays a sum of other fields.)
**
** 'inform' is the input to the function, and 'outform' is the reply
** containing updated values.  The calling routine is expected to copy the
** desired new values from 'outform' to its private copy of the form's data,
** and then free outform.
*/


int	PhAuthenticate(name, password)
char	*name;
char	*password;
/*
**  Present name/password to Phaedo for Kerberos authentication.  Returns
**  0 if everything went okay, an error number if something went wrong.
*/


int	PhInitialize()
int	PhCloseup()
/*
**  Perform whatever initialization and shutdown is needed by Phaedo.
*/
