/********************************************************
 * messages.h
 *
 * Message protocol for communicating between clients and servers
 *
 * Author:  Michael Goldwasser (wass@cs.princeton.edu)
 * Created: Jan 16, 1998
 *******************************************************/

#ifndef _MESSAGES
#define _MESSAGES


#define  MAX_MSIZE 100    /* maximum length of message */
#define  MAX_CODE 1       /* maximum length of codeword */


/********************************************************
 *  Query:  How many data points are in the original data set?
 *  Client Message:  "P"
 *  Server Response: "<num>",  where num is an integer
 *******************************************************/
static char Protocol_NumPoints[] = "P";


/********************************************************
 *  Query:  How many query points are available?
 *  Client Message:  "Q"
 *  Server Response: "<num>", where num is an integer
 *******************************************************/
static char Protocol_NumQuery[] = "Q";


/********************************************************
 *  Query:  What is the distance between points i and j?
 *  Client Message:  "D <i> <j>"
 *  Server Response: "<dist>", where dist is a floating point
 *******************************************************/
static char Protocol_Dist[] = "D";


/********************************************************
 *  Query:  How many fields in the associated data for point i?
 *  Client Message:  "A <i>"
 *  Server Response: "<string>"
 *******************************************************/
static char Protocol_NumFields[] = "A";


/********************************************************
 *  Query:  What is the associated data in field f, for point i?
 *  Client Message:  "F <i> <f>"
 *  Server Response: "<string>"
 *******************************************************/
static char Protocol_Field[] = "F";


/********************************************************
 *  Unknown Query:  If the server ever receives a query which does not
 *  match one of the above, rather than not respond, it responds that
 *  it received an unknown query as follows.
 *
 *  Server Response: "U"
 *******************************************************/
static char Protocol_Unknown[] = "U";

#endif
