|
|
#define | BEEP "\x7" |
| |
|
#define | BGBLUE "\x1B[44m" |
| |
|
#define | BLUE "\x1B[34m" |
| |
|
#define | CLEANS "\x1B[2J" |
| |
| #define | csz c_str() |
| | Macro to extract a C-style, null terminated string from a string object. More...
|
| |
|
#define | CYAN "\x1B[36m" |
| |
| #define | DYNAMIC_ARRAY_DEFAULT_STEP 10 |
| | Size of allocation block for the Dynamic_Array class. More...
|
| |
|
#define | GREEN "\x1B[32m" |
| |
|
#define | MAGENTA "\x1B[35m" |
| |
| #define | MCS_(TYPE, rest...) mcs::Event(__FILE__, __LINE__, TYPE , ## rest) |
| | Facility to easily pass all necessary parameter to an Event constructor. More...
|
| |
|
#define | MCS_B64_DECODE 1 |
| |
|
#define | MCS_B64_DECODEINPLACE 2 |
| |
|
#define | MCS_B64_DEF_LINE 72 |
| |
|
#define | MCS_B64_ENCODE 0 |
| |
|
#define | MCS_B64_MIN_LINE 4 |
| |
| #define | MCS_BANNER "\nMy Customizable Server (MCS) ver. " PACKAGE_VERSION "\n" |
| | MCS banner. More...
|
| |
|
#define | MCS_CLIENT_DATA 2 |
| |
|
#define | MCS_CLIENT_DISCONNECT 4 |
| |
|
#define | MCS_CLIENT_ERROR 1 |
| |
|
#define | MCS_CLIENT_FILE 3 |
| |
| #define | MCS_CMD_CID "CID" |
| | Command: Retrieve the Client identifier. More...
|
| |
| #define | MCS_CMD_CID_HELP |
| |
| #define | MCS_CMD_CLIENT_INFO "CLINFO" |
| | Command: Return server status information. More...
|
| |
|
#define | MCS_CMD_CLIENT_INFO_HELP "Return all client informations." |
| |
| #define | MCS_CMD_CLOSECLIENT "BYE" |
| | Command: Close the session. More...
|
| |
| #define | MCS_CMD_CLOSECLIENT_HELP |
| |
| #define | MCS_CMD_DBCONNECT "CON" |
| | Command: Finalize the authentication process and log in. More...
|
| |
| #define | MCS_CMD_DBCONNECT_HELP |
| |
| #define | MCS_CMD_DBNAME "DBN" |
| | Command: Provide the application (database) name. More...
|
| |
| #define | MCS_CMD_DBNAME_HELP |
| |
| #define | MCS_CMD_EXEC "EXEC" |
| | Command: Execute an external program, script, SQL or batch file. More...
|
| |
| #define | MCS_CMD_EXEC_HELP |
| |
| #define | MCS_CMD_GET "GET" |
| | Command: Download a file from the work directory. More...
|
| |
| #define | MCS_CMD_GET_HELP |
| |
| #define | MCS_CMD_GETDATA "GDATA" |
| | Command: Download Data objects. More...
|
| |
| #define | MCS_CMD_GETDATA_HELP |
| |
| #define | MCS_CMD_MAX_TOKENS 100 |
| | Max number of tokens for a command line. More...
|
| |
| #define | MCS_CMD_NOP "NOP" |
| | Command: No operation (dummy) command. More...
|
| |
|
#define | MCS_CMD_NOP_HELP "No operation (dummy) command." |
| |
| #define | MCS_CMD_PASSWORD "PWD" |
| | Command: Provide password. More...
|
| |
| #define | MCS_CMD_PASSWORD_HELP |
| |
| #define | MCS_CMD_PUT "PUT" |
| | Command: Upload a file to the work directory. More...
|
| |
| #define | MCS_CMD_PUT_HELP |
| |
| #define | MCS_CMD_PUTDATA "PDATA" |
| | Command: Upload Data objects. More...
|
| |
| #define | MCS_CMD_PUTDATA_HELP |
| |
| #define | MCS_CMD_QUERY "QRY" |
| | Command: Execute queries on the database. More...
|
| |
| #define | MCS_CMD_QUERY_HELP |
| |
| #define | MCS_CMD_RECORD "FETCH" |
| |
| #define | MCS_CMD_RECORD_HELP |
| |
| #define | MCS_CMD_SENDQUERYRES "QRES" |
| | Command: Retrieve a file with an ASCII dump of the entire set of records returned by the last query. More...
|
| |
| #define | MCS_CMD_SENDQUERYRES_HELP |
| |
| #define | MCS_CMD_TABLEINFO "TINFO" |
| | Command: Retrieve information about a table. More...
|
| |
| #define | MCS_CMD_TABLEINFO_HELP |
| |
| #define | MCS_CMD_TABLELIST "TLIST" |
| | Command: Retrieve the list of tables actually present in the database. More...
|
| |
| #define | MCS_CMD_TABLELIST_HELP |
| |
| #define | MCS_CMD_USERNAME "USR" |
| | Command: Provide user name. More...
|
| |
| #define | MCS_CMD_USERNAME_HELP |
| |
| #define | MCS_COMMBUFSIZE 1024 |
| | Max length of a message being sent between client and server. More...
|
| |
| #define | MCS_CRITICAL_SECTION(BLOCK...) |
| | Execute a list of commands inside a critical section. More...
|
| |
| #define | MCS_CRITICAL_SECTION_BEGIN enter(); try { |
| | Start a critical section, there must be no "return" or "goto" instruction inside the section. More...
|
| |
| #define | MCS_CRITICAL_SECTION_END } catch(Event e) { leave(); throw e; } leave(); |
| | End a critical section, there must be no "return" or "goto" instruction inside the section. More...
|
| |
| #define | MCS_CRITICAL_SECTION_END_RETURN(What...) |
| |
| #define | MCS_CUSTOM_LOCAL(CLASS) |
| |
|
#define | MCS_CUSTOM_LOCAL_END(CLASS) }; |
| |
| #define | MCS_CUSTOM_SERVER(CLIENT, LOCAL) |
| | Macro to define a Server derived class, that works with UserThread and LocalThread derived objects. More...
|
| |
| #define | MCS_CUSTOM_USER(CLASS) |
| | Wait for a MCS server termination. More...
|
| |
|
#define | MCS_CUSTOM_USER_END(CLASS) }; |
| |
|
#define | MCS_DATA_NDIM 15 |
| |
| #define | MCS_DEFAULT_CLIENT_TIMEOUT 10 * 60 * 1000 |
| | Default client connection timeout, in milliseconds: 10 minutes. More...
|
| |
| #define | MCS_DEFAULT_MAX_USERS 100 |
| | Default max number of clients connected. More...
|
| |
| #define | MCS_DEFAULT_PORT 6523 |
| | Default port on which the server is listening. More...
|
| |
| #define | MCS_DEFAULTCHUNKSIZE 16384 |
| | File chunk size. More...
|
| |
| #define | MCS_ERROR(A, rest...) mcs::Event(__FILE__, __LINE__, mcs::ERROR, A, ## rest) |
| | Facility to easily pass all necessary parameter to an Event constructor. More...
|
| |
| #define | MCS_FATAL(A, rest...) mcs::Event(__FILE__, __LINE__, mcs::FATAL, A, ## rest) |
| | Facility to easily pass all necessary parameter to an Event constructor. More...
|
| |
| #define | MCS_FT_BATCH 1 |
| | Return value for BaseThread.fileType(), batch file. More...
|
| |
| #define | MCS_FT_BIN 4 |
| | Return value for BaseThread.fileType(), binary file. More...
|
| |
| #define | MCS_FT_SCRIPT 3 |
| | Return value for BaseThread.fileType(), script file. More...
|
| |
| #define | MCS_FT_SQL 2 |
| | Return value for BaseThread.fileType(), SQL file. More...
|
| |
| #define | MCS_FT_UNKNOWN 0 |
| | Return value for BaseThread.fileType(), unknown type. More...
|
| |
|
#define | MCS_GRANT_ADMIN 256 |
| |
|
#define | MCS_GRANT_ALL 511 |
| |
|
#define | MCS_GRANT_BATCH 16 |
| |
|
#define | MCS_GRANT_GET 32 |
| |
|
#define | MCS_GRANT_LOGIN 1 |
| |
|
#define | MCS_GRANT_NO_GRANTS 0 |
| |
|
#define | MCS_GRANT_PUT 64 |
| |
|
#define | MCS_GRANT_QUERY 8 |
| |
|
#define | MCS_GRANT_SCRIPTS 4 |
| |
|
#define | MCS_GRANT_SQL_SCRIPTS 2 |
| |
|
#define | MCS_GRANT_SYS 128 |
| |
|
#define | MCS_ID_CLIENT -3 |
| |
|
#define | MCS_ID_LOCAL -2 |
| |
|
#define | MCS_ID_UNKNOWN -1 |
| |
|
#define | MCS_MISSING_ASSIGNMENT_OPERATOR(CLASS) CLASS& operator=(const CLASS&); |
| |
|
#define | MCS_MISSING_COPY_CONSTRUCTOR(CLASS) CLASS(const CLASS&); |
| |
|
#define | MCS_MKDIR_PROTECT S_IRUSR | S_IWUSR | S_IXUSR |
| |
|
#define | MCS_MKDIR_UMASK 0 |
| |
| #define | MCS_OK(A, rest...) mcs::Event(__FILE__, __LINE__, mcs::OK, A, ## rest) |
| | Facility to easily pass all necessary parameter to an Event constructor. More...
|
| |
| #define | MCS_OPT_ALL_ERRORS "werr" |
| | Option: Turns all warning into errors, so that a warning can stop the execution. More...
|
| |
| #define | MCS_OPT_ALL_ERRORS_HELP |
| |
| #define | MCS_OPT_FORCE "force" |
| | Option: Continue execution of commands even if an error occur. More...
|
| |
| #define | MCS_OPT_FORCE_HELP |
| |
| #define | MCS_OPT_HELP "help" |
| | Option: Return a quick help for a command or an option. More...
|
| |
| #define | MCS_OPT_LOOP "loop" |
| | Option: Put a copy of thr recevied Data object in the "send" vector. More...
|
| |
| #define | MCS_OPT_LOOP_HELP |
| |
| #define | MCS_OPT_SAVEQUERYASCII "sqascii" |
| | Option: Save query result in ASCII format. More...
|
| |
| #define | MCS_OPT_SAVEQUERYASCII_HELP |
| |
| #define | MCS_OPT_SAVEQUERYFITS "sqfits" |
| | Option: Save query result in FITS format. More...
|
| |
| #define | MCS_OPT_SAVEQUERYFITS_HELP |
| |
|
#define | MCS_PAB_INSERT 1 |
| |
|
#define | MCS_PAB_REPLACE 3 |
| |
|
#define | MCS_PAB_UPDATE 2 |
| |
| #define | MCS_PRE "#" |
| | Prefix of a message for the client, this is the first character. More...
|
| |
| #define | MCS_PROMPT_ERROR MCS_PRE "0E-" |
| | Prompt sent after a command raised one error. More...
|
| |
| #define | MCS_PROMPT_OK MCS_PRE "0--" |
| | Prompt sent after a command has been executed correctly. More...
|
| |
| #define | MCS_PROMPT_WARN MCS_PRE "0W-" |
| | Prompt sent after a command raised one or more warnings. More...
|
| |
| #define | MCS_RS_ACCUM 1 |
| | Flag for RecordSet::init(). More...
|
| |
| #define | MCS_RS_INSERT 16 |
| | Flag for RecordSet::init(). More...
|
| |
| #define | MCS_RS_KNOW_NROWS 4 |
| | Flag for RecordSet::init(). More...
|
| |
| #define | MCS_RS_RANDOM 8 |
| | Flag for RecordSet::init(). More...
|
| |
| #define | MCS_RS_USEMETAREC 2 |
| | Flag for RecordSet::init(). More...
|
| |
|
#define | MCS_SELECT_READ 0 |
| |
|
#define | MCS_SELECT_WRITE 1 |
| |
| #define | MCS_SEP "|" |
| | This character is used to split a message into "fields". More...
|
| |
|
#define | MCS_SERIAL_BUFFER 1 |
| |
|
#define | MCS_SERIAL_FILENAME 2 |
| |
|
#define | MCS_SERIAL_UNKNOWN 0 |
| |
|
#define | MCS_SSLCERT "mcscert.pem" |
| |
|
#define | MCS_SSLPRIV "mcspkey.pem" |
| |
| #define | MCS_STATE_CREATED 1 |
| | Thread state: the object has been created ut the separate thread has not been started. More...
|
| |
| #define | MCS_STATE_END 4 |
| | Thread state: the separate thread had terminated its execution. More...
|
| |
| #define | MCS_STATE_RUNNING 2 |
| | Thread state: the separate thread is executing the run() method. More...
|
| |
| #define | MCS_STATE_TERMINATING 3 |
| | Thread state: the exit() method is executing, the separate thread is going to execute the final() method. More...
|
| |
| #define | MCS_SUBST_LEADING 4 |
| | To be used with subst(), substitute only if "what" is at the beginning. See subst(). More...
|
| |
| #define | MCS_SUBST_QUOTE_WITH 1 |
| | To be used with subst(), doubles each backslash in "with". See subst(). More...
|
| |
| #define | MCS_SUBST_TRAILING 8 |
| | To be used with subst(), substitute only if "what" is at the end. See subst(). More...
|
| |
| #define | MCS_SYNCHRO_LOCK 1 |
| | To be used with Synchro.enter(): enter a critical section. More...
|
| |
| #define | MCS_SYNCHRO_TRY_LOCK 2 |
| | To be used with Synchro.enter(): try to enter a critical section. More...
|
| |
| #define | MCS_SYNCHRO_TRY_TIMED 3 |
| | To be used with Synchro.enter(): try to enter a critical section with timeout facility. More...
|
| |
| #define | MCS_VMSG_SIZE 1000 |
| | Size of the Event.vmsg static array. More...
|
| |
| #define | MCS_WARN(A, rest...) mcs::Event(__FILE__, __LINE__, mcs::WARN, A, ## rest) |
| | Facility to easily pass all necessary parameter to an Event constructor. More...
|
| |
|
#define | MERROR std::cerr << RED << "\r(E)\t"<< GREEN << __FILE__ << "," << __LINE__ << NORMAL << "\t" <<TBOLD<<__FUNCTION__<<NORMAL << "\t" |
| |
|
#define | MINFO std::cout << BLUE << "\r(I)\t"<< GREEN << __FILE__ << "," << __LINE__ << NORMAL << "\t" <<TBOLD<<__FUNCTION__<<NORMAL << "\t" |
| |
|
#define | MWARN std::cout << YELLOW << "\r(W)\t"<< GREEN << __FILE__ << "," << __LINE__ << NORMAL << "\t" <<TBOLD<<__FUNCTION__<<NORMAL << "\t" |
| |
| #define | my_mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) |
| | Some systems doesn't have mempcpy, so we provide it here. More...
|
| |
|
#define | MYSQL_SOCK NULL |
| |
|
#define | NORMAL "\x1B[0m" |
| |
|
#define | RED "\x1B[31m" |
| |
|
#define | REV "\x1B[7m" |
| |
|
#define | TBOLD "\x1B[1m" |
| |
|
#define | YELLOW "\x1B[33m" |
| |
|
| string | mcs::btos (bool b) |
| | Convert a boolean to a string containing "true" or "false". More...
|
| |
| string | mcs::chomp (string s) |
| | Remove any trailing newlines. More...
|
| |
| int | mcs::copy (char *OLDNAME, char *NEWNAME) |
| | Copy a file from OLDNAME to NEWNAME. More...
|
| |
| string | mcs::dtos (double f) |
| | Convert an floating point number to a string. More...
|
| |
| int | mcs::extractCode (const char *msg) |
| | Extract the numeric code from a server reply. More...
|
| |
| bool | mcs::File_Dir_Exist (string fn, unsigned int &size) |
| | Check if a file or directory exists. More...
|
| |
| bool | mcs::FITS2Types (int fits, Types &dbt, bool &isunsigned) |
| | Convert a FITSIO type into a MCS type. More...
|
| |
| string | mcs::fitsError (int status) |
| | Return a description of a FITS error. More...
|
| |
| bool | mcs::FloatType (Types type) |
| | Tell if "type" is a float type. More...
|
| |
| string | mcs::hexDump (const void *buf, unsigned int size) |
| | Return a string with an hex dump of the buffer pointed by "buf", with a length of "size". More...
|
| |
| bool | mcs::IntType (Types type) |
| | Tell if "type" is an integer type. More...
|
| |
| string | mcs::itos (int i) |
| | Convert an integer to a string. More...
|
| |
| void | mcs::ls2Record (string fn, Record &v) |
| | Fill a vector with a list of file. More...
|
| |
| Env * | mcs::mcsStart (string appname, string inipath="", Server *(*cb_newServer)(Env *)=NULL) |
| | Start a MCS server. More...
|
| |
| bool | mcs::mkDir (string path, mode_t perm=0, enum ThrowExceptions throwexc=THROW) |
| | Create a directory. More...
|
| |
| int | mcs::move (char *OLDNAME, char *NEWNAME) |
| | Move a file from OLDNAME to NEWNAME. More...
|
| |
|
time_t | mcs::my_timelocal (struct tm *tm) |
| |
| string | mcs::MYSQL2Str (enum_field_types type) |
| | Return the name of the MySQL type given in "type". More...
|
| |
| bool | mcs::MYSQL2Types (enum_field_types mtype, Types &type) |
| | Convert a MySQL type into a MCS type. More...
|
| |
| string | mcs::Pwd () |
| | Return the current working dir. More...
|
| |
| mode_t | mcs::read_umask () |
| | Read the file creation mask of the current process. More...
|
| |
| string | mcs::remLeading (string &s, const char *p) |
| | Remove any leading character "p". More...
|
| |
| string | mcs::remTabs (string s) |
| | Remove any tab. More...
|
| |
| string | mcs::remTrailing (string &s, const char *p) |
| | Remove any trailing character "p". More...
|
| |
| bool | mcs::rmDir (string path, enum ThrowExceptions throwexc=THROW) |
| | Removes a directory. More...
|
| |
|
int | mcs::Select (int fd, unsigned int sec_timeout, unsigned int usec_timeout, int op) |
| |
|
int | mcs::Select (int fd[], int nfd, unsigned int sec_timeout, unsigned int usec_timeout, int op) |
| |
| void | mcs::sleep_ms (unsigned int millisec) |
| | A millisecond resolution sleep function. More...
|
| |
| vector< string > | mcs::split (string s, string sep=" ") |
| | Split a string into tokens. More...
|
| |
| int | mcs::stoi (string s) |
| | Convert a string to an integer. More...
|
| |
| int | mcs::stoi (string s, int errval) |
| | Convert a string to an integer. More...
|
| |
| string | mcs::subst (string s, string what, string with, int op=0) |
| | Perform substitutions on a string. More...
|
| |
| string | mcs::trim (string s) |
| | Remove any leading or trailing blanks. More...
|
| |
| bool | mcs::Types2FITS (Types dbt, bool isunsigned, int &fits) |
| | Convert a MCS type into a FITSIO type. More...
|
| |
| bool | mcs::Types2MYSQL (Types &type, enum_field_types &mtype) |
| | Convert a MCS type into a MySQL type. More...
|
| |
| string | mcs::Types2MYSQLStr (Types &type, bool isunsigned) |
| | Convert a MCS type into a MySQL type. More...
|
| |
| bool | mcs::Types2S_FITS (Types dbt, int len, bool isunsigned, string &fits) |
| | Convert a MCS type into a FITSIO type code. More...
|
| |
| string | mcs::Types2Str (Types type, bool isunsigned) |
| | Return the name of the type given in "type" and "isunsigned". More...
|
| |
| bool | mcs::VarLenType (Types type) |
| | Tell if "type" is a variable length type. More...
|
| |
| string | mcs::vtos (vector< string > vec) |
| | Join a vector of strings in a single string using newlines. More...
|
| |
Main include file for all MCS based applications.
Definition in file mcs.hh.