This file describes SGS's C API.  The SGAnswer structure is declared in
api/sgsCommon.h.

Functions by Alphabetical Order

	Connecting to the sequence daemon	sgsSetHostname()

	Creating and Destroying Sequences	sgsCreateSequence()
						sgsDropSequence()

	Getting Sequence Numbers		sgsCurrentValue()
						sgsNextValue()

	Managing Sequences			sgsCache()
						sgsIncrement()
						sgsSetCache()
						sgsSetIncrement()
						sgsSetValue()

Functions Descriptions
======================

int sgsCache(const char *name);

	Returns the number of cached entries for the 'name' sequence,
	or -1 if there was an error.


int sgsCreateSequence(const char *name);

	Returns 1 if the 'name' sequence was created successfully, 0
	otherwise.


SGAnswer sgsCurrentValue(const char *name);

	Returns 1 in the returnStatus element of the SGAnswer struct and
	the current value of the 'name' sequence in the value element of
	the struct upon success, 0 in the returnStatus otherwise.


int sgsDropSequence(const char *name);

	This function removes the 'name' sequence from the sequence
	generation system.  Returns 1 upon success, 0 otherwise.


SGAnswer sgsIncrement(const char *name);

	Returns the increment by which the sequence values grow.  The
	returnStatus element contains 1 upon success, 0 otherwise.


SGAnswer sgsNextValue(const char *name);

	Returns the next value in the 'name' sequence if it exists and
	increments the current value of the sequence.  The returnStatus
	element of the SGAnswer struct that is returned by the function
	contains 1 upon success, 0 otherwise.


int sgsSetCache(const char *name, unsigned char newCache);

	Attempts to set the number of cached entries for the 'name' sequence
	in the sequence's definition.  The returnStatus element of the
	SGAnswer struct returned by the function contains 1 upon success,
	0 otherwise.

	When the number of cached entries is zero, SGS will fetch the next
	value from the values file each time it receives a "nextValue"
	request. 


int sgsSetHostname(const char *name);

	Informs the API that all subsequent calls to sgs in the current
	application should be sent to the sgs daemon running on the
        host identified by 'name'.


int sgsSetIncrement(const char *name, unsigned int newIncrement);

	Sets the increment by which the numbers in the sequence grow. Returns
	1 upon success, 0 otherwise.


int sgsSetValue(const char *name, unsigned int newValue); 

	Sets the current value for the 'name' sequence.  Returns 1 if the
	value was set successfully, 0 otherwise.


Copyright (C) 1995 Pascal Forget