
struct String
{
  ULONG bufLen;  /* sizeof buffer, including NUL byte */
  char * buffer;
};

struct Client
{
  struct Node node;
  time_t timeStamp;
  BOOL firstTime;
  struct String * hostName;
  struct String * userName;
  struct String * realName;
  struct String * winOpen;
  struct String * comment;
  struct String * listString;
  int viewOffset;  /* For scrolling a string across the listView! */
};


int DoAction(int index, int action, BOOL BConfirm);
BOOL ConnectToServer(struct WindowStuff *, char * szPeerName);
BOOL PingServer(struct WindowStuff * win, struct SocketStuff * sSocket, char * szComment);
void DoPeriodicUpdates(struct WindowStuff * win, struct SocketStuff * sSocket, struct TimerStuff * timer);
void DoRefresh(void);
struct CxStuff * SetupCxStuff(struct CxStuff * teardown, int pri, char * popkey);
void SetMenuValues(void);
void ListClicked(int index);
char * GetDisplayListItem(int index);
int GetNumItems(struct List * list);
BOOL ParseBool(char * string);
int getActionCycleWidth(struct WindowStuff * win);
int UpdateActions(struct WindowStuff * win, char * command);
void debug(int n);
void FreeStringArray(char ** array);
int ParseOutputLevel(char * name);
int ParseViewBy(char * keyword);
char * GetOutputLevelName(int id);
char * GetViewByName(int k);

/* Call these to update program state & GUI */
void SetCommentString(struct WindowStuff * win, char * newVal, BOOL BFinal);
void SetServerString(struct WindowStuff * win, char * newVal);
void SetPortNumber(struct WindowStuff * win, int nPort);
void SetCurrentActionIndex(struct WindowStuff * win, int code);
void SetCurrentAction(struct WindowStuff * win, char * name);
void SetViewBy(ULONG ulItemCode);
void SetVisibleTo(char * visibleTo);
void StatMessage(char *);

int GetTrackHostByName(char * name);
int GetTrackActionByName(char * name);

/* Bare-naked variables for TrackRexx_rxif.c ... should probably
   have accessor functions but I'm too lazy ;) */
extern int nPort, currentAction, nLastEntryClicked;
extern BOOL BConfirmAppLaunch, BSendGoodbye, BEnabled;
extern int nNumActions;

extern int nWinLeft;
extern int nWinTop;
extern int nWinWidth;
extern int nWinHeight;

extern char * ActionLabels[20], * Actions[20];
extern char * szServerName;
extern char szMyHostName[100];

extern long lLastChangeAt;
