Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

cmdhandler.c File Reference

#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <neuro/stringtable.h>
#include <neuro/cmdhandler.h>
#include "nsutil.h"
#include "nsnet.h"
#include "nsd.h"

Go to the source code of this file.

Data Structures

struct  ClientState
struct  CommandEntry
struct  CommandHandler

Defines

#define MAXTOKENS   256

Functions

CommandHandlernewCommandHandler (void)
void freeValues (struct StringTable *st, const char *key, void *val, void *udata)
void freeCS (struct StringTable *st, const char *key, void *val, void *udata)
void freeCommandHandler (struct CommandHandler *ch)
void newClientStarted (struct CommandHandler *ch, int cliIndex)
void enregisterCommand (struct CommandHandler *ch, const char *cmd, void(*func)(struct CommandHandler *ch, int))
void handleLine (struct CommandHandler *ch, const char *line, int cliIndex)
int fetchIntParameters (struct CommandHandler *ch, int *vals, int num)
const char * fetchCommandName (struct CommandHandler *ch)
const char * fetchStringParameter (struct CommandHandler *ch, int which)


Define Documentation

#define MAXTOKENS   256
 

Definition at line 10 of file cmdhandler.c.


Function Documentation

void enregisterCommand struct CommandHandler ch,
const char *  cmd,
void(*  func)(struct CommandHandler *ch, int)
 

Definition at line 77 of file cmdhandler.c.

References putString().

const char* fetchCommandName struct CommandHandler ch  ) 
 

Definition at line 200 of file cmdhandler.c.

References CommandHandler::curClient, and ClientState::tokens.

int fetchIntParameters struct CommandHandler ch,
int *  vals,
int  num
 

Definition at line 192 of file cmdhandler.c.

References CommandHandler::curClient, and ClientState::tokens.

Referenced by cmdDataFrame(), cmdGetHeader(), cmdgo(), cmdnogo(), cmdUnwatch(), and cmdWatch().

const char* fetchStringParameter struct CommandHandler ch,
int  which
 

Definition at line 205 of file cmdhandler.c.

References CommandHandler::curClient, and ClientState::tokens.

void freeCommandHandler struct CommandHandler ch  ) 
 

Definition at line 50 of file cmdhandler.c.

References allStrings(), CommandHandler::clients, CommandHandler::cmds, freeCS(), freeStringTable(), and freeValues().

void freeCS struct StringTable st,
const char *  key,
void *  val,
void *  udata
 

Definition at line 41 of file cmdhandler.c.

Referenced by freeCommandHandler().

void freeValues struct StringTable st,
const char *  key,
void *  val,
void *  udata
 

Definition at line 36 of file cmdhandler.c.

Referenced by freeCommandHandler().

void handleLine struct CommandHandler ch,
const char *  line,
int  cliIndex
 

Definition at line 168 of file cmdhandler.c.

References CommandHandler::clients, CommandHandler::cmds, CommandHandler::curClient, findString(), ClientState::tokenCount, and ClientState::tokens.

Referenced by main().

void newClientStarted struct CommandHandler ch,
int  cliIndex
 

Definition at line 69 of file cmdhandler.c.

References CommandHandler::clients, and putString().

Referenced by makeNewClient().

struct CommandHandler* newCommandHandler void   ) 
 

Definition at line 27 of file cmdhandler.c.

References newStringTable().

Referenced by main().


Generated on Tue Feb 8 00:05:17 2005 for Neuroserver by doxygen 1.3.3