NEURON
nrnbbs.cpp File Reference
#include <../../nrnconf.h>
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <OS/list.h>
#include "nrnbbs.h"
#include <sys/file.h>

Go to the source code of this file.

Classes

class  NrnBBSCallbackItem
 

Macros

#define HISTORY   0
 
#define NRNBBSTMP   "nrnbbs"
 
#define NOTIFY   "notify"
 
#define NRNBBS   "nrnbbs"
 
#define LOCKFILE   "lock"
 
#define TMPFILE   "temp"
 
#define NOTIFY_SIGNAL   SIGUSR1
 

Functions

static const char * fname (const char *name)
 
static void history (const char *s1, const char *s2, const char *s3)
 
static void history (const char *s1)
 
static void history (const char *s1, const char *s2)
 
static void history (const char *s1, int i)
 
 declarePtrList (NrnBBSCallbackList, NrnBBSCallbackItem) implementPtrList(NrnBBSCallbackList
 
static void get_lock ()
 
static void release_lock ()
 
static const char * nrnbbsdir ()
 
bool nrnbbs_connect ()
 
void nrnbbs_disconnect ()
 
bool nrnbbs_connected ()
 
void nrnbbs_wait (bool *pflag)
 
void nrnbbs_post (const char *key)
 
void nrnbbs_post_int (const char *key, int ival)
 
void nrnbbs_post_string (const char *key, const char *sval)
 
bool nrnbbs_take (const char *key)
 
bool nrnbbs_take_int (const char *key, int *ipval)
 
bool nrnbbs_take_string (const char *key, char *sval)
 
bool nrnbbs_look (const char *key)
 
void nrnbbs_exec (const char *cmd)
 
static RETSIGTYPE nrnbbs_handler (int)
 
void nrnbbs_notify (const char *key, NrnBBSCallback cb)
 

Variables

static NrnBBSCallbackItem NrnBBSCallbackList * cblist_
 
static FILE * lockfile_
 
static bool connected_
 

Macro Definition Documentation

◆ HISTORY

#define HISTORY   0

Definition at line 25 of file nrnbbs.cpp.

◆ LOCKFILE

#define LOCKFILE   "lock"

Definition at line 30 of file nrnbbs.cpp.

◆ NOTIFY

#define NOTIFY   "notify"

Definition at line 28 of file nrnbbs.cpp.

◆ NOTIFY_SIGNAL

#define NOTIFY_SIGNAL   SIGUSR1

Definition at line 32 of file nrnbbs.cpp.

◆ NRNBBS

#define NRNBBS   "nrnbbs"

Definition at line 29 of file nrnbbs.cpp.

◆ NRNBBSTMP

#define NRNBBSTMP   "nrnbbs"

Definition at line 27 of file nrnbbs.cpp.

◆ TMPFILE

#define TMPFILE   "temp"

Definition at line 31 of file nrnbbs.cpp.

Function Documentation

◆ declarePtrList()

declarePtrList ( NrnBBSCallbackList  ,
NrnBBSCallbackItem   
)

◆ fname()

static const char * fname ( const char *  name)
static

Definition at line 108 of file nrnbbs.cpp.

◆ get_lock()

static void get_lock ( )
static

Definition at line 71 of file nrnbbs.cpp.

◆ history() [1/4]

static void history ( const char *  s1,
const char *  s2,
const char *  s3 
)
static

Definition at line 47 of file nrnbbs.cpp.

◆ history() [2/4]

static void history ( const char *  s1)
static

Definition at line 57 of file nrnbbs.cpp.

◆ history() [3/4]

static void history ( const char *  s1,
const char *  s2 
)
static

Definition at line 58 of file nrnbbs.cpp.

◆ history() [4/4]

static void history ( const char *  s1,
int  i 
)
static

Definition at line 59 of file nrnbbs.cpp.

◆ nrnbbs_connect()

bool nrnbbs_connect ( )

Definition at line 118 of file nrnbbs.cpp.

◆ nrnbbs_connected()

bool nrnbbs_connected ( )

Definition at line 170 of file nrnbbs.cpp.

◆ nrnbbs_disconnect()

void nrnbbs_disconnect ( )

Definition at line 132 of file nrnbbs.cpp.

◆ nrnbbs_exec()

void nrnbbs_exec ( const char *  cmd)

Definition at line 299 of file nrnbbs.cpp.

◆ nrnbbs_handler()

static RETSIGTYPE nrnbbs_handler ( int  )
static

Definition at line 309 of file nrnbbs.cpp.

◆ nrnbbs_look()

bool nrnbbs_look ( const char *  key)

Definition at line 274 of file nrnbbs.cpp.

◆ nrnbbs_notify()

void nrnbbs_notify ( const char *  key,
NrnBBSCallback  cb 
)

Definition at line 321 of file nrnbbs.cpp.

◆ nrnbbs_post()

void nrnbbs_post ( const char *  key)

Definition at line 185 of file nrnbbs.cpp.

◆ nrnbbs_post_int()

void nrnbbs_post_int ( const char *  key,
int  ival 
)

Definition at line 189 of file nrnbbs.cpp.

◆ nrnbbs_post_string()

void nrnbbs_post_string ( const char *  key,
const char *  sval 
)

Definition at line 195 of file nrnbbs.cpp.

◆ nrnbbs_take()

bool nrnbbs_take ( const char *  key)

Definition at line 224 of file nrnbbs.cpp.

◆ nrnbbs_take_int()

bool nrnbbs_take_int ( const char *  key,
int ipval 
)

Definition at line 229 of file nrnbbs.cpp.

◆ nrnbbs_take_string()

bool nrnbbs_take_string ( const char *  key,
char *  sval 
)

Definition at line 238 of file nrnbbs.cpp.

◆ nrnbbs_wait()

void nrnbbs_wait ( bool *  pflag)

Definition at line 175 of file nrnbbs.cpp.

◆ nrnbbsdir()

static const char* nrnbbsdir ( )
static

Definition at line 91 of file nrnbbs.cpp.

◆ release_lock()

static void release_lock ( )
static

Definition at line 82 of file nrnbbs.cpp.

Variable Documentation

◆ cblist_

NrnBBSCallbackItem NrnBBSCallbackList* cblist_
static

Definition at line 68 of file nrnbbs.cpp.

◆ connected_

bool connected_
static

Definition at line 116 of file nrnbbs.cpp.

◆ lockfile_

FILE* lockfile_
static

Definition at line 69 of file nrnbbs.cpp.