Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

defs.h File Reference

#include "dbug.h"
#include <dlfcn.h>
#include <unistd.h>
#include <time.h>

Go to the source code of this file.

Defines

#define SLAVE_PORT   9001
#define CLIENT_PORT   9001
#define MASTER_HOST   "localhost"
#define MASTER_PORT   9000
#define SLAVE_HTTP_PORT   9001
#define MASTER_HTTP_PORT   9000
#define DLL_EXPORT   1
#define DLL_IMPORT   2
#define UDP_MAXSIZE   65000
#define UDP_SEND_TIMEOUT   1
#define UDP_SEND_COUNT   5
#define SZ_UCHAR   sizeof (uchar)
#define SZ_UINT   sizeof (uint)
#define SZ_PTR   sizeof (void *)
#define MAXERR_URL   1024
#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define SLV_API
#define SLV_SERV_LIB   "./slv_serv.so"
#define COM_API
#define LIB_HANDLE   void*
#define LIB_ERROR()   dlerror ()
#define LIB_SYMBOL(h, s)   dlsym (h, s)
#define LIB_LOAD(l)   dlopen (l, RTLD_NOW)
#define LIB_UNLOAD(h)   dlclose (h)
#define THRD_RETURN   void*
#define THRD_ARG   void*
#define THRD_HANDLE   pthread_t
#define THRD_KILL(x)   pthread_kill(x, SIGALRM);
#define FILE_OPEN   open
#define FILE_CLOSE   close
#define FILE_UNLINK   unlink
#define FILE_RENAME   rename
#define FILE_READ   read
#define FILE_WRITE   write
#define DIR_GETCWD   getcwd
#define DIR_MKDIR(d)   mkdir(d, S_IRUSR|S_IWUSR|S_IXUSR)
#define DIR_CHDIR   chdir
#define DIR_RMDIR   rmdir
#define SLEEP_SEC(t)
#define SLEEP_MSEC(t)
#define SOCK_ERRNO   errno
#define EXTRACT_FILENAME(s, result)

Typedefs

typedef unsigned char uchar
typedef unsigned int uint
typedef void *(* THRD_START )(void *)

Functions

int getURL (const char *url, const char *file, char *err=0)
int postURL (const char *url, const char *file,...)
void read_passwd (char *pswd, int maxlen)


Define Documentation

#define CLIENT_PORT   9001
 

Definition at line 8 of file defs.h.

#define COM_API
 

Definition at line 126 of file defs.h.

#define DIR_CHDIR   chdir
 

Definition at line 155 of file defs.h.

Referenced by main(), and Slave::put_data().

#define DIR_GETCWD   getcwd
 

Definition at line 153 of file defs.h.

Referenced by main().

#define DIR_MKDIR      mkdir(d, S_IRUSR|S_IWUSR|S_IXUSR)
 

Definition at line 154 of file defs.h.

Referenced by Slave::Slave(), and startup().

#define DIR_RMDIR   rmdir
 

Definition at line 156 of file defs.h.

Referenced by shutdown().

#define DLL_EXPORT   1
 

Definition at line 18 of file defs.h.

#define DLL_IMPORT   2
 

Definition at line 19 of file defs.h.

#define EXTRACT_FILENAME s,
result   
 

Value:

{\
    const char *_E_F_p, *_E_F_q = s; \
    while ((_E_F_p = strchr(_E_F_q, '/'))) _E_F_q = _E_F_p + 1; \
    result = _E_F_q; \
}

Definition at line 199 of file defs.h.

Referenced by event_slave_avail(), event_task_finish(), Client::get_data(), process_utilities(), Client::put_data(), submit_executable_task(), and taskExec().

#define FILE_CLOSE   close
 

Definition at line 148 of file defs.h.

Referenced by copy_file(), slaveNewUpgrade(), and Slave::slaveUpgrade().

#define FILE_OPEN   open
 

Definition at line 147 of file defs.h.

Referenced by copy_file(), slaveNewUpgrade(), and Slave::slaveUpgrade().

#define FILE_READ   read
 

Definition at line 151 of file defs.h.

Referenced by copy_file().

#define FILE_RENAME   rename
 

Definition at line 150 of file defs.h.

Referenced by slaveNewUpgrade().

#define FILE_UNLINK   unlink
 

Definition at line 149 of file defs.h.

Referenced by Slave::endTask(), event_slave_avail(), event_task_finish(), Master::msgSlaveCtrl_Upgrade(), Slave::msgTaskCtrl_Stop(), Slave::put_data(), slaveNewUpgrade(), Slave::slaveUpgrade(), submit_executable_task(), and write_keyword().

#define FILE_WRITE   write
 

Definition at line 152 of file defs.h.

Referenced by copy_file().

 
#define LIB_ERROR      dlerror ()
 

Definition at line 130 of file defs.h.

Referenced by Slave::msgTaskInit().

#define LIB_HANDLE   void*
 

Definition at line 129 of file defs.h.

#define LIB_LOAD      dlopen (l, RTLD_NOW)
 

Definition at line 132 of file defs.h.

Referenced by Slave::msgTaskInit().

#define LIB_SYMBOL h,
     dlsym (h, s)
 

Definition at line 131 of file defs.h.

Referenced by Slave::msgTaskInit().

#define LIB_UNLOAD      dlclose (h)
 

Definition at line 133 of file defs.h.

Referenced by Slave::endTask(), and Slave::msgTaskCtrl_Stop().

#define MASTER_HOST   "localhost"
 

Definition at line 10 of file defs.h.

#define MASTER_HTTP_PORT   9000
 

Definition at line 15 of file defs.h.

#define MASTER_PORT   9000
 

Definition at line 11 of file defs.h.

Referenced by Slave::Slave().

#define max a,
     ((a) > (b) ? (a) : (b))
 

Definition at line 52 of file defs.h.

#define MAXERR_URL   1024
 

Definition at line 41 of file defs.h.

Referenced by Slave::msgSlaveCtrl(), and Slave::msgTaskInit().

#define min a,
     ((a) < (b) ? (a) : (b))
 

Definition at line 53 of file defs.h.

#define SLAVE_HTTP_PORT   9001
 

Definition at line 14 of file defs.h.

Referenced by Slave::Slave().

#define SLAVE_PORT   9001
 

Definition at line 6 of file defs.h.

Referenced by Slave::Slave().

#define SLEEP_MSEC  
 

Value:

{ \
     struct timespec ts, tr; \
     ts.tv_sec  = t / 1000; \
     ts.tv_nsec = 1000 * 1000 * (t % 1000); \
     nanosleep (&ts, &tr); \
   }

Definition at line 180 of file defs.h.

Referenced by addTask(), UDPConfirm::check(), Master::checkingThread(), UDPConfirm::closeSocket(), Slave::detectSlaveInfo(), editIOFiles(), editTask(), editTaskInfos(), load_project(), main(), main_menu(), process_utilities(), read_yes_no(), Slave::sndTaskFinish(), task_menu(), taskExec(), Semaphore::wait(), Master::~Master(), and PostOffice::~PostOffice().

#define SLEEP_SEC  
 

Value:

{ \
     struct timespec ts, tr; \
     ts.tv_sec  = t; \
     ts.tv_nsec = 0; \
     nanosleep (&ts, &tr); \
   }

Definition at line 173 of file defs.h.

Referenced by Slave::endTask(), slaveNewUpgrade(), Slave::slaveUpgrade(), and Slave::startTimer().

#define SLV_API
 

Definition at line 123 of file defs.h.

#define SLV_SERV_LIB   "./slv_serv.so"
 

Definition at line 124 of file defs.h.

#define SOCK_ERRNO   errno
 

Definition at line 192 of file defs.h.

Referenced by UDPSocket::waitData().

#define SZ_PTR   sizeof (void *)
 

Definition at line 31 of file defs.h.

#define SZ_UCHAR   sizeof (uchar)
 

Definition at line 29 of file defs.h.

#define SZ_UINT   sizeof (uint)
 

Definition at line 30 of file defs.h.

Referenced by Buffer::buffer(), Buffer::Buffer(), Buffer::clear(), Buffer::getId(), Buffer::operator uchar *(), Buffer::operator[](), UDPSocket::sendData(), Buffer::setCrt(), Buffer::setId(), and UDPSocket::waitData().

#define THRD_ARG   void*
 

Definition at line 137 of file defs.h.

Referenced by cbtaskctrl_entry(), cbtaskstop_entry(), execSlave(), inbox_entry(), master_console_in_entry(), master_console_out_entry(), master_entry(), master_http_server(), outbox_entry(), task_entry(), and timer_entry().

#define THRD_HANDLE   pthread_t
 

Definition at line 139 of file defs.h.

Referenced by Master::Master(), and Master::startMaster().

#define THRD_KILL      pthread_kill(x, SIGALRM);
 

Definition at line 143 of file defs.h.

Referenced by Slave::msgTaskCtrl_Stop(), Slave::stopTask(), and Slave::~Slave().

#define THRD_RETURN   void*
 

Definition at line 136 of file defs.h.

Referenced by cbtaskctrl_entry(), cbtaskstop_entry(), execSlave(), inbox_entry(), master_console_in_entry(), master_console_out_entry(), master_entry(), master_http_server(), outbox_entry(), task_entry(), and timer_entry().

#define UDP_MAXSIZE   65000
 

Definition at line 22 of file defs.h.

Referenced by Buffer::Buffer(), Slave::endTask(), UDPSocket::recvfrom(), UDPSocket::sendto(), and UDPSocket::waitData().

#define UDP_SEND_COUNT   5
 

Definition at line 24 of file defs.h.

Referenced by ItemDataInR::ItemDataInR(), and ItemDataOut::ItemDataOut().

#define UDP_SEND_TIMEOUT   1
 

Definition at line 23 of file defs.h.

Referenced by ItemDataInR::ItemDataInR(), and ItemDataOut::ItemDataOut().


Typedef Documentation

typedef void*(* THRD_START)(void *)
 

Definition at line 138 of file defs.h.

typedef unsigned char uchar
 

Definition at line 27 of file defs.h.

Referenced by PostOffice::_send(), Buffer::buffer(), Buffer::Buffer(), Address::getHost(), PostOffice::inbox(), Buffer::operator<<(), Buffer::operator>>(), Buffer::operator[](), UDPSocket::sendData(), slaveNewUpgrade(), UDPSocket::waitData(), and UDPConfirm::waitData().

typedef unsigned int uint
 

Definition at line 28 of file defs.h.

Referenced by PostOffice::_send(), Address::Address(), Buffer::buffer(), Buffer::Buffer(), UDPConfirm::checkN(), Client::Client(), UDPConfirm::deleteId(), UDPConfirm::deleteN(), Address::equals(), Address::getHost(), Buffer::getId(), UDPSocket::getLocalAddr(), UDPConfirm::getLocalAddr(), UDPConfirm::getLocalPort(), PostOffice::getLocalPort(), UDPSocket::getRemote(), PostOffice::inbox(), Address::init_thishost(), UDPConfirm::insertConfirm(), UDPConfirm::isConfirm(), UDPConfirm::isItem(), ItemDataInR::ItemDataInR(), ItemDataOut::ItemDataOut(), JobStatus::JobStatus(), UDPConfirm::nextId(), ZTime::operator+(), ZTime::operator-(), Buffer::operator<<(), ZTime::operator=(), ZTime::operator==(), ZTime::operator>(), ZTime::operator>=(), Buffer::operator>>(), UDPSocket::recvfrom(), UDPConfirm::sendConfirm(), UDPSocket::sendData(), UDPConfirm::sendData(), UDPConfirm::sendDataN(), Address::setHost(), Buffer::setId(), Address::setIP(), UDPSocket::setRemote(), Slave::startTimer(), startup(), TaskId::TaskId(), UDPSocket::waitData(), UDPConfirm::waitData(), and UDPSocket::waitDataN().


Function Documentation

int getURL const char *    url,
const char *    file,
char *    err = 0
 

Definition at line 140 of file GetURL.cpp.

int postURL const char *    url,
const char *    file,
...   
 

Definition at line 146 of file GetURL.cpp.

void read_passwd char *    pswd,
int    maxlen
 

Definition at line 17 of file other.cpp.


Generated on Mon Nov 25 12:46:34 2002 for qadpz by doxygen1.2.18