Misc Operations:

    int unify_startup(int argc, char *argv[] );

            Purpose  : Initialize Unify
	    Args     : arc     - argument count
		       argv    - argument vector
	    Returns  : 0 if successful;
		       -1 if unsuccessful.

Segment Operations:

    int Create_Seg(unsigned char type,
		   unsigned char status,
		   unsigned char prot,
		   unsigned len,
		   unsigned align)

	    Purpose  : Allocates a segment.
	    Args     : type    - segment type: one of
				    - RANDOM_SEGMENT,
			     	    - ASSOCIATIVE_SEGMENT
				    - SEQUENTIAL_SEGMENT.
	               status  - segment status: one of
				    - LOCAL_SEGMENT
				    - SHARED_SEGMENT
	               prot    - protection specification: any of
				    - X_ACCESS
				    - W_ACCESS
				    - R_ACCESS
	               len     - requested length of segment in bytes.
		       align   - bytes alignment.
	    Returns  : Allocated segment id if successful;
	               -1 if unsuccessful.


    int Get_Limit(int seg_id,
		  unsigned *wrap,
		  unsigned *writep)

	    Purpose  : Returns the limit of a sequential segment.
	    Args     : seg_id - Identifier of the segment in which to query.
	               wrap - wrap count of the segment.
	               writep - index limit of the current wrap count.
	    Returns  :  0 if successful;
	               -1 if unsuccessful.


    int Get_Updates(int seg_id)

	    Purpose  : Obtains updates of a segment.
	    Args     : seg_id - identifier of the segment.
	    Returns  : 0  on success;
	               -1 on failure.


    int Get_Updates_LL(int seg_id)

	    Purpose  : Sets a local lock and obtains updates of a segment.
	    Args     : seg_id - identifier of the segment.
	    Returns  : 0  on success;
	               -1 on failure.


    int Release_LL(int seg_id)

	    Purpose  : Releases a local lock of a segment.
	    Args     : seg_id - identifier of the segment.
	    Returns  : 0  on success;
	               -1 on failure.


    int Need_Updates(int seg_id)

	    Purpose   : Adds a site to the copy set of a segment.
	    Args      : seg_id - segment identifier.
	    Returns   : 0 on success;
	                Currently aborts on failure.


    int Dont_Need_Updates(int seg_id)

	    Purpose   : Removes a worker from the copy set of a segment.
	    Args      : seg_id - segment identifier.
	    Returns   : 0 on success;
	                Currently aborts on failure.


    int Put_Updates(int seg_id,
		    enum send_type send_type)

	    Purpose  : Distributes the updates to a segment to all workers
		       in the segment's copy set.
	    Args     : seg_id - identifier of the segment in which the updates
	                        are to be distributed.
 	       	       send_type - specifies if the anticipated network behavior
			           is to be in a multicast (Multicast) or a
			           concast (Concast) mode.
	    Out      : Nothing.
	    Returns  : 0  on success;
	               -1 on failure.


    Seg_Adr(int seg_id)
	    Purpose  : Gives the starting address of a segment.
	    Args     : Given segment identifier.
	    Returns  : Starting virtual address of the segment;
		       NULL on error.

    int Seq_Read(seg_id_type seg, char *buff, int len)
	    Purpose  : Reads froma sequential segment, blocking until len
		       bytes have been read.
            In       : seg  - Identifier of the segment from which to read
			     (must identify a sequential segment).
		       buff - destination buffer.
		       len  - # bytes in which to read.
	    Out      : Nothing.
	    Returns  : # bytes read if successful;
	    	       -1 if unsuccessful.

    Seq_Write(int seg,
	      char *buff,
	      unsigned len)
	    Purpose  : Writes to a sequential segment.
	    In       : seg  - Identifier of the sequential segment in which
			      to write.
	               buff - buffer containing the update.
	               len  - # bytes in which to write.
	    Out      : Nothing.
	    Returns  : 0  if successful;
	               -1 if unsuccessful.


    Seq_Wakeup(int seg_id,
	       unsigned wrap,
	       unsigned writep)

	    Purpose  : Blocks a process until a sequential segment has
		       reached a certain length.
	    Args     : seg_id - Identifier of the segment in which to block.
	             : wrap   - wrap count value on which to unblock.
	               writep - write pointer value on which to unblock.
	    Returns  :  0 if successfull;
	               -1 if unsuccessful.


Event Operations:


    int Create_Event()

	    Purpose  : Allocates an event.
	    Args     : Nothing.
	    Returns  : Event identification if successful;
		       -1 if not successful.


    int Advance(int event)

	    Purpose  : Advances a given event counter.
	    Args     : event - event for which to advance.
	    Returns  : 0  if successful.
      		       -1 if not successful.


    int Advance_N(int event,
                  unsigned int n)

	    Purpose  : Advances a given eventcount by n.
	    Args     : event - event for which to advance.
	    Returns  : 0  if successful.
      		       -1 if not successful.


    int Read_Count(int event)

	    Purpose  : Gives the count of an event.
	    Args     : event - specified event.
	    Returns  : Current local count of the event.
      		       -1 if not successful.


    int Await(int event,
	      int count)

	    Purpose  : Waits for an event to reach a specified count.
	    In       : event - specified event.
      		       count - event count specification on which to unblock.
	    Out      : Nothing.
	    Returns  : New count of the event.
      		       -1 if not successful.


    int Await_with_Timeout(int event,
                           int count,
                           struct timeval *timeout)

	    Purpose  : Waits for an event to reach a specified count or
                       until timeout expires.
	    In       : event - specified event.
      		       count - event count specification on which to unblock.
                       timeout - maximum time to wait.
	    Out      : Nothing.
	    Returns  : New count of the event (could be less than specified
                       count).
      		       -1 if not successful.


Sequencer Operations:

    int Create_Sequencer(int seq_type)

	    Purpose : Allocates a sequencer.
            Args    : seq_type - sequencer type: one of
				  - SEQUENTIAL_TICKETS,
                                  - RANDOM_TICKETS.
	    Args    : Nothing.
	    Returns : Allocated sequencer id;
		      -1 on error.


    int Destroy_Sequencer(int sequencer)

	    Purpose : Deallocates a sequencer.
	    Args    : Sequencer id to deallocate;
	    Returns : 0 on success.
		      -1 on error.


    int Get_Ticket(int sequencer)

	    Purpose : Obtains a ticket.
	    Args    : sequencer - specifed sequencer.
	    Returns : Allocated ticket on success (> 0);
		      -1 on error.
