/* teamtrack-server.h -- Python wrapper round TSServer class
   Gareth Rees, Ravenbrook Limited, 2000-08-08
   $Id: //info.ravenbrook.com/project/p4dti/branch/2000-12-07/document-history/code/python-teamtrack-interface/teamtrack-server.h#2 $

   See "Python interface to TeamTrack: design" for the design
   <master/design/python-teamtrack-interface/>. */

/* Copyright 2000 Ravenbrook Limited.  This document is provided "as is",
   without any express or implied warranty. In no event will the authors
   be held liable for any damages arising from the use of this document.
   You may make and distribute copies and derivative works of this
   document provided that (1) you do not charge a fee for this document or
   for its distribution, and (2) you retain as they appear all copyright
   and licence notices and document history entries, and (3) you append
   descriptions of your modifications to the document history. */

#if !defined(TEAMTRACK_SERVER_H)
#define TEAMTRACK_SERVER_H


#include "teamtrack-python.h"
#include "TSServer.h"


/* A teamtrack_server object is a Python wrapper around a TSServer object. */

typedef struct {
  PyObject_HEAD
  TSServer *s;
  int delete_p; /* Delete the TSServer object when Python wrapper deleted? */
} teamtrack_server;


/* teamtrack_server_type is the type object for teamtrack_server objects. */

extern PyTypeObject teamtrack_server_type;


/* teamtrack_server_p(x) is true iff x (which must be a Python object) is a
   teamtrack_server. */

#define teamtrack_server_p(x) ((x)->ob_type == &teamtrack_server_type)


/* teamtrack_server_new(s, delete_p) returns a Python wrapper for the TSServer
   object s, or 0 if there is an error.  Iff delete_p is true, then the
   TSServer object will be deleted when the Python wrapper is deleted. */

extern PyObject *teamtrack_server_new(TSServer *s, int delete_p);


#endif /* !defined(TEAMTRACK_SERVER_H) */


/* B. Document History

   2000-08-08 GDR Created.

   2000-08-29 GDR Changed "tTrack" to "TeamTrack" throughout.

*/

