A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__UtilityFunc.html below:

NCBI C++ ToolKit: Utility Functions

#define  DEF_CONN_REG_SECTION   "CONN"   #define  REG_CONN_REQ_METHOD   "REQ_METHOD"   #define  DEF_CONN_REQ_METHOD   "ANY"   #define  REG_CONN_USER   "USER"   #define  DEF_CONN_USER   ""   #define  REG_CONN_PASS   "PASS"   #define  DEF_CONN_PASS   ""   #define  REG_CONN_HOST   "HOST"   #define  DEF_CONN_HOST   "www.ncbi.nlm.nih.gov"   #define  REG_CONN_PORT   "PORT"   #define  DEF_CONN_PORT   0/*default*/   #define  REG_CONN_PATH   "PATH"   #define  DEF_CONN_PATH   "/Service/dispd.cgi"   #define  REG_CONN_ARGS   "ARGS"   #define  DEF_CONN_ARGS   ""   #define  REG_CONN_HTTP_PROXY_HOST   "HTTP_PROXY_HOST"   #define  DEF_CONN_HTTP_PROXY_HOST   ""   #define  REG_CONN_HTTP_PROXY_PORT   "HTTP_PROXY_PORT"   #define  DEF_CONN_HTTP_PROXY_PORT   ""   #define  REG_CONN_HTTP_PROXY_USER   "HTTP_PROXY_USER"   #define  DEF_CONN_HTTP_PROXY_USER   ""   #define  REG_CONN_HTTP_PROXY_PASS   "HTTP_PROXY_PASS"   #define  DEF_CONN_HTTP_PROXY_PASS   ""   #define  REG_CONN_HTTP_PROXY_LEAK   "HTTP_PROXY_LEAK"   #define  DEF_CONN_HTTP_PROXY_LEAK   ""   #define  REG_CONN_HTTP_PROXY_SKIP   "HTTP_PROXY_SKIP"   #define  DEF_CONN_HTTP_PROXY_SKIP   ""   #define  REG_CONN_HTTP_PUSH_AUTH   "HTTP_PUSH_AUTH"   #define  DEF_CONN_HTTP_PUSH_AUTH   ""   #define  REG_CONN_TIMEOUT   "TIMEOUT"   #define  DEF_CONN_TIMEOUT   30.0   #define  REG_CONN_MAX_TRY   "MAX_TRY"   #define  DEF_CONN_MAX_TRY   3   #define  REG_CONN_EXTERNAL   "EXTERNAL"   #define  DEF_CONN_EXTERNAL   ""   #define  REG_CONN_FIREWALL   "FIREWALL"   #define  DEF_CONN_FIREWALL   ""   #define  REG_CONN_STATELESS   "STATELESS"   #define  DEF_CONN_STATELESS   ""   #define  REG_CONN_LB_DISABLE   "LB_DISABLE"   #define  DEF_CONN_LB_DISABLE   ""   #define  REG_CONN_HTTP_VERSION   "HTTP_VERSION"   #define  DEF_CONN_HTTP_VERSION   0   #define  REG_CONN_DEBUG_PRINTOUT   "DEBUG_PRINTOUT"   #define  DEF_CONN_DEBUG_PRINTOUT   ""   #define  REG_CONN_HTTP_USER_HEADER   "HTTP_USER_HEADER"   #define  DEF_CONN_HTTP_USER_HEADER   ""   #define  REG_CONN_HTTP_REFERER   "HTTP_REFERER"   #define  DEF_CONN_HTTP_REFERER   0   #define  REG_CONN_LOCAL_ENABLE   "LOCAL_ENABLE"   #define  REG_CONN_LBNULL_ENABLE   "LBNULL_ENABLE"   #define  REG_CONN_LBSMD_DISABLE   "LBSMD_DISABLE"   #define  REG_CONN_LBDNS_ENABLE   "LBDNS_ENABLE"   #define  REG_CONN_LINKERD_ENABLE   "LINKERD_ENABLE"   #define  REG_CONN_NAMERD_ENABLE   "NAMERD_ENABLE"   #define  REG_CONN_DISPD_DISABLE   "DISPD_DISABLE"   #define  REG_CONN_SERVICE_NAME   DEF_CONN_REG_SECTION "_" "SERVICE_NAME"   #define  REG_CONN_LOCAL_SERVICES   DEF_CONN_REG_SECTION "_" "LOCAL_SERVICES"   #define  REG_CONN_LOCAL_SERVER   DEF_CONN_REG_SECTION "_" "LOCAL_SERVER"   #define  REG_CONN_IMPLICIT_SERVER_TYPE   "IMPLICIT_SERVER_TYPE"   #define  DEF_CONN_LOCAL_IPS   "LOCAL_IPS"   #define  REG_CONN_LOCAL_IPS   DEF_CONN_REG_SECTION "_" DEF_CONN_LOCAL_IPS   #define  DEF_CONN_LOCAL_IPS_DISABLE   "NONE"   #define  ConnNetInfo_PostOverrideUserHeader   ConnNetInfo_OverrideUserHeader   #define  NCBI_CONNUTIL_DEPRECATED   NCBI_DEPRECATED   #define  CONN_CONTENT_TYPE_LEN   63   #define  MAX_CONTENT_TYPE_LEN   (CONN_CONTENT_TYPE_LEN+1)   #define  EIO_N_STATUS   8   connection is / has been closed, EOF condition More...
  #define  MT_LOCK_Do(lk, how)   ((lk) ? MT_LOCK_DoInternal((lk), (how)) : -1)   Call "lk->handler(lk->data, how)". More...
  #define  kDefaultTimeout   ((const STimeout*)(-1))   #define  kInfiniteTimeout   ((const STimeout*)( 0))   #define  NCBI_ESWITCH_DEFINED   #define  NCBI_EOWNERSHIP_DEFINED   #define  NCBI_TIME_INFINITE   ((TNCBI_Time)(-1))   #define  NCBI_BIGCOUNT_FORMAT_SPEC   PRIu64   #define  NCBI_BIGCOUNT_FORMAT_SPEC_HEX   PRIx64   #define  NCBI_BIGCOUNT_FORMAT_SPEC_HEX_X   PRIX64   #define  LOG_WRITE(lg, code, subcode, level, message)   Auxiliary plain macros to write message (maybe, with raw data) to the log. More...
  #define  LOG_DATA(lg, code, subcode, level, data, size, message)   #define  THIS_MODULE   0   Default for THIS_MODULE. More...
  #define  CORE_CURRENT_FUNCTION   0   Get current function name. More...
  #define  CORE_LOGFILE_CUTOFF_LEVEL   eLOG_Note   Default CORE LOG cut off log level. More...
  #define  fLOG_Short   fLOG_Level   #define  fLOG_Full   (fLOG_Level | fLOG_Module | fLOG_FileLine)   #define  UTIL_PRINTABLE_WIDTH_MIN   80 /** Default minimum printable width */   #define  UTIL_PRINTABLE_WIDTH   130 /** Default printable width for data */   #define  UTIL_PrintableString(d, s, b, f)   UTIL_PrintableStringEx((d),(s),(b),(f),0)   Same as UTIL_PrintableStringEx(..., 0) – i.e. More...
  #define  UTIL_TcharToUtf8OnHeap(x)   (x)   Conversion from Unicode to UTF8, and back. More...
  #define  UTIL_TcharToUtf8(x)   (x)   #define  UTIL_Utf8ToTchar(x)   (x)   #define  UTIL_ReleaseBuffer(x)   /*void*/   typedef const struct SNcbiBlowfishNCBI_BLOWFISH   Opaque encryption / decryption context type. More...
  typedef unsigned  TReqMethod   typedef unsigned  EBURLScheme   typedef unsigned  EBFWMode   typedef unsigned  EBDebugPrintout   typedef unsigned  EBProxyType   typedef struct MT_LOCK_tagMT_LOCK   typedef int(*  FMT_LOCK_Handler) (void *data, EMT_Lock how)   MT locking callback (operates like a [recursive] mutex or RW-lock). More...
  typedef void(*  FMT_LOCK_Cleanup) (void *data)   MT lock cleanup callback. More...
  typedef struct LOG_tagLOG   typedef void(*  FLOG_Handler) (void *data, const SLOG_Message *mess)   Log post callback. More...
  typedef void(*  FLOG_Cleanup) (void *data)   Log cleanup callback. More...
  typedef struct REG_tagREG   typedef int(*  FREG_Get) (void *data, const char *section, const char *name, char *value, size_t value_size)   Registry getter callback. More...
  typedef int(*  FREG_Set) (void *data, const char *section, const char *name, const char *value, EREG_Storage storage)   Registry setter callback. More...
  typedef void(*  FREG_Cleanup) (void *data)   Registry cleanup callback. More...
  typedef unsigned int  TConnectInitFlags   Bitwise OR of EConnectInitFlag. More...
  typedef pair< Uint8, double >  CRateMonitor::TMark   typedef struct STimeoutTag  STimeout   Timeout structure. More...
  typedef enum ENcbiSwitch  ESwitch   Aux. More...
  typedef enum ENcbiOwnership  EOwnership   Ownership relations between objects. More...
  typedef unsigned int  TNCBI_Size   Fixed-size analogs of size_t and time_t (mainly for IPC) More...
  typedef unsigned int  TNCBI_Time   typedef uint64_t  TNCBI_BigCount   Big unsigned integer for file size and position. More...
  typedef unsigned int  TLOG_FormatFlags   bitwise OR of "ELOG_FormatFlag" More...
  typedef int  TUTIL_PrintableFlags   Bitwise "OR" of EUTIL_PrintableFlags. More...
  enum   EReqMethod {
  eReqMethod_Any = 0 , eReqMethod_Get , eReqMethod_Post , eReqMethod_Head ,
  eReqMethod_Connect , eReqMethod_v1 = 8 , eReqMethod_Any11 = eReqMethod_v1 | eReqMethod_Any , eReqMethod_Get11 = eReqMethod_v1 | eReqMethod_Get ,
  eReqMethod_Post11 = eReqMethod_v1 | eReqMethod_Post , eReqMethod_Head11 = eReqMethod_v1 | eReqMethod_Head , eReqMethod_Connect11 = eReqMethod_v1 | eReqMethod_Connect , eReqMethod_Put = 16 ,
  eReqMethod_Patch , eReqMethod_Trace , eReqMethod_Delete , eReqMethod_Options
}   enum   EURLScheme {
  eURL_Unspec = 0 , eURL_Https , eURL_File , eURL_Http ,
  eURL_Ftp
}   enum   EFWMode { eFWMode_Legacy = 0 , eFWMode_Adaptive = 1 , eFWMode_Firewall = 2 , eFWMode_Fallback = 3 }   enum   EDebugPrintout { eDebugPrintout_None = 0 , eDebugPrintout_Some , eDebugPrintout_Data }   enum   EProxyType { fProxy_None = 0 , fProxy_Http , fProxy_Https }   enum   EMIME_Type {
  eMIME_T_Undefined = -1 , eMIME_T_NcbiData = 0 , eMIME_T_Text , eMIME_T_Application ,
  eMIME_T_Unknown
}   enum   EMIME_SubType {
  eMIME_Undefined = -1 , eMIME_Dispatch = 0 , eMIME_AsnText , eMIME_AsnBinary ,
  eMIME_Fasta , eMIME_WwwForm , eMIME_Html , eMIME_Plain ,
  eMIME_Xml , eMIME_XmlSoap , eMIME_OctetStream , eMIME_Unknown
}   enum   EMIME_Encoding { eENCOD_None = 0 , eENCOD_Url , eENCOD_Unknown }   enum   EIO_ReadMethod { eIO_ReadPeek , eIO_ReadPlain , eIO_ReadPersist }   I/O read method. More...
  enum   EIO_WriteMethod { eIO_WriteNone , eIO_WritePlain , eIO_WritePersist , eIO_WriteOutOfBand }   I/O write method. More...
  enum   EIO_Event {
  eIO_Open = 0 , eIO_Read = 1 , eIO_Write = 2 , eIO_ReadWrite = 3 ,
  eIO_Close = 4
}   I/O event (or direction). More...
  enum   EIO_Status {
  eIO_Success = 0 , eIO_Timeout , eIO_Reserved , eIO_Interrupt ,
  eIO_InvalidArg , eIO_NotSupported , eIO_Unknown
}   I/O status. More...
  enum   EMT_Lock {
  eMT_Lock , eMT_LockRead , eMT_Unlock , eMT_TryLock ,
  eMT_TryLockRead
}   Set the lock/unlock callback function and its data for MT critical section. More...
  enum   ELOG_Level {
  eLOG_Trace = 0 , eLOG_Note , eLOG_Info = eLOG_Note , eLOG_Warning ,
  eLOG_Error , eLOG_Critical , eLOG_Fatal
}   Log severity level. More...
  enum   EREG_Storage { eREG_Transient = 0 , eREG_Persistent }   Transient/Persistent storage. More...
  enum   EConnectInitFlag { eConnectInit_OwnNothing = 0 , eConnectInit_OwnRegistry = 1 , eConnectInit_OwnLock = 2 , eConnectInit_NoSSL = 4 }   CONNECT_Init flags: which parameters to own / initialize. More...
  enum   ENcbiSwitch {
  eOff = 0 , eOn , eDefault , eOff = 0 ,
  eOn , eDefault
}   Aux. More...
  enum   ENcbiOwnership { eNoOwnership , eTakeOwnership , eNoOwnership , eTakeOwnership }   Ownership relations between objects. More...
  enum   ELOG_FormatFlag {
  fLOG_Default = 0x0 , fLOG_Level = 0x1 , fLOG_Module = 0x2 , fLOG_FileLine = 0x4 ,
  fLOG_DateTime = 0x8 , fLOG_Function = 0x10 , fLOG_FullOctal = 0x2000 , fLOG_OmitNoteLevel = 0x4000 ,
  fLOG_None = 0x8000
}   LOG formatting flags: what parts of the message to actually appear. More...
  enum   ENcbiRequestID {
  eNcbiRequestID_None = 0 , eNcbiRequestID_HitID , eNcbiRequestID_SID , eNcbiTraceState ,
  eNcbiTraceParent
}   NCBI request ID enumerator. More...
  enum   ECORE_Username { eCORE_UsernameCurrent , eCORE_UsernameLogin , eCORE_UsernameReal }   Select which username is the most preferable to obtain from the system. More...
  enum   EUTIL_PrintableFlags { fUTIL_PrintableFullOctal = 1 , eUTIL_PrintableFullOctal = fUTIL_PrintableFullOctal , fUTIL_PrintableNoNewLine = 2 , eUTIL_PrintableNoNewLine = fUTIL_PrintableNoNewLine }   NCBI_BLOWFISH  NcbiBlowfishInit (const void *key, size_t keylen)   Init the cipher context with a key of the specified length. More...
  void  NcbiBlowfishEncrypt (NCBI_BLOWFISH ctx, Uint8 *text)   Encrypt a 64-bit block of data pointed to by "text" with an encrypted scrambled cipher data stored back at the same location. More...
  void  NcbiBlowfishDecrypt (NCBI_BLOWFISH ctx, Uint8 *data)   Decrypt a 64-bit of cipher data pointed to by "data" back into the clear text stored at the same location. More...
  void  NcbiBlowfishFini (NCBI_BLOWFISH ctx)   Destroy the context created by NcbiBlowfishInit(). More...
  const char *  ConnNetInfo_GetValue (const char *service, const char *param, char *value, size_t value_size, const char *def_value)   int  ConnNetInfo_Boolean (const char *str)   SConnNetInfoConnNetInfo_Create (const char *service)   SConnNetInfoConnNetInfo_Clone (const SConnNetInfo *net_info)   int  ConnNetInfo_SetPath (SConnNetInfo *net_info, const char *path)   int  ConnNetInfo_AddPath (SConnNetInfo *net_info, const char *path)   int  ConnNetInfo_SetArgs (SConnNetInfo *net_info, const char *args)   int  ConnNetInfo_SetFrag (SConnNetInfo *net_info, const char *frag)   const char *  ConnNetInfo_GetArgs (const SConnNetInfo *net_info)   int  ConnNetInfo_AppendArg (SConnNetInfo *net_info, const char *arg, const char *val)   int  ConnNetInfo_PrependArg (SConnNetInfo *net_info, const char *arg, const char *val)   int  ConnNetInfo_DeleteArg (SConnNetInfo *net_info, const char *arg)   void  ConnNetInfo_DeleteAllArgs (SConnNetInfo *net_info, const char *args)   int  ConnNetInfo_PreOverrideArg (SConnNetInfo *net_info, const char *arg, const char *val)   int  ConnNetInfo_PostOverrideArg (SConnNetInfo *net_info, const char *arg, const char *val)   int  ConnNetInfo_SetupStandardArgs (SConnNetInfo *net_info, const char *service)   int  ConnNetInfo_SetUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_AppendUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_PrependUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_OverrideUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_PreOverrideUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_ExtendUserHeader (SConnNetInfo *net_info, const char *header)   void  ConnNetInfo_DeleteUserHeader (SConnNetInfo *net_info, const char *header)   int  ConnNetInfo_SetTimeout (SConnNetInfo *net_info, const STimeout *timeout)   int  ConnNetInfo_ParseURL (SConnNetInfo *net_info, const char *url)   char *  ConnNetInfo_URL (const SConnNetInfo *net_info)   void  ConnNetInfo_Log (const SConnNetInfo *net_info, ELOG_Level sev, LOG log)   void  ConnNetInfo_Destroy (SConnNetInfo *net_info)   EIO_Status  URL_ConnectEx (const char *host, unsigned short port, const char *path, const char *args, TReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_header, SURLExtra *extra, TSOCK_Flags flags, SOCK *sock)   SOCK  URL_Connect (const char *host, unsigned short port, const char *path, const char *args, EReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_header, int encode_args, TSOCK_Flags flags)   EIO_Status  CONN_StripToPattern (CONN conn, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)   Discard all input data before (and including) the first occurrence of a "pattern". More...
  EIO_Status  SOCK_StripToPattern (SOCK sock, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)   EIO_Status  BUF_StripToPattern (BUF buffer, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)   void  URL_Encode (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)   void  URL_EncodeEx (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)   int  URL_Decode (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)   int  URL_DecodeEx (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)   char *  MIME_ComposeContentTypeEx (EMIME_Type type, EMIME_SubType subtype, EMIME_Encoding encoding, char *buf, size_t bufsize)   int  MIME_ParseContentTypeEx (const char *str, EMIME_Type *type, EMIME_SubType *subtype, EMIME_Encoding *encoding)   const char *  IO_StatusStr (EIO_Status status)   Get the text form of an enum status value. More...
  MT_LOCK  MT_LOCK_Create (void *data, FMT_LOCK_Handler handler, FMT_LOCK_Cleanup cleanup)   Create a new MT lock (with an internal reference count set to 1). More...
  MT_LOCK  MT_LOCK_AddRef (MT_LOCK lk)   Increment internal reference count by 1, then return "lk". More...
  MT_LOCK  MT_LOCK_Delete (MT_LOCK lk)   Decrement internal reference count by 1, and if it reaches 0, then destroy the handle, call "lk->cleanup(lk->data)", and return NULL; otherwise (if the reference count is still > 0), return "lk". More...
  int  MT_LOCK_DoInternal (MT_LOCK lk, EMT_Lock how)   const char *  LOG_LevelStr (ELOG_Level level)   Obtain verbal representation of an enum level value. More...
  LOG  LOG_Create (void *data, FLOG_Handler handler, FLOG_Cleanup cleanup, MT_LOCK lock)   Create a new LOG (with an internal reference count set to 1). More...
  LOG  LOG_Reset (LOG lg, void *data, FLOG_Handler handler, FLOG_Cleanup cleanup)   Reset the "lg" to use the new "data", "handler" and "cleanup". More...
  LOG  LOG_AddRef (LOG lg)   Increment internal reference count by 1, then return "lg". More...
  LOG  LOG_Delete (LOG lg)   Decrement internal reference count by 1, and if it reaches 0, then call "lg->cleanup(lg->data)", destroy the handle, and return NULL; otherwise (if reference count is still > 0), return "lg". More...
  void  LOG_Write (LOG lg, int code, int subcode, ELOG_Level level, const char *module, const char *func, const char *file, int line, const char *message, const void *raw_data, size_t raw_size)   Upon having filled SLOG_Message data from parameters, write a message (perhaps with raw data attached) to the log by calling LOG_WriteInternal(). More...
  void  LOG_WriteInternal (LOG lg, const SLOG_Message *mess)   Write message (perhaps with raw data attached) to the log by calling "lg->handler(lg->data, mess)". More...
  REG  REG_Create (void *data, FREG_Get get, FREG_Set set, FREG_Cleanup cleanup, MT_LOCK lock)   Create a new registry (with an internal reference count set to 1). More...
  void  REG_Reset (REG rg, void *data, FREG_Get get, FREG_Set set, FREG_Cleanup cleanup, int do_cleanup)   Reset the registry handle to use the new "data", "set", "get", and "cleanup". More...
  REG  REG_AddRef (REG rg)   Increment internal reference count by 1, then return "rg". More...
  REG  REG_Delete (REG rg)   Decrement internal reference count by 1, and if it reaches 0, then call "rg->cleanup(rg->data)", destroy the handle, and return NULL; otherwise (if the reference count is still > 0), return "rg". More...
  const char *  REG_Get (REG rg, const char *section, const char *name, char *value, size_t value_size, const char *def_value)   Copy the registry value stored in "section" under name "name" to buffer "value"; if the entry is found in both transient and persistent storages, then copy the one from the transient storage. More...
  int  REG_Set (REG rg, const char *section, const char *name, const char *value, EREG_Storage storage)   Store the "value" into the registry section "section" under the key "name", and according to "storage". More...
  REG  REG_cxx2c (IRWRegistry *reg, bool pass_ownership=false)   Convert a C++ Toolkit registry object to a REG registry. More...
  REG  REG_cxx2c (const IRWRegistry *reg, bool pass_ownership=false)   Convert a C++ Toolkit read-only registry object to a REG registry. More...
  LOG  LOG_cxx2c (void)   Create LOG on top of C++ Toolkit CNcbiDiag. More...
  MT_LOCK  MT_LOCK_cxx2c (CRWLock *lock=0, bool pass_ownership=false)   Convert a C++ Toolkit lock object to an MT_LOCK lock. More...
  void  CONNECT_Init (const IRWRegistry *reg=0, CRWLock *lock=0, TConnectInitFlags flag=eConnectInit_OwnNothing, FSSLSetup ssl=0)   Init [X]CONNECT library with the specified "reg" and "lock" (ownership for either or both can be detailed in the "flag" parameter). More...
    CConnIniter::CConnIniter (void)   const STimeoutg_CTimeoutToSTimeout (const CTimeout &cto, STimeout &sto)   CTimeout/STimeout adapters. More...
  CTimeout  g_STimeoutToCTimeout (const STimeout *sto)   Convert STimeout to CTimeout. More...
    CRateMonitor::CRateMonitor (double minspan=0.5, double maxspan=10.0, double weight=0.5, double precision=0.95)   Monitor position progressing in time, calculate speed and estimate time to complete the job (when the final size is known). More...
  void  CRateMonitor::SetSize (Uint8 size)   Set size of the anticipated job, clear all prior measurements. More...
  Uint8  CRateMonitor::GetSize (void) const   Get size previously set. More...
  Uint8  CRateMonitor::GetPos (void) const   Get current progress position (position 0 when job starts) More...
  double  CRateMonitor::GetTime (void) const   Get current time (time 0.0 when job starts) More...
  void  CRateMonitor::Mark (Uint8 pos, double time)   Submit a mark of the job progress. More...
  double  CRateMonitor::GetRate (void) const   How fast the recent rate has been, in positions per time unit, using the weighted formula. More...
  double  CRateMonitor::GetPace (void) const   How fast the average pace has been so far, in positions per time unit. More...
  double  CRateMonitor::GetETA (void) const   How long it will take to complete, at the current rate. More...
  double  CRateMonitor::GetTimeRemaining (void) const   How long it will take to complete, at the average pace. More...
    CSERV_Info::CSERV_Info (const string &host, unsigned short port, double rate, ESERV_Type type)   string  CSERV_Info::GetHost (void) const   unsigned short  CSERV_Info::GetPort (void) const   double  CSERV_Info::GetRate (void) const   ESERV_Type  CSERV_Info::GetType (void) const   vector< CSERV_InfoSERV_GetServers (const string &service, TSERV_TypeOnly types=fSERV_Any)   Get the servers for a given service. More...
  unsigned long  NcbiTimeoutToMs (const STimeout *timeout)   STimeoutNcbiMsToTimeout (STimeout *timeout, unsigned long ms)   void  CORE_SetLOCK (MT_LOCK lk)   Set the MT critical section lock/unlock handler – to be used by the core internals for protection of internal static variables and other MT-sensitive code from being accessed/changed by several threads simultaneously. More...
  MT_LOCK  CORE_GetLOCK (void)   Get the lock handle that is to be used by the core internals. More...
  void  CORE_SetLOG (LOG lg)   Set the log handle (no logging if "lg" is passed zero) – to be used by the core internals (CORE LOG). More...
  LOG  CORE_GetLOG (void)   Get the log handle that is to be used by the core internals (CORE LOG). More...
  void  CORE_SetLOGFILE_Ex (FILE *fp, ELOG_Level cut_off, ELOG_Level fatal_err, int auto_close)   Standard logging (CORE LOG) to the specified file stream. More...
  void  CORE_SetLOGFILE (FILE *fp, int auto_close)   Same as CORE_SetLOGFILE_Ex(fp, CORE_LOGFILE_CUTOFF_LEVEL, eLOG_Fatal, auto_close). More...
  int  CORE_SetLOGFILE_NAME_Ex (const char *logfile, ELOG_Level cut_off, ELOG_Level fatal_err)   Same as CORE_SetLOGFILE_Ex(fopen(logfile, "a"), cut_off, fatal_err, TRUE). More...
  int  CORE_SetLOGFILE_NAME (const char *logfile)   Same as CORE_SetLOGFILE_NAME_Ex(logfile, CORE_LOGFILE_CUTOFF_LEVEL, eLOG_Fatal). More...
  TLOG_FormatFlags  CORE_SetLOGFormatFlags (TLOG_FormatFlags)   char *  LOG_ComposeMessage (const SLOG_Message *mess, TLOG_FormatFlags flags)   Compose a message using the "call_data" info. More...
  void  LOG_ToFILE_Ex (LOG lg, FILE *fp, ELOG_Level cut_off, ELOG_Level fatal_err, int auto_close)   LOG_Reset specialized to log to a "FILE*" stream using LOG_ComposeMessage. More...
  void  LOG_ToFILE (LOG lg, FILE *fp, int auto_close)   Same as LOG_ToFILEx(lg, fp, eLOG_Trace, eLOG_Fatal, auto_close). More...
  const char *  NcbiMessagePlusError (int *dynamic, const char *message, int error, const char *descr)   Add current "error" (and maybe its description) to the message: <message>[ {error=[[<error>][,]][<descr>]}]. More...
  void  CORE_SetREG (REG rg)   Set the registry (no registry if "rg" is passed zero) – to be used by the core internals. More...
  REG  CORE_GetREG (void)   Get the registry that is to be used by the core internals. More...
  const char *  CORE_GetAppName (void)   Obtain current application name (toolkit dependent). More...
  const char *  CORE_GetPlatform (void)   Return NCBI platrofm ID (if known). More...
  char *  CORE_GetNcbiRequestID (ENcbiRequestID reqid)   Obtain current NCBI request ID (if known, per thread). More...
  const char *  CORE_GetUsernameEx (char *buf, size_t bufsize, ECORE_Username username)   Obtain and store in the buffer provided, the best (as possible) user name that matches the requested username selector. More...
  const char *  CORE_GetUsername (char *buf, size_t bufsize)   Equivalent to CORE_GetUsernameEx(buf, bufsize, eNCBI_UsernameLogin) except that it always returns non-empty "buf" when successful, or NULL otherwise (i.e. More...
  size_t  CORE_GetVMPageSize (void)   Obtain virtual memory page size. More...
  void  CORE_Msdelay (unsigned long ms)   Delay execution of the current thread by the specified number of milliseconds. More...
  unsigned int  UTIL_CRC32_Update (unsigned int checksum, const void *ptr, size_t len)   Calculate/Update CRC-32 checksum NB: Initial checksum is "0". More...
  unsigned int  UTIL_Adler32_Update (unsigned int checksum, const void *ptr, size_t len)   Calculate/Update Adler-32 checksum NB: Initial checksum is "1". More...
  void *  UTIL_GenerateHMAC (const SHASH_Descriptor *hash, const void *text, size_t text_len, const void *key, size_t key_len, void *digest)   Generate an RFC2401 digest (HMAC). More...
  int  UTIL_MatchesMaskEx (const char *text, const char *mask, int ignore_case)   Match a given text with a given pattern mask. More...
  int  UTIL_MatchesMask (const char *text, const char *mask)   Shortcut for UTIL_MatchesMaskEx(text, mask, 1), that is matching is done case-insensitively for the letters (a-z). More...
  char *  UTIL_NcbiLocalHostName (char *hostname)   Cut off well-known NCBI domain suffix out of the passed "hostname". More...
  size_t  UTIL_PrintableStringSize (const char *data, size_t size)   Calculate size of buffer needed to store printable representation of the block of data of the specified size (or, if size is 0, strlen(data)) but without the '\0' terminator. More...
  char *  UTIL_PrintableStringEx (const char *data, size_t size, char *buf, TUTIL_PrintableFlags flags, int width)   Create a printable representation of a block of data of the specified size (or, if size is 0, strlen(data)), and return the buffer pointer past the last stored character (non '\0'-terminated). More...
  int  UTIL_HelpRequested (int argc, char **argv)   Given the main()'s argc and argv return non-zero (true) if the arguments specify that only a help option was requested. More...
  time_t  UTIL_Timezone (void)   Return timezone offset (in seconds West of UTC) for the current time zone. More...
  void  UTIL_ReleaseBufferOnHeap (const void *ptr)  

__STDC_FORMAT_MACROS

◆ CONN_CONTENT_TYPE_LEN ◆ ConnNetInfo_PostOverrideUserHeader ◆ CORE_CURRENT_FUNCTION #define CORE_CURRENT_FUNCTION   0 ◆ CORE_LOGFILE_CUTOFF_LEVEL ◆ DEF_CONN_ARGS ◆ DEF_CONN_DEBUG_PRINTOUT ◆ DEF_CONN_EXTERNAL ◆ DEF_CONN_FIREWALL ◆ DEF_CONN_HOST #define DEF_CONN_HOST   "www.ncbi.nlm.nih.gov"

Definition at line 247 of file ncbi_connutil.h.

◆ DEF_CONN_HTTP_PROXY_HOST ◆ DEF_CONN_HTTP_PROXY_LEAK ◆ DEF_CONN_HTTP_PROXY_PASS ◆ DEF_CONN_HTTP_PROXY_PORT ◆ DEF_CONN_HTTP_PROXY_SKIP ◆ DEF_CONN_HTTP_PROXY_USER ◆ DEF_CONN_HTTP_PUSH_AUTH ◆ DEF_CONN_HTTP_REFERER ◆ DEF_CONN_HTTP_USER_HEADER ◆ DEF_CONN_HTTP_VERSION ◆ DEF_CONN_LB_DISABLE ◆ DEF_CONN_LOCAL_IPS ◆ DEF_CONN_LOCAL_IPS_DISABLE ◆ DEF_CONN_MAX_TRY ◆ DEF_CONN_PASS ◆ DEF_CONN_PATH #define DEF_CONN_PATH   "/Service/dispd.cgi"

Definition at line 253 of file ncbi_connutil.h.

◆ DEF_CONN_PORT ◆ DEF_CONN_REG_SECTION ◆ DEF_CONN_REQ_METHOD ◆ DEF_CONN_STATELESS ◆ DEF_CONN_TIMEOUT ◆ DEF_CONN_USER ◆ EIO_N_STATUS

connection is / has been closed, EOF condition

Definition at line 141 of file ncbi_core.h.

◆ fLOG_Full ◆ fLOG_Short ◆ kDefaultTimeout ◆ kInfiniteTimeout ◆ LOG_DATA Value:

__FILE__, __LINE__, message,

data

,

size

)

#define THIS_MODULE

Default for THIS_MODULE.

#define CORE_CURRENT_FUNCTION

Get current function name.

void LOG_Write(LOG lg, int code, int subcode, ELOG_Level level, const char *module, const char *func, const char *file, int line, const char *message, const void *raw_data, size_t raw_size)

Upon having filled SLOG_Message data from parameters, write a message (perhaps with raw data attached...

const struct ncbi::grid::netcache::search::fields::SIZE size

static SLJIT_INLINE sljit_ins lg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

Definition at line 150 of file ncbi_util.h.

◆ LOG_WRITE #define LOG_WRITE (   lg,   code,   subcode,   level,   message  ) Value:

__FILE__, __LINE__, message, 0, 0)

Auxiliary plain macros to write message (maybe, with raw data) to the log.

See also
LOG_Write

Definition at line 141 of file ncbi_util.h.

◆ MAX_CONTENT_TYPE_LEN ◆ MT_LOCK_Do

Call "lk->handler(lk->data, how)".

Parameters
lk A handle previously obtained from MT_LOCK_Create how Whether to lock (and how: read, write) or to unlock
Returns
Value returned by the lock handler ("handler" in MT_LOCK_Create()). If the lock handler is not specified then always return "-1" (noop).
Note
Use MT_LOCK_Do() to avoid overhead!
See also
MT_LOCK_Create, FMT_LOCK_Handler, EMT_Lock

Definition at line 270 of file ncbi_core.h.

◆ NCBI_BIGCOUNT_FORMAT_SPEC ◆ NCBI_BIGCOUNT_FORMAT_SPEC_HEX ◆ NCBI_BIGCOUNT_FORMAT_SPEC_HEX_X ◆ NCBI_CONNUTIL_DEPRECATED ◆ NCBI_EOWNERSHIP_DEFINED #define NCBI_EOWNERSHIP_DEFINED ◆ NCBI_ESWITCH_DEFINED #define NCBI_ESWITCH_DEFINED

Definition at line 96 of file ncbi_types.h.

◆ NCBI_TIME_INFINITE ◆ REG_CONN_ARGS ◆ REG_CONN_DEBUG_PRINTOUT #define REG_CONN_DEBUG_PRINTOUT   "DEBUG_PRINTOUT"

Definition at line 300 of file ncbi_connutil.h.

◆ REG_CONN_DISPD_DISABLE #define REG_CONN_DISPD_DISABLE   "DISPD_DISABLE"

Definition at line 316 of file ncbi_connutil.h.

◆ REG_CONN_EXTERNAL ◆ REG_CONN_FIREWALL ◆ REG_CONN_HOST ◆ REG_CONN_HTTP_PROXY_HOST #define REG_CONN_HTTP_PROXY_HOST   "HTTP_PROXY_HOST"

Definition at line 258 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PROXY_LEAK #define REG_CONN_HTTP_PROXY_LEAK   "HTTP_PROXY_LEAK"

Definition at line 270 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PROXY_PASS #define REG_CONN_HTTP_PROXY_PASS   "HTTP_PROXY_PASS"

Definition at line 267 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PROXY_PORT #define REG_CONN_HTTP_PROXY_PORT   "HTTP_PROXY_PORT"

Definition at line 261 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PROXY_SKIP #define REG_CONN_HTTP_PROXY_SKIP   "HTTP_PROXY_SKIP"

Definition at line 273 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PROXY_USER #define REG_CONN_HTTP_PROXY_USER   "HTTP_PROXY_USER"

Definition at line 264 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_PUSH_AUTH #define REG_CONN_HTTP_PUSH_AUTH   "HTTP_PUSH_AUTH"

Definition at line 276 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_REFERER #define REG_CONN_HTTP_REFERER   "HTTP_REFERER"

Definition at line 306 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_USER_HEADER #define REG_CONN_HTTP_USER_HEADER   "HTTP_USER_HEADER"

Definition at line 303 of file ncbi_connutil.h.

◆ REG_CONN_HTTP_VERSION #define REG_CONN_HTTP_VERSION   "HTTP_VERSION"

Definition at line 297 of file ncbi_connutil.h.

◆ REG_CONN_IMPLICIT_SERVER_TYPE #define REG_CONN_IMPLICIT_SERVER_TYPE   "IMPLICIT_SERVER_TYPE"

Definition at line 328 of file ncbi_connutil.h.

◆ REG_CONN_LB_DISABLE ◆ REG_CONN_LBDNS_ENABLE #define REG_CONN_LBDNS_ENABLE   "LBDNS_ENABLE"

Definition at line 313 of file ncbi_connutil.h.

◆ REG_CONN_LBNULL_ENABLE #define REG_CONN_LBNULL_ENABLE   "LBNULL_ENABLE"

Definition at line 311 of file ncbi_connutil.h.

◆ REG_CONN_LBSMD_DISABLE #define REG_CONN_LBSMD_DISABLE   "LBSMD_DISABLE"

Definition at line 312 of file ncbi_connutil.h.

◆ REG_CONN_LINKERD_ENABLE #define REG_CONN_LINKERD_ENABLE   "LINKERD_ENABLE"

Definition at line 314 of file ncbi_connutil.h.

◆ REG_CONN_LOCAL_ENABLE #define REG_CONN_LOCAL_ENABLE   "LOCAL_ENABLE"

Definition at line 310 of file ncbi_connutil.h.

◆ REG_CONN_LOCAL_IPS ◆ REG_CONN_LOCAL_SERVER ◆ REG_CONN_LOCAL_SERVICES ◆ REG_CONN_MAX_TRY ◆ REG_CONN_NAMERD_ENABLE #define REG_CONN_NAMERD_ENABLE   "NAMERD_ENABLE"

Definition at line 315 of file ncbi_connutil.h.

◆ REG_CONN_PASS ◆ REG_CONN_PATH ◆ REG_CONN_PORT ◆ REG_CONN_REQ_METHOD ◆ REG_CONN_SERVICE_NAME ◆ REG_CONN_STATELESS ◆ REG_CONN_TIMEOUT ◆ REG_CONN_USER ◆ THIS_MODULE ◆ UTIL_PRINTABLE_WIDTH #define UTIL_PRINTABLE_WIDTH   130 /** Default printable width for data */

Definition at line 723 of file ncbi_util.h.

◆ UTIL_PRINTABLE_WIDTH_MIN #define UTIL_PRINTABLE_WIDTH_MIN   80 /** Default minimum printable width */

Definition at line 722 of file ncbi_util.h.

◆ UTIL_PrintableString ◆ UTIL_ReleaseBuffer #define UTIL_ReleaseBuffer (   x )    /*void*/

Definition at line 818 of file ncbi_util.h.

◆ UTIL_TcharToUtf8 #define UTIL_TcharToUtf8 (   x )    (x)

Definition at line 816 of file ncbi_util.h.

◆ UTIL_TcharToUtf8OnHeap #define UTIL_TcharToUtf8OnHeap (   x )    (x) ◆ UTIL_Utf8ToTchar #define UTIL_Utf8ToTchar (   x )    (x)

Definition at line 817 of file ncbi_util.h.

◆ EBDebugPrintout ◆ EBFWMode ◆ EBProxyType ◆ EBURLScheme ◆ EOwnership

Ownership relations between objects.

Can be used to define or transfer ownership of objects. For example, specify if a CSocket object owns its underlying SOCK object.

◆ ESwitch ◆ FLOG_Cleanup typedef void(* FLOG_Cleanup) (void *data) ◆ FLOG_Handler ◆ FMT_LOCK_Cleanup typedef void(* FMT_LOCK_Cleanup) (void *data) ◆ FMT_LOCK_Handler

MT locking callback (operates like a [recursive] mutex or RW-lock).

Parameters
Returns
Non-zero value if the requested operation was successful.
Note
The "-1" value is reserved for unset handler; you also may want to return "-1" if your locking function does no locking, and you don't consider it as an error, but still want the caller to be aware of this "rightful non-doing" as opposed to the "rightful doing".
See also
MT_LOCK_Create, MT_LOCK_Delete

Definition at line 204 of file ncbi_core.h.

◆ FREG_Cleanup typedef void(* FREG_Cleanup) (void *data)

Registry cleanup callback.

Parameters
data Unspecified data as passed to REG_Create or REG_Reset
See also
REG_Reset, REG_Delete

Definition at line 603 of file ncbi_core.h.

◆ FREG_Get

Registry getter callback.

Copy registry value stored in "section" under "name" to the "value" buffer. Look for a matching entry first in the transient storage, and then in the persistent storage.

Note
Do not modify "value" (leave it "as is", i.e. empty) if the requested entry was not found in the registry; then, return -1.
Always terminate the "value" with '\0'.
Do not put more than "value_size" bytes into "value" (incl. trailing '\0').
Parameters
data Unspecified data as passed to REG_Create or REG_Reset section Section name to search name Key name to search within the section value Empty value passed in, found (if any) value out value_size Size of "value" storage, must be greater than 0
Returns
1 if successfully found and stored; -1 if not found (the default is to be used); 0 if an error (including truncation) occurred
See also
REG_Create, REG_Reset, REG_Get, FREG_Set

Definition at line 561 of file ncbi_core.h.

◆ FREG_Set

Registry setter callback.

Store the "value" in the registry "section" under the "name" key, and according to "storage".

Parameters
data Unspecified data as passed to REG_Create or REG_Reset section Section name to add the key to name Key name to add to the section value Key value to associate with the key (NULL to deassociate, i.e. unset) storage How to store the new setting, temporarily or permanently
Returns
Non-zero if successful (including replacing a value with itself)
See also
REG_Create, REG_Reset, EREG_Storage, REG_Set, FREG_Get

Definition at line 588 of file ncbi_core.h.

◆ LOG ◆ MT_LOCK ◆ NCBI_BLOWFISH

Opaque encryption / decryption context type.

Definition at line 56 of file ncbi_blowfish.h.

◆ REG ◆ STimeout ◆ TConnectInitFlags ◆ TLOG_FormatFlags

bitwise OR of "ELOG_FormatFlag"

Definition at line 300 of file ncbi_util.h.

◆ TMark ◆ TNCBI_BigCount

Big unsigned integer for file size and position.

Definition at line 163 of file ncbi_types.h.

◆ TNCBI_Size

Fixed-size analogs of size_t and time_t (mainly for IPC)

NCBI_EOWNERSHIP_DEFINED

Definition at line 143 of file ncbi_types.h.

◆ TNCBI_Time ◆ TReqMethod ◆ TUTIL_PrintableFlags

Bitwise "OR" of EUTIL_PrintableFlags.

Definition at line 732 of file ncbi_util.h.

◆ EConnectInitFlag

CONNECT_Init flags: which parameters to own / initialize.

See also
CONNECT_Init
Enumerator eConnectInit_OwnNothing 

Original ownership gets retained.

eConnectInit_OwnRegistry 

Registry ownership gets passed.

eConnectInit_OwnLock 

Lock ownership gets passed.

eConnectInit_NoSSL 

Do NOT init secure socket layer (SSL)

Definition at line 115 of file ncbi_core_cxx.hpp.

◆ ECORE_Username

Select which username is the most preferable to obtain from the system.

Enumerator eCORE_UsernameCurrent 

process UID

eCORE_UsernameLogin 

login UID

eCORE_UsernameReal 

real UID

Definition at line 463 of file ncbi_util.h.

◆ EDebugPrintout Enumerator eDebugPrintout_None  eDebugPrintout_Some  eDebugPrintout_Data 

Definition at line 162 of file ncbi_connutil.h.

◆ EFWMode Enumerator eFWMode_Legacy 

Relay, no firewall.

eFWMode_Adaptive 

Regular firewall ports first, then fallback.

eFWMode_Firewall 

Regular firewall ports only, no fallback.

eFWMode_Fallback 

Fallback ports only (w/o trying any regular)

Definition at line 152 of file ncbi_connutil.h.

◆ EIO_Event

I/O event (or direction).

Note
Internally, these constants are used as bit-values, and therefore must not be changed in this header. On the other hand, user code should not rely on the values of these constants, either.
Warning
Careful with an unfortunate naming similarity of eIO_Close from this enum and EIO_Status::eIO_Closed – do not mix the two!
See also
SOCK_Wait, SOCK_Poll, CONN_Wait, SOCK_SetTimeout, CONN_SetTimeout
Enumerator eIO_Open 

also serves as no-event indicator in SOCK_Poll

eIO_Read 

read

eIO_Write 

write

eIO_ReadWrite 

eIO_Read | eIO_Write (also, eCONN_OnFlush)

eIO_Close 

also serves as an error indicator in SOCK_Poll

Definition at line 118 of file ncbi_core.h.

◆ EIO_ReadMethod

I/O read method.

See also
EIO_WriteMethod
Enumerator eIO_ReadPeek 

do eIO_ReadPlain but leave data in input queue

eIO_ReadPlain but don't discard data read from CONN, the peek'ed data get extracted from CONNECTOR but stored internally in the CONN buffer, a non-peek read takes data (if any) from that buffer first; *

eIO_ReadPlain 

read readily available data only, wait if none

Read up to "size" bytes from connection to the buffer pointed to by "buf".

Return the number of actually read bytes in "*n_read". May not return eIO_Success if no data at all can be read before either the read timeout expires or an error occurs. Parameter "how" modifies the read behavior: * return immediately after having read as many as just 1 byte from connection (return eIO_Success), or if an error has occurred (and "*n_read == 0"); *

eIO_ReadPersist 

read exactly as much as requested, w/waits

return only after having filled full "buf" with data (exactly "size" bytes, eIO_Success), or if an error has occurred (fewer bytes, non-eIO_Success).

Note
when reading from internal CONN's pending input buffer (that keeps data from previous peeks or pushbacks, eIO_ReadPlain and eIO_ReadPeek behave differently: if there was at least some data obtained from the buffer, then eIO_ReadPlain returns immediately with that data, and does not call CONNECTOR's "Read" method; on the other hand, if eIO_ReadPeek received less than the requested amount of data from the buffer, then it proceeds with CONNECTOR's "Read" method to obtain more data – this behavior is to prevent peeks from spinning, because all the same data are otherwise persistenly available from the pending buffer, and I/O cannot progress with getting more data.
if "conn" has the fCONN_Supplement flag set, then the return code can be non-eIO_Success even with some read data (indicated by "*n_read"), to signify that an error has been _following_ the just read block of data (e.g. eIO_Closed for EOF encountered).
See CONN_SetTimeout() for how to set the read timeout.
See also
CONN_SetTimeout, CONN_ReadLine, CONN_PushBack

Definition at line 88 of file ncbi_core.h.

◆ EIO_Status

I/O status.

Warning
Careful with an unfortunate naming similarity of eIO_Closed from this enum and EIO_Event::eIO_Close – do not mix the two!
Enumerator eIO_Success 

everything is fine, no error occurred

eIO_Timeout 

timeout expired before any I/O succeeded

eIO_Reserved 

reserved status code – DO NOT USE!

eIO_Interrupt 

signal arrival prevented any I/O to succeed

eIO_InvalidArg 

bad argument / parameter value(s) supplied

eIO_NotSupported 

operation is not supported or is not available

eIO_Unknown 

unknown I/O error (likely fatal but can retry)

Definition at line 132 of file ncbi_core.h.

◆ EIO_WriteMethod

I/O write method.

See also
EIO_ReadMethod
Enumerator eIO_WriteNone 

invalid reserved opcode, not for use!

eIO_WritePlain 

write as much as possible, report back how much

Write up to "size" bytes from the buffer "buf" to the connection.

Return the number of actually written bytes in "*n_written". May not return eIO_Success if no data at all can be written before either the write timeout expires or an error occurs. Parameter "how" modifies the write behavior: * return immediately after having written as little as 1 byte of data (return eIO_Success), or if an error has occurred (and "*n_written == 0"); *

eIO_WritePersist 

write exactly as much as specified, w/waits

return only after having written all of the data from "buf" (return eIO_Success), or if an error has occurred (fewer bytes written, non-eIO_Success).

Note
if "conn" has the fCONN_Supplement flag set, then the return code can be non-eIO_Success even with some data written (as indicated by "*n_written"), to signify that an error has occurred _past_ the just written block of data.
See CONN_SetTimeout() for how to set the write timeout.
See also
CONN_SetTimeout
eIO_WriteOutOfBand 

write out-of-band chunk of urgent data (if supp)

Definition at line 99 of file ncbi_core.h.

◆ ELOG_FormatFlag

LOG formatting flags: what parts of the message to actually appear.

See also
CORE_SetLOGFormatFlags
Enumerator fLOG_Default 

fLOG_Short if NDEBUG, else fLOG_Full

fLOG_Level  fLOG_Module  fLOG_FileLine  fLOG_DateTime  fLOG_Function  fLOG_FullOctal 

do not do reduction in octal data bytes

fLOG_OmitNoteLevel 

do not add "NOTE" if level is eLOG_Note

fLOG_None 

nothing but spec'd parts, msg and data

Definition at line 289 of file ncbi_util.h.

◆ ELOG_Level

Log severity level.

Enumerator eLOG_Trace  eLOG_Note  eLOG_Info 

In C++ Toolkit "Info" is used, not "Note".

eLOG_Warning  eLOG_Error  eLOG_Critical  eLOG_Fatal 

Definition at line 292 of file ncbi_core.h.

◆ EMIME_Encoding Enumerator eENCOD_None  eENCOD_Url  eENCOD_Unknown 

Definition at line 1060 of file ncbi_connutil.h.

◆ EMIME_SubType Enumerator eMIME_Undefined  eMIME_Dispatch  eMIME_AsnText  eMIME_AsnBinary  eMIME_Fasta  eMIME_WwwForm  eMIME_Html  eMIME_Plain  eMIME_Xml  eMIME_XmlSoap  eMIME_OctetStream  eMIME_Unknown 

Definition at line 1040 of file ncbi_connutil.h.

◆ EMIME_Type Enumerator eMIME_T_Undefined  eMIME_T_NcbiData  eMIME_T_Text  eMIME_T_Application  eMIME_T_Unknown 

Definition at line 1028 of file ncbi_connutil.h.

◆ EMT_Lock

Set the lock/unlock callback function and its data for MT critical section.

Note
If the RW-lock functionality is not provided by the callback, then: eMT_LockRead <==> eMT_Lock
Enumerator eMT_Lock 

lock critical section

eMT_LockRead 

lock critical section for reading

eMT_Unlock 

unlock critical section

eMT_TryLock 

try to lock, return immediately

eMT_TryLockRead 

try to lock for reading, return immediately

Definition at line 180 of file ncbi_core.h.

◆ ENcbiOwnership

Ownership relations between objects.

Can be used to define or transfer ownership of objects. For example, specify if a CSocket object owns its underlying SOCK object.

Enumerator eNoOwnership 

No ownership is assumed.

eTakeOwnership 

An object can take ownership of another.

eNoOwnership  eTakeOwnership 

No ownership assumed.

An object can take ownership of another

Definition at line 133 of file ncbi_types.h.

◆ ENcbiRequestID

NCBI request ID enumerator.

Enumerator eNcbiRequestID_None  eNcbiRequestID_HitID 

NCBI Hit ID.

eNcbiRequestID_SID 

NCBI Session ID.

eNcbiTraceState 

OpenTelemetry tracestate header.

eNcbiTraceParent 

OpenTelemetry traceparent header.

Definition at line 444 of file ncbi_util.h.

◆ ENcbiSwitch

Aux.

enum to set/unset/default various features.

Enumerator eOff  eOn  eDefault  eOff  eOn  eDefault 

Definition at line 108 of file ncbi_types.h.

◆ EProxyType Enumerator fProxy_None 

No $http_proxy / $https_proxy used.

fProxy_Http 

$http_proxy used

fProxy_Https 

$https_proxy used

Definition at line 171 of file ncbi_connutil.h.

◆ EREG_Storage

Transient/Persistent storage.

See also
REG_Get, REG_Set
Enumerator eREG_Transient 

only in-memory storage while program runs

eREG_Persistent 

hard-copy storage across program runs

Definition at line 528 of file ncbi_core.h.

◆ EReqMethod Enumerator eReqMethod_Any  eReqMethod_Get  eReqMethod_Post  eReqMethod_Head  eReqMethod_Connect  eReqMethod_v1  eReqMethod_Any11  eReqMethod_Get11  eReqMethod_Post11  eReqMethod_Head11  eReqMethod_Connect11  eReqMethod_Put  eReqMethod_Patch  eReqMethod_Trace  eReqMethod_Delete  eReqMethod_Options 

Definition at line 117 of file ncbi_connutil.h.

◆ EURLScheme Enumerator eURL_Unspec  eURL_Https  eURL_File  eURL_Http  eURL_Ftp 

Definition at line 141 of file ncbi_connutil.h.

◆ EUTIL_PrintableFlags Enumerator fUTIL_PrintableFullOctal 

No contactions in octals \ooo.

eUTIL_PrintableFullOctal 

deprecated

fUTIL_PrintableNoNewLine 

Do not include graphical newlines.

eUTIL_PrintableNoNewLine 

deprecated

Definition at line 726 of file ncbi_util.h.

◆ BUF_StripToPattern() EIO_Status BUF_StripToPattern ( BUF  buffer, const void *  pattern, size_t  pattern_size, BUFdiscard, size_t *  n_discarded  ) ◆ CConnIniter() CConnIniter::CConnIniter ( void  ) protected ◆ CONN_StripToPattern() EIO_Status CONN_StripToPattern ( CONN  conn, const void *  pattern, size_t  pattern_size, BUFdiscard, size_t *  n_discarded  )

Discard all input data before (and including) the first occurrence of a "pattern".

If "discard" is not NULL then add the stripped data (including the "pattern") to it. If "n_discarded" is not NULL then "*n_discarded" will get the number of actually stripped bytes. If there was some excess read, push it back to the original source (and not count as discarded). NOTE: If "pattern_size" == 0, then "pattern" is ignored (and is assumed to be NULL), and the stripping continues until EOF; if "pattern" is NULL and "pattern_size" is not 0, then exactly "pattern_size" bytes will have attempted to be stripped (unless an I/O error occurs prematurely).

Returns
eIO_Success when the requested operation has completed successfully (pattern found, or the requested number of bytes was skipped, including when either was followed by the end-of-file condition), and if the "discard" buffer was provided, then everything skipped has been successfully stored in it. Otherwise, return other error code, and store everything read / skipped thus far in the "discard" buffer, if provided. Naturally, it never returns eIO_Success when requested to skip through the end of file, but eIO_Closed when the EOF has been reached. Note that memory allocation errors (such as unable to save skipped data in the "discard" buffer) will be assigned the eIO_Unknown code – which as well can be returned from the failing I/O).
Note
To distiguish the nature of eIO_Unknown (whether it is I/O or memory) one can check the grow of the buffer size after the call, and compare it to the value of "*n_discarded": if they agree, there was an I/O error, not the buffer's.

Definition at line 3019 of file ncbi_connutil.c.

References conn, s_CONN_IO(), and s_StripToPattern().

◆ CONNECT_Init()

Init [X]CONNECT library with the specified "reg" and "lock" (ownership for either or both can be detailed in the "flag" parameter).

Warning
MUST be called in MT applications to make CONNECT MT-safe, or alternatively, CConnIniter must be used as a base-class.
Parameters
reg Registry to use, non-modifiable (none if NULL) lock Lock to use (new lock will get created if NULL) flag Ownership / initialization control ssl TLS provider to use for SSL (ignored if eConnectInit_NoSSL; 0 selects the default provider)
Note
LOG will get created out of CNcbiDiag automatically.
See also
EConnectInitFlag, CConnIniter, REG_cxx2c, LOG_cxx2c, MT_LOCK_cxx2c, NcbiSetupTls, SOCK_SetupSSL, CNcbiApplication, CRWLock, CNcbiRegistry, CNcbiDiag

Definition at line 783 of file ncbi_core_cxx.cpp.

References _TRACE, eConnectInit_Explicit, eConnectInit_NoSSL, g_CORE_Set, NCBI_CATCH_ALL_X, NcbiSetupTls(), NStr::PtrToString(), s_Init(), and NStr::UIntToString().

Referenced by CBsDiffApp::CBsDiffApp(), CDemoApp::Init(), NCBITEST_AUTO_INIT(), CSrcChkApp::Run(), CAnnotWriterApp::Run(), CAsn2FastaApp::Run(), CAsn2FlatApp::Run(), CCleanupApp::Run(), CNCBIwxApplication::Run(), CAgpValidateApplication::Run(), CId2FetchApp::Run(), CAlnBuildApp::Run(), CPairwiseAlnApp::Run(), CSampleAlnmgrApplication::Run(), CEditBioseqSampleApp::Run(), CSampleObjmgrApplication::Run(), and CTbl2AsnApp::Setup().

◆ ConnNetInfo_AddPath() ◆ ConnNetInfo_AppendArg() ◆ ConnNetInfo_AppendUserHeader() ◆ ConnNetInfo_Boolean() int ConnNetInfo_Boolean ( const char *  str )

Definition at line 405 of file ncbi_connutil.c.

References CORE_LOGF_X, eLOG_Warning, str(), strcasecmp, strnlen, and toupper().

Referenced by ConnNetInfo_CreateInternal(), SERV_LBDNS_Open(), SERV_LBNULL_Open(), x_ErrorHeaderOnly(), x_IsMapperConfigured(), x_NcbiSetupTls(), x_ParseFirewall(), and x_UnsafeRedirectOK().

◆ ConnNetInfo_Clone()

Definition at line 2111 of file ncbi_connutil.c.

References assert, ConnNetInfo_CloneInternal(), ConnNetInfo_Destroy(), SConnNetInfo::http_referer, SConnNetInfo::http_user_header, info, s_InfoIsValid(), and strdup.

Referenced by s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_FtpConnectorBuilder(), s_HttpConnectorBuilder(), s_ServiceConnectorBuilder(), s_SocketConnectorBuilder(), s_VT_Open(), SERV_DISPD_Open(), SERV_LINKERD_Open(), SERV_NAMERD_Open(), and SERVICE_CreateConnectorEx().

◆ ConnNetInfo_Create()

Definition at line 986 of file ncbi_connutil.c.

References assert, ConnNetInfo_CreateInternal(), free(), and SERV_ServiceName().

Referenced by CRPCClient< TRequest, TReply >::AsyncConnect(), CReaderServiceConnector::Connect(), DBLB_GetServer(), CServiceDiscovery::DiscoverImpl(), CEUtils_Request::GetBaseURL(), CFtpUtils::GetDirContent(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), CTaxon1::Init(), s_LoadLocalIPs(), LbsmLookup::s_Resolve(), s_ServiceConnectorBuilder(), SERV_GetInfoSimple(), SERV_GetServers(), SERV_OpenSimple(), SFileTrackAPI::StartUpload(), CRPCClient< TRequest, TReply >::x_Connect(), CRPCClient< TRequest, TReply >::x_ConnectURL(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), CEutilsClient::x_GetHostName(), CBlastHitMatrixCGIApplication::x_GetSeqAnnot(), CHttpRequest::x_InitConnection(), x_IsUrlAccessible(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().

◆ ConnNetInfo_DeleteAllArgs() ◆ ConnNetInfo_DeleteArg() ◆ ConnNetInfo_DeleteUserHeader() ◆ ConnNetInfo_Destroy()

Definition at line 2478 of file ncbi_connutil.c.

References info, and x_DestroyNetInfo().

Referenced by ConnNetInfo_Clone(), DBLB_GetServer(), SCNIDeleter::Delete(), Deleter< SConnNetInfo >::Delete(), ConnInfoDeleter2::Delete(), ConnNetInfoDeleter::Delete(), CServiceDiscovery::DiscoverImpl(), CEUtils_Request::GetBaseURL(), CFtpUtils::GetDirContent(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), CTaxon1::Init(), s_CallAdjust(), s_Close(), s_Connect(), s_CreateHttpConnector(), s_Destroy(), s_DestroyHttpConnector(), s_FtpConnectorBuilder(), s_LoadLocalIPs(), s_VT_Open(), SERV_GetInfoSimple(), SERV_OpenSimple(), SERVICE_CreateConnectorEx(), SFileTrackAPI::StartUpload(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), CEutilsClient::x_GetHostName(), CHttpRequest::x_InitConnection(), x_IsUrlAccessible(), and x_SetupHttpProxy().

◆ ConnNetInfo_ExtendUserHeader() ◆ ConnNetInfo_GetArgs() ◆ ConnNetInfo_GetValue() const char* ConnNetInfo_GetValue ( const char *  service, const char *  param, char *  value, size_t  value_size, const char *  def_value  ) ◆ ConnNetInfo_Log()

Definition at line 2301 of file ncbi_connutil.c.

References assert, buf, eDebugPrintout_Data, eDebugPrintout_None, eDebugPrintout_Some, eLOG_Error, eLOG_Fatal, eReqMethod_v1, free(), info, len, lg(), LOG_WRITE, LOG_Write(), malloc(), NCBI_C_ERRCODE_X, s_InfoIsValid(), s_SaveBool(), s_SaveKeyval(), s_SaveString(), s_SaveULong(), s_SaveUserHeader(), strcat, UTIL_PrintableStringSize(), x_BadMagic(), x_CredInfo(), x_Firewall(), x_Num(), x_Port(), x_ProxyStr(), x_ReqMethod(), and x_Scheme().

Referenced by NcbiOpenURL(), s_Connect(), s_SocketConnectorBuilder(), and s_VT_Open().

◆ ConnNetInfo_OverrideUserHeader()

Definition at line 1272 of file ncbi_connutil.c.

References eUserHeaderOp_Override, info, and s_ModifyUserHeader().

Referenced by CConnTest::GetFWConnections(), s_Adjust(), s_Connect(), s_CreateHttpConnector(), s_HttpConnectorBuilder(), s_Open(), s_ReadHeader(), s_Resolve(), s_ServiceConnectorBuilder(), CHttpRequest::sx_Adjust(), x_Authenticate(), CRPCClient< TRequest, TReply >::x_FillConnNetInfo(), x_FixupUserHeader(), CHttpRequest::x_InitConnection(), x_SetHostPort(), and x_SetupConnectionParams().

◆ ConnNetInfo_ParseURL()

Definition at line 1347 of file ncbi_connutil.c.

References assert, eReqMethod_Connect, eReqMethod_v1, eURL_File, eURL_Http, eURL_Https, eURL_Unspec, if(), info, len, memmove, memrchr, NCBI_HasSpaces(), s_InfoIsValid(), strncasecmp, x_ParseHostPort(), and x_ParseScheme().

Referenced by CFtpUtils::GetDirContent(), NcbiOpenURL(), s_HttpConnectorBuilder(), CConn_HttpStream::sx_Adjust(), CHttpRequest::sx_Adjust(), CRPCClient< TRequest, TReply >::x_ConnectURL(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), x_Redirect(), and x_SetupHttpProxy().

◆ ConnNetInfo_PostOverrideArg() ◆ ConnNetInfo_PreOverrideArg() ◆ ConnNetInfo_PreOverrideUserHeader() ◆ ConnNetInfo_PrependArg() ◆ ConnNetInfo_PrependUserHeader() ◆ ConnNetInfo_SetArgs() ◆ ConnNetInfo_SetFrag() ◆ ConnNetInfo_SetPath() ◆ ConnNetInfo_SetTimeout() ◆ ConnNetInfo_SetupStandardArgs()

Definition at line 2010 of file ncbi_connutil.c.

References ConnNetInfo_DeleteArg(), ConnNetInfo_ExtendUserHeader(), ConnNetInfo_PreOverrideArg(), CORE_GetAppName(), CORE_GetPlatform(), free(), info, s_InfoIsValid(), SOCK_gethostbyaddr(), SOCK_gethostname(), and x_ClientAddress().

Referenced by CConnTest::DispatcherOkay(), CConnTest::GetFWConnections(), s_AdjustNetParams(), s_LoadLocalIPs(), SERV_DISPD_Open(), and SERV_NAMERD_Open().

◆ ConnNetInfo_SetUserHeader() ◆ ConnNetInfo_URL()

Definition at line 2417 of file ncbi_connutil.c.

References assert, eReqMethod_Connect, eReqMethod_v1, info, len, malloc(), s_InfoIsValid(), strlwr, and x_Scheme().

Referenced by s_Adjust(), s_Connect(), s_ConnectAndSend(), s_Read(), s_ReadData(), s_ReadHeader(), s_Resolve(), s_VT_Descr(), s_VT_Open(), s_VT_Write(), CHttpRequest::sx_Adjust(), x_ReadChunkHead(), x_ReadChunkTail(), and x_SetDefaultReferer().

◆ CORE_GetAppName() const char* CORE_GetAppName ( void  )

Obtain current application name (toolkit dependent).

Returns
Return an empty string ("") when the application name cannot be determined; otherwise, return a '\0'-terminated string

NOTE that setting an application name concurrently with this call can cause undefined behavior or a stale pointer returned.

Definition at line 716 of file ncbi_util.c.

References g_CORE_GetAppName.

Referenced by ConnNetInfo_SetupStandardArgs(), and x_FixupUserHeader().

◆ CORE_GetLOCK()

Get the lock handle that is to be used by the core internals.

Returns
MT_LOCK handle of an active lock, or NULL if no lock is currently set
Warning
You may not delete the handle with MT_LOCK_Delete(); use CORE_SetLOCK(0) instead (or replace it with a different MT_LOCK).
Note
CONNECT may provide a default lock implementation on most platforms, so the returned lock may be non-NULL even without a prior call to CORE_SetLOCK().
See also
CORE_SetLOCK

Definition at line 115 of file ncbi_util.c.

References g_CORE_MT_Lock.

Referenced by x_InitLocking().

◆ CORE_GetLOG() ◆ CORE_GetNcbiRequestID()

Obtain current NCBI request ID (if known, per thread).

Returns
Return NULL when the ID cannot be determined or an error has occurred; otherwise, return a '\0'-terminated, non-empty string that is allocated on the heap, and must be free()'d when no longer needed.

Definition at line 743 of file ncbi_util.c.

References assert, CORE_LOCK_READ, CORE_UNLOCK, eNcbiRequestID_HitID, eNcbiRequestID_SID, eNcbiTraceParent, eNcbiTraceState, g_CORE_GetRequestID, out(), strdup, and x_getenv.

Referenced by x_SetRequestIDs().

◆ CORE_GetPlatform() const char* CORE_GetPlatform ( void  ) ◆ CORE_GetREG() ◆ CORE_GetUsername() const char* CORE_GetUsername ( char *  buf, size_t  bufsize  ) ◆ CORE_GetUsernameEx()

Obtain and store in the buffer provided, the best (as possible) user name that matches the requested username selector.

Both "buf" and "bufsize" must not be zeros.

Parameters
buf Pointer to buffer to store the user name at bufsize Size of buffer in bytes username Selects which username to get (most preferably)
Returns
Return NULL when the user name cannot be stored (e.g. buffer too small); otherwise, return "buf". Return "buf" as an empty string "" if the user name cannot be determined.
Note
For some OSes the username selector may not effect any differences, and for some OS releases, it may cause different results.
See also
CORE_GetUsername, ECORE_Username

Definition at line 807 of file ncbi_util.c.

References assert, buf, bufsize, CORE_LOCK_READ, CORE_LOCK_WRITE, CORE_UNLOCK, eCORE_UsernameCurrent, eCORE_UsernameLogin, eCORE_UsernameReal, login, ncbi::grid::netcache::search::fields::size, st(), STDIN_FILENO, UTIL_ReleaseBuffer, UTIL_TcharToUtf8, x_getenv, and x_SaveStr().

Referenced by CORE_GetUsername(), and s_MakeFrom().

◆ CORE_GetVMPageSize() size_t CORE_GetVMPageSize ( void  ) ◆ CORE_Msdelay() void CORE_Msdelay ( unsigned long  ms ) ◆ CORE_SetLOCK()

Set the MT critical section lock/unlock handler – to be used by the core internals for protection of internal static variables and other MT-sensitive code from being accessed/changed by several threads simultaneously.

It is also to fully protect the core log handler and core regirsty, including their setup, as well as callback and cleanup functions.

Warning
This function itself is NOT MT-safe!
If there is an active CORE MT-lock set already, which is different from the new one, then MT_LOCK_Delete() is called for the old lock (i.e. the one being replaced).
Note
The following are the minimal requirements for the lock that is to be used as a CORE MT_LOCK in the CONNECT library:
Parameters
lk MT-Lock as created by MT_LOCK_Create (NULL "lk" drops the internal MT-Lock)
See also
MT_LOCK_Create, MT_LOCK_Delete, CORE_SetLOG, CORE_SetREG

Definition at line 104 of file ncbi_util.c.

References CORE_TRACEF, eCORE_SetLOCK, g_CORE_MT_Lock, g_CORE_Set, and MT_LOCK_Delete().

Referenced by CMergeyApp::Run(), s_Fini(), and s_Init().

◆ CORE_SetLOG() void CORE_SetLOG ( LOG  lg )

Set the log handle (no logging if "lg" is passed zero) – to be used by the core internals (CORE LOG).

NCBI_CXX_TOOLKIT &&_DEBUG && !NDEBUG If there is an active log handler set already, and it is different from the new one, then LOG_Delete is called internally for the old logger (that is, the one being replaced).

Parameters
lg LOG handle as returned by LOG_Create, or NULL to stop logging
See also
LOG_Create, LOG_Delete, CORE_GetLOG, CORE_SetLOCK

Definition at line 127 of file ncbi_util.c.

References CORE_DEBUG_ARG, CORE_LOCK_WRITE, CORE_TRACEF, CORE_UNLOCK, eCORE_SetLOG, g_CORE_Log, g_CORE_Set, lg(), and LOG_Delete().

Referenced by CORE_SetLOGFILE_Ex(), s_Fini(), s_Init(), CBiosampleChkApp::Setup(), CTAbleValApp::Setup(), and CTLSApp::Setup().

◆ CORE_SetLOGFILE() void CORE_SetLOGFILE ( FILE *  fp, int  auto_close  ) ◆ CORE_SetLOGFILE_Ex() ◆ CORE_SetLOGFILE_NAME() int CORE_SetLOGFILE_NAME ( const char *  logfile ) ◆ CORE_SetLOGFILE_NAME_Ex()

Same as CORE_SetLOGFILE_Ex(fopen(logfile, "a"), cut_off, fatal_err, TRUE).

Parameters
logile Filename to write the log into cut_off Do not post messages with severity levels lower than specified fatal_err Severity greater than or equal to the specified level always posts to log, and then aborts the application
Returns
Return zero on error, non-zero on success
See also
CORE_SetLOGFILE_Ex, CORE_SetLOG

Definition at line 168 of file ncbi_util.c.

References CORE_LOGF_ERRNO_X, CORE_SetLOGFILE_Ex(), eLOG_Error, and fp.

Referenced by CORE_SetLOGFILE_NAME().

◆ CORE_SetLOGFormatFlags() ◆ CORE_SetREG() void CORE_SetREG ( REG  rg )

Set the registry (no registry if "rg" is passed zero) – to be used by the core internals.

If there is an active registry set already, and it is different from the new one, then REG_Delete() is called for the old(replaced) registry.

Parameters
See also
REG_Create, REG_Delete, CORE_GetREG, CORE_SetLOCK

Definition at line 692 of file ncbi_util.c.

References CORE_LOCK_WRITE, CORE_UNLOCK, eCORE_SetREG, g_CORE_Registry, g_CORE_Set, and REG_Delete().

Referenced by GetAsnDataViaHTTP(), s_Fini(), s_Init(), CBiosampleChkApp::Setup(), CTAbleValApp::Setup(), and CTLSApp::Setup().

◆ CRateMonitor() CRateMonitor::CRateMonitor ( double  minspan = 0.5, double  maxspan = 10.0, double  weight = 0.5, double  precision = 0.95  ) inline

Monitor position progressing in time, calculate speed and estimate time to complete the job (when the final size is known).

Parameters
minspan minimal time distance between marks (must be greater than 0) maxspan maximal time span covered by measurements (older marks popped out) weight for weighted rate calculations (current:remaining ratio), must be within the interval (0, 1) (excluding both ends); a value close to one (e.g. 0.9) makes recent marks more significant precision fraction of minspan to consider sufficient to add a next mark, must be within the interval (0, 1] (excluding 0 but including 1)

Definition at line 73 of file ncbi_misc.hpp.

◆ CSERV_Info() ◆ g_CTimeoutToSTimeout()

CTimeout/STimeout adapters.

Convert CTimeout to STimeout.

Parameters
cto Timeout value to convert. sto Variable to receive a numeric timeout value.
Returns
A special constant kDefaultTimeout or kInfiniteTimeout, if the incoming timeout is either a default or an infinite one, respectively. A pointer to the "sto" variable, if the incoming timeout contains some other (finite and numeric) value, and "sto" is used to receive the value.
See also
CTimeout, STimeout

Definition at line 203 of file ncbi_core_cxx.hpp.

References CTimeout::Get(), CTimeout::IsDefault(), CTimeout::IsInfinite(), kDefaultTimeout, kInfiniteTimeout, STimeoutTag::sec, and STimeoutTag::usec.

Referenced by CEUtils_Request::Connect(), SNetServerPoolImpl::Init(), CNetCacheWriter::TransmitImpl(), CEutilsClient::x_CountOnce(), CEutilsClient::x_FetchOnce(), CCDDClientPool::x_GetClient(), CEutilsClient::x_GetOnce(), CHttpRequest::x_InitConnection(), CEutilsClient::x_LinkOnce(), CEutilsClient::x_LinkOnceT(), CEutilsClient::x_LinkOutOnce(), CEutilsClient::x_SearchOnce(), and CEutilsClient::x_SummaryOnce().

◆ g_STimeoutToCTimeout() ◆ GetETA() double CRateMonitor::GetETA ( void  ) const ◆ GetHost() string CSERV_Info::GetHost ( void  ) const inline ◆ GetPace() double CRateMonitor::GetPace ( void  ) const inline ◆ GetPort() unsigned short CSERV_Info::GetPort ( void  ) const inline ◆ GetPos() Uint8 CRateMonitor::GetPos ( void  ) const inline ◆ GetRate() [1/2] double CRateMonitor::GetRate ( void  ) const

How fast the recent rate has been, in positions per time unit, using the weighted formula.

Returns
zero if cannot estimate

Definition at line 108 of file ncbi_misc.cpp.

References _ASSERT, _DEBUG_ARG, CRateMonitor::GetPace(), CRateMonitor::kSpan, CRateMonitor::kWeight, CRateMonitor::m_Data, CRateMonitor::m_Rate, n, next(), prev(), and weight.

Referenced by CRateMonitor::GetETA().

◆ GetRate() [2/2] double CSERV_Info::GetRate ( void  ) const inline ◆ GetSize() Uint8 CRateMonitor::GetSize ( void  ) const inline ◆ GetTime() double CRateMonitor::GetTime ( void  ) const inline ◆ GetTimeRemaining() double CRateMonitor::GetTimeRemaining ( void  ) const ◆ GetType() ◆ IO_StatusStr()

Get the text form of an enum status value.

Parameters
status An enum value to get the text form for
Returns
Verbal description of the I/O status
Warning
Returns NULL on out-of-bound values
Note
Reserved status code(s) returned as an empty string ("")
See also
EIO_Status

Definition at line 56 of file ncbi_core.c.

References assert, EIO_N_STATUS, eIO_Success, and int.

Referenced by SNetServerImpl::ConnectImpl(), CORE_SendMailEx(), CPipe::CPipe(), CPipe::ExecWait(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), IServer_MessageHandler::OnRead(), CServer_ConnectionPool::PingControlConnection(), CConnTest::PostCheck(), s_ApproveCallback(), s_Connect_(), s_ConnectAndSend(), s_FTPCommandEx(), s_FTPReply(), s_Init(), s_InitAPI_(), s_Open(), s_Read(), s_ReadFullResponse(), s_ReadHeader(), s_ReadSocket(), s_Resolve(), s_Shutdown(), s_ThrowIoStatus(), s_VT_Open(), s_WritePending(), s_WriteToSocket(), SNetScheduleNotificationReceiver::SNetScheduleNotificationReceiver(), CNetCacheReader::SocketRead(), URL_ConnectEx(), SNetServerConnectionImpl::WriteLine(), CWindowMaskerJob::x_CreateProjectItems(), CServer::x_DoRun(), x_ErrorToStatus(), x_FTPCloseData(), x_FTPPassive(), x_FTPPollCntl(), x_FTPXfer(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CConn_Streambuf::x_Message(), CNetStorageHandler::x_OnSocketWriteError(), x_ReadChunkHead(), and x_StatusToError().

◆ LOG_AddRef() ◆ LOG_ComposeMessage()

Compose a message using the "call_data" info.

Full log record format: mm/dd/yy HH:MM:SS "<file>", line <line>: [<module>::<function>] <level>: <message>
#################### [BEGIN] Raw Data (<raw_size> byte[s]):
<raw_data>
#################### [_END_] Raw Data

Note
The returned string must be deallocated using "free()".
Parameters
mess Broken down message flags Which fields of "mess" to use
See also
CORE_SetLOG, CORE_SetLOGFormatFlags

Definition at line 430 of file ncbi_util.c.

References assert, CORE_LOCK_WRITE, CORE_UNLOCK, eLOG_Note, eLOG_Trace, SLOG_Message::file, flags, fLOG_DateTime, fLOG_Default, fLOG_FileLine, fLOG_Full, fLOG_FullOctal, fLOG_Function, fLOG_Level, fLOG_Module, fLOG_None, fLOG_OmitNoteLevel, fLOG_Short, SLOG_Message::func, fUTIL_PrintableFullOctal, isspace(), kOutOfMemory, SLOG_Message::level, SLOG_Message::line, LOG_LevelStr(), malloc(), SLOG_Message::message, message_len(), SLOG_Message::module, SLOG_Message::raw_data, SLOG_Message::raw_size, str(), util::strncmp(), UTIL_PRINTABLE_WIDTH, UTIL_PrintableStringEx(), and UTIL_PrintableStringSize().

Referenced by s_LOG_FileHandler().

◆ LOG_Create()

Create a new LOG (with an internal reference count set to 1).

Warning
If non-NULL "lock" is specified then MT_LOCK_AddRef() is called on it here, and MT_LOCK_Delete() will be called on it when this LOG gets deleted.
Parameters
data Unspecified data to call "handler" and "cleanup" with handler Log post callback cleanup Cleanup callback lock Protective MT lock (may be NULL)
See also
MT_LOCK, MT_LOCK_AddRef, FLOG_Handler, FLOG_Cleanup, LOG_Reset, LOG_Delete

Definition at line 312 of file ncbi_core.c.

References cleanup(), data, kLOG_magic, lg(), LOG_tag::lock, malloc(), and MT_LOCK_AddRef().

Referenced by CORE_SetLOGFILE_Ex(), and LOG_cxx2c().

◆ LOG_cxx2c() ◆ LOG_Delete()

Decrement internal reference count by 1, and if it reaches 0, then call "lg->cleanup(lg->data)", destroy the handle, and return NULL; otherwise (if reference count is still > 0), return "lg".

Parameters
lg A log handle previously obtained from LOG_Create
See also
LOG_Create

Definition at line 365 of file ncbi_core.c.

References free(), lg(), LOG_LOCK_WRITE, LOG_Reset(), LOG_UNLOCK, LOG_VALID, and MT_LOCK_Delete().

Referenced by CORE_SetLOG().

◆ LOG_LevelStr() ◆ LOG_Reset() ◆ LOG_ToFILE() void LOG_ToFILE ( LOG  lg, FILE *  fp, int  auto_close  ) ◆ LOG_ToFILE_Ex()

LOG_Reset specialized to log to a "FILE*" stream using LOG_ComposeMessage.

Parameters
lg Created by LOG_Create fp The file stream to log to cut_off Do not post messages with severity levels lower than specified fatal_err Severity greater or equal to "fatal_err" always logs and aborts the program auto_close Whether to call "fclose(fp)" when the LOG is reset/destroyed
See also
LOG_Create, LOG_Reset, LOG_ComposeMessage, LOG_ToFILE

Definition at line 649 of file ncbi_util.c.

References SFILELogData::auto_close, SFILELogData::cut_off, eLOG_Fatal, SFILELogData::fatal_err, SFILELogData::fp, fp, lg(), LOG_Reset(), malloc(), s_LOG_FileCleanup(), and s_LOG_FileHandler().

Referenced by CORE_SetLOGFILE_Ex(), and LOG_ToFILE().

◆ LOG_Write() void LOG_Write ( LOG  lg, int  code, int  subcode, ELOG_Level  level, const char *  module, const char *  func, const char *  file, int  line, const char *  message, const void *  raw_data, size_t  raw_size  )

Upon having filled SLOG_Message data from parameters, write a message (perhaps with raw data attached) to the log by calling LOG_WriteInternal().

Note
Do not call this function directly, if possible. Instead, use the LOG_WRITE() and LOG_DATA() macros from <connect/ncbi_util.h>!
Parameters
code Error code of the message subcode Error subcode of the message level The message severity module Module name (can be NULL) func Function name (can be NULL) file Source file name (can be NULL) line Source line within the file (can be 0 to omit the line number) message Message content raw_data Raw data to log (can be NULL) raw_size Size of the raw data (can be zero)
See also
LOG_Create, ELOG_Level, LOG_WriteInternal, LOG_WRITE, LOG_DATA

Definition at line 423 of file ncbi_core.c.

References SLOG_Message::dynamic, SLOG_Message::err_code, SLOG_Message::err_subcode, SLOG_Message::file, file, SLOG_Message::func, SLOG_Message::level, lg(), SLOG_Message::line, LOG_WriteInternal(), SLOG_Message::message, SLOG_Message::module, SLOG_Message::raw_data, and SLOG_Message::raw_size.

Referenced by ConnNetInfo_Log().

◆ LOG_WriteInternal()

Write message (perhaps with raw data attached) to the log by calling "lg->handler(lg->data, mess)".

Note
Do not call this function directly, if possible. Instead, use the LOG_WRITE() and LOG_DATA() macros from <ncbi_util.h>!
Warning
This call free()s "mess->message" when "mess->dynamic" is set non-zero!
Parameters
lg A log handle previously obtained from LOG_Create
Note
In case of a fatal error (eLOG_Fatal found in mess->code), it calls abort() (in Debug builds) or _exit(-1) (in Release builds). Note that no exit handlers are run or any other normal process run-down procedure performed.
See also
LOG_Create, ELOG_Level, FLOG_Handler, LOG_Write

Definition at line 391 of file ncbi_core.c.

References abort(), assert, SLOG_Message::dynamic, eLOG_Fatal, free(), SLOG_Message::level, lg(), LOG_LOCK_READ, LOG_UNLOCK, LOG_VALID, SLOG_Message::message, SLOG_Message::raw_data, and SLOG_Message::raw_size.

Referenced by LOG_Write().

◆ Mark() void CRateMonitor::Mark ( Uint8  pos, double  time  ) ◆ MIME_ComposeContentTypeEx()

Definition at line 3315 of file ncbi_connutil.c.

References assert, buf, bufsize, CONN_CONTENT_TYPE_LEN, eENCOD_Unknown, eMIME_T_Undefined, eMIME_T_Unknown, eMIME_Undefined, eMIME_Unknown, kContentType, kMIME_Encoding, kMIME_SubType, kMIME_Type, len, strncpy0(), and type.

Referenced by CSoapHttpClient::Invoke(), s_AdjustNetParams(), s_IsContentTypeDefined(), and SERV_WriteInfo().

◆ MIME_ParseContentTypeEx()

Definition at line 3367 of file ncbi_connutil.c.

References eENCOD_None, eENCOD_Unknown, eMIME_T_Undefined, eMIME_T_Unknown, eMIME_Undefined, eMIME_Unknown, free(), i, int, kMIME_Encoding, kMIME_SubType, kMIME_Type, len, malloc(), str(), util::strcmp(), strlwr, and x_size().

Referenced by s_IsContentTypeDefined(), and SERV_ReadInfoEx().

◆ MT_LOCK_AddRef() ◆ MT_LOCK_Create()

Create a new MT lock (with an internal reference count set to 1).

Parameters
data Unspecified data to call "handler" and "cleanup" with handler Locking callback cleanup Cleanup callback
See also
FMT_LOCK_Handler, FMT_LOCK_Cleanup, MT_LOCK_Delete

Definition at line 198 of file ncbi_core.c.

References MT_LOCK_tag::cleanup, cleanup(), MT_LOCK_tag::count, MT_LOCK_tag::data, data, MT_LOCK_tag::handler, kMT_LOCK_magic, MT_LOCK_tag::magic, and malloc().

Referenced by Blast_CMT_LOCKInit(), and MT_LOCK_cxx2c().

◆ MT_LOCK_cxx2c() ◆ MT_LOCK_Delete()

Decrement internal reference count by 1, and if it reaches 0, then destroy the handle, call "lk->cleanup(lk->data)", and return NULL; otherwise (if the reference count is still > 0), return "lk".

Parameters
lk A handle previously obtained from MT_LOCK_Create
See also
MT_LOCK_Create, FMT_LOCK_Cleanup

Definition at line 234 of file ncbi_core.c.

References MT_LOCK_tag::cleanup, MT_LOCK_tag::count, count, MT_LOCK_tag::data, eMT_Lock, eMT_Unlock, free(), g_CORE_MT_Lock_default, MT_LOCK_tag::handler, MT_LOCK_tag::magic, MT_LOCK_VALID, and verify.

Referenced by Blast_DiagnosticsFree(), BlastHSPStreamClose(), BlastHSPStreamFree(), BlastHSPStreamMappingClose(), BlastHSPStreamRegisterMTLock(), BlastHSPStreamSimpleClose(), CORE_SetLOCK(), LOG_Delete(), and REG_Delete().

◆ MT_LOCK_DoInternal() ◆ NcbiBlowfishDecrypt() ◆ NcbiBlowfishEncrypt() ◆ NcbiBlowfishFini() ◆ NcbiBlowfishInit()

Init the cipher context with a key of the specified length.

Note that Blowfish limits the key to be 448 bits (56 bytes) long, so the remainder of a longer key (if so provided) is ignored. A shorter key gets cyclically repeated as necessary to fill up the 56 bytes. To specify a shorter key explicitly pad with zero bits up to 448. Return 0 on memory allocation error.

Definition at line 302 of file ncbi_blowfish.c.

References assert, data, i, kBFInit, ncbi::grid::netcache::search::fields::key, malloc(), MAXKEYLEN, n, NcbiBlowfishEncrypt(), SNcbiBlowfish::P, SNcbiBlowfish::S, and SizeOf.

◆ NcbiMessagePlusError()

Add current "error" (and maybe its description) to the message: <message>[ {error=[[<error>][,]][<descr>]}].

Parameters
dynamic [inout] non-zero pointed value means message was allocated from heap message [in] message text (can be NULL) error [in] error code (if it is zero, then use "descr" only if non-NULL/empty) descr [in] error description (if NULL, then use "strerror(error)" if error!=0)
Returns
Always non-NULL message (perhaps, "") and re-set "*dynamic" as appropriate.
Warning
This routine may call "free(message)" if it had to reallocate the original message that had been allocated dynamically before the call (and "*dynamic" thus had been passed non-zero).
See also
LOG_ComposeMessage

Definition at line 338 of file ncbi_util.c.

References buf, free(), isspace(), kOutOfMemory, malloc(), NCBI_OS_MSWIN, s_WinStrerror(), strerror(), strncasecmp, UTIL_ReleaseBuffer, UTIL_ReleaseBufferOnHeap(), and UTIL_TcharToUtf8.

Referenced by s_HttpConnectorBuilder(), s_ServiceConnectorBuilder(), and x_FormatError().

◆ NcbiMsToTimeout() ◆ NcbiTimeoutToMs()

Definition at line 40 of file ncbi_types.c.

References STimeoutTag::sec, and STimeoutTag::usec.

Referenced by CPipe::ExecWait(), CNamedPipeHandle::Listen(), CNamedPipeHandle::Open(), CPipeHandle::Read(), SNetServerConnectionImpl::ReadCmdOutputLine(), s_Close(), CNamedPipeHandle::Write(), CPipeHandle::Write(), CPipeHandle::x_Poll(), and CNamedPipeHandle::x_WaitForRead().

◆ REG_AddRef() ◆ REG_Create()

Create a new registry (with an internal reference count set to 1).

Warning
if non-NULL "lock" is specified then MT_LOCK_AddRef() is called on it here, and MT_LOCK_Delete() will be called on it when this REG gets destroyed. Passing NULL callbacks below causes limiting the functionality only to those operations that have the callbacks set for.
Parameters
data Unspecified data to call "set", "get" and "cleanup" with get Getter callback set Setter callback cleanup Cleanup callback lock Protective MT lock (may be NULL)
See also
MT_LOCK, MT_LOCK_AddRef, REG_Get, REG_Set, REG_Reset, REG_Delete

Definition at line 483 of file ncbi_core.c.

References REG_tag::cleanup, cleanup(), REG_tag::count, REG_tag::data, data, REG_tag::get, kREG_magic, REG_tag::lock, REG_tag::magic, malloc(), MT_LOCK_AddRef(), and REG_tag::set.

Referenced by REG_cxx2c().

◆ REG_cxx2c() [1/2]

Convert a C++ Toolkit read-only registry object to a REG registry.

Note
The returned registry won't have a set method available, and any attempt to set a parameter will fail.
The C++ registries are CObjects, so any we "own" will be deleted if and only if nothing else is still holding a reference to them.
Parameters
reg A C++ toolkit registry, on top of which new REG registry is to be created pass_ownership True if the ownership of "reg" gets passed to new REG
Returns
New REG registry (or NULL on error)
See also
REG_Create, CONNECT_Init

Definition at line 217 of file ncbi_core_cxx.cpp.

References _TRACE, CObject::AddReference(), NStr::PtrToString(), REG_Create(), s_REG_Cleanup(), s_REG_Get(), and s_TraceReg.

◆ REG_cxx2c() [2/2]

Convert a C++ Toolkit registry object to a REG registry.

Note
The C++ registries are CObjects, so any we "own" will be deleted if and only if nothing else is still holding a reference to them.
Parameters
reg A C++ toolkit registry, on top of which new REG registry is to be created pass_ownership True if the ownership of "reg" gets passed to new REG
Returns
New REG registry (or NULL on error)
See also
REG_Create, CONNECT_Init

Definition at line 203 of file ncbi_core_cxx.cpp.

References _TRACE, CObject::AddReference(), NStr::PtrToString(), REG_Create(), s_REG_Cleanup(), s_REG_Get(), s_REG_Set(), and s_TraceReg.

Referenced by GetAsnDataViaHTTP(), s_Init(), CBiosampleChkApp::Setup(), CTAbleValApp::Setup(), and CTLSApp::Setup().

◆ REG_Delete()

Decrement internal reference count by 1, and if it reaches 0, then call "rg->cleanup(rg->data)", destroy the handle, and return NULL; otherwise (if the reference count is still > 0), return "rg".

Parameters
rg Registry handle as previously obtained from REG_Create
See also
REG_Create

Definition at line 540 of file ncbi_core.c.

References REG_tag::count, free(), REG_tag::lock, REG_tag::magic, MT_LOCK_Delete(), REG_LOCK_WRITE, REG_Reset(), REG_UNLOCK, and REG_VALID.

Referenced by CORE_SetREG().

◆ REG_Get() const char* REG_Get ( REG  rg, const char *  section, const char *  name, char *  value, size_t  value_size, const char *  def_value  )

Copy the registry value stored in "section" under name "name" to buffer "value"; if the entry is found in both transient and persistent storages, then copy the one from the transient storage.

If the specified entry is not found in the registry (or if there is no registry defined), and "def_value" is not NULL, then copy "def_value" to "value" (although, only up to "value_size" characters).

Parameters
rg Registry handle as previously obtained from REG_Create section Registry section name name Registry entry name value Buffer to receive the value of the requested entry, must be non-NULL value_size Maximal size of buffer "value", must be greater than 0 def_value Default value (none if passed NULL or "")
Returns
Return "value" if the found value, including the default, and with its '\0' terminator, fits entirely within "value_size"; return NULL if there was an error retrieving the value, or if it had to be truncated (but regardless, "value" must always be kept '\0'-terminated unless "value_size" was zero).
See also
REG_Create, REG_Set

Definition at line 566 of file ncbi_core.c.

References REG_tag::data, REG_tag::get, len, REG_LOCK_READ, REG_UNLOCK, REG_VALID, strncpy0(), and rapidjson::value.

Referenced by g_CORE_RegistryGET().

◆ REG_Reset()

Reset the registry handle to use the new "data", "set", "get", and "cleanup".

Note
No change to the internal reference count.
Parameters
rg Registry handle as previously obtained from REG_Create data New user data get New getter callback set New setter callback cleanup New cleanup callback do_cleanup Whether to call old cleanup (if any specified) for old data
See also
REG_Create, REG_Delete

Definition at line 505 of file ncbi_core.c.

References REG_tag::cleanup, cleanup(), REG_tag::data, data, REG_tag::get, REG_LOCK_WRITE, REG_UNLOCK, REG_VALID, and REG_tag::set.

Referenced by REG_Delete().

◆ REG_Set() ◆ SERV_GetServers()

Get the servers for a given service.

Parameters
[in] service Service name [in] types Which service types to obtain
Returns
List of servers (ordered according to their rates)

Definition at line 76 of file ncbi_service_cxx.cpp.

References _TRACE, ConnNetInfo_Create(), eUnknown, fSERV_All, fSERV_Any, fSERV_Firewall, AutoPtr< X, Del >::get(), hex(), info, kEmptyStr, msg(), NCBI_THROW, NcbiIsEmptyIPv6(), NcbiIsIPv4(), NStr::NumericToString(), SERV_AddrOfInfo(), SERV_ANYHOST, SERV_Close(), SERV_GetNextInfo(), SERV_Open(), SERV_TypeStr(), types, and x_HostOfInfo().

◆ SetSize() void CRateMonitor::SetSize ( Uint8  size ) inline ◆ SOCK_StripToPattern() EIO_Status SOCK_StripToPattern ( SOCK  sock, const void *  pattern, size_t  pattern_size, BUFdiscard, size_t *  n_discarded  ) ◆ URL_Connect() SOCK URL_Connect ( const char *  host, unsigned short  port, const char *  path, const char *  args, EReqMethod  req_method, size_t  content_length, const STimeouto_timeout, const STimeoutrw_timeout, const char *  user_header, int  encode_args, TSOCK_Flags  flags  )

Definition at line 2736 of file ncbi_connutil.c.

References assert, CORE_LOG, CORE_LOG_X, CORE_LOGF_ERRNO_X, CORE_Once, eIO_Success, eLOG_Error, eLOG_Warning, eReqMethod_Connect, eReqMethod_v1, flags, free(), kHost, malloc(), ncbi::grid::netcache::search::fields::size, strncasecmp, URL_ConnectEx(), URL_Encode(), verify, and x_StrcatCRLF().

◆ URL_ConnectEx() EIO_Status URL_ConnectEx ( const char *  host, unsigned short  port, const char *  path, const char *  args, TReqMethod  req_method, size_t  content_length, const STimeouto_timeout, const STimeoutrw_timeout, const char *  user_header, SURLExtraextra, TSOCK_Flags  flags, SOCKsock  )

Definition at line 2501 of file ncbi_connutil.c.

References assert, buf, BUF_Destroy(), BUF_Read(), BUF_Size(), BUF_Write(), CONN_PORT_HTTP, CONN_PORT_HTTPS, CORE_LOG_X, CORE_LOGF_ERRNO_X, CORE_LOGF_X, SURLExtra::cred, eIO_InvalidArg, eIO_NotSupported, eIO_ReadWrite, eIO_Success, eIO_Timeout, eIO_Unknown, eLOG_Critical, eLOG_Error, eLOG_Warning, eReqMethod_Any, eReqMethod_Connect, eReqMethod_Get, eReqMethod_Head, eReqMethod_Post, eReqMethod_Put, eReqMethod_v1, flags, free(), fSOCK_Secure, SURLExtra::host, init(), IO_StatusStr(), isspace(), malloc(), STimeoutTag::sec, SOCK_CreateInternal(), SOCK_CreateOnTopInternal(), SOCK_Destroy, SOCK_DisableOSSendDelay(), SOCK_SetTimeout(), str(), tmp, STimeoutTag::usec, verify, x_ReqMethod(), and x_URLConnectErrorReturn().

Referenced by s_Connect(), and URL_Connect().

◆ URL_Decode() int URL_Decode ( const void *  src_buf, size_t  src_size, size_t *  src_read, void *  dst_buf, size_t  dst_size, size_t *  dst_written  ) ◆ URL_DecodeEx() int URL_DecodeEx ( const void *  src_buf, size_t  src_size, size_t *  src_read, void *  dst_buf, size_t  dst_size, size_t *  dst_written, const char *  allow_symbols  ) ◆ URL_Encode() void URL_Encode ( const void *  src_buf, size_t  src_size, size_t *  src_read, void *  dst_buf, size_t  dst_size, size_t *  dst_written  ) ◆ URL_EncodeEx() void URL_EncodeEx ( const void *  src_buf, size_t  src_size, size_t *  src_read, void *  dst_buf, size_t  dst_size, size_t *  dst_written, const char *  allow_symbols  ) ◆ UTIL_Adler32_Update() unsigned int UTIL_Adler32_Update ( unsigned int  checksum, const void *  ptr, size_t  len  )

Calculate/Update Adler-32 checksum NB: Initial checksum is "1".

Parameters
checksum Checksum to update (start with 1) ptr Block of data len Size of block of data
Returns
Return the checksum updated according to the contents of the block pointed to by "ptr" and having "len" bytes in it.

Definition at line 1180 of file ncbi_util.c.

References a, ADJUST_ADLER, b, data, FINALIZE_ADLER, i, len, and MAXLEN_ADLER.

Referenced by s_VerifyChecksum().

◆ UTIL_CRC32_Update() unsigned int UTIL_CRC32_Update ( unsigned int  checksum, const void *  ptr, size_t  len  )

Calculate/Update CRC-32 checksum NB: Initial checksum is "0".

Parameters
checksum Checksum to update (start with 0) ptr Block of data len Size of block of data
Returns
Return the checksum updated according to the contents of the block pointed to by "ptr" and having "len" bytes in it.

Definition at line 1155 of file ncbi_util.c.

References data, i, len, and s_CRC32Table.

Referenced by s_VerifyChecksum().

◆ UTIL_GenerateHMAC()

Generate an RFC2401 digest (HMAC).

Parameters
hash Hash function descriptor text Text to get a digest for text_key Byte length of the text key Key to hash the text with key_len Byte length of the key (recommended to be no less than "hash::digest_len") digest The resultant HMAC storage (must be of an adequate size)
Returns
NULL on errors ("digest" will not be valid), or "digest" on success.
See also
SHASH_Descriptor

Definition at line 1226 of file ncbi_util.c.

References ctx, free(), i, ncbi::grid::netcache::search::fields::key, malloc(), pad(), text(), and tmp.

◆ UTIL_HelpRequested() int UTIL_HelpRequested ( int  argc, char **  argv  )

Given the main()'s argc and argv return non-zero (true) if the arguments specify that only a help option was requested.

Return 0 (false), otherwise.

Definition at line 1422 of file ncbi_util.c.

References strcasecmp, and util::strcmp().

◆ UTIL_MatchesMask() ◆ UTIL_MatchesMaskEx() int UTIL_MatchesMaskEx ( const char *  text, const char *  mask, int  ignore_case  )

Match a given text with a given pattern mask.

Very similar to fnmatch(3), but there are differences (see also glob(7)). There's no special treatment for a slash character '/' in this call.

Parameters
text A text to match mask A text pattern, which, along with ordinary characters that must match literally in the given "text", can contain: '*' to denote any sequence of characters (including none), '?' to denote any single character, and character classes in the forms of "[...]" or "[!...]" that must MATCH or NOT MATCH, respectively, a single character in "text". To cancel the special meaning of '*', '?' or '[', they can be prepended with a backslash '\' (the backslash in front of other characters does not change their meaning, so "\\\\" matches one graphical backslash in the "text"). Within a character class, to have its literal meaning a closing square bracket ']' must be used at the first position, whereas '?', '*', '[, and '\' stand just for themselves. Two characters separated by the minus sign '-' denote a range that can be used for contraction to include all characters in between: "[A-F]" is equivalent to "[ABCDEF]". For its literal meaning, the minus sign '-' can be used either at the very first position, or the last position before the closing bracket ']'. To have a range that begins with an exclamation point, one has to use a dummy empty range followed by that range with '!'. Examples: "!" matches a single '!' (note that just "[!]" is invalid); "[!!]" matches any character, which is not an exclamation point '!'; "[][!]" matches ']', '[', and '!'; "[!][-]" matches any character except for ']', '[', and '-'; "[-]" matches a minus sign '-' (same as '-' just by itself); "[?*\\]" matches either '?', or '*', or a backslash '\'; "[]-\\]" matches nothing as it defines an empty range (from ']' to '\'); "\\[a]\\*" matches a literal substring "[a]*"; "[![a-]" matches any char but '[', 'a' or '-' (same as "[!-[a]"; but NOT "[![-a]", which defines an empty range, thus matches any char!); "[]A]" matches either ']' or 'A' (NB: "[A]]" matches a substring "A]"); "[0-9-]" matches any decimal digit or a minus sign '-' (same: "[-0-9]"); "[9-0!-$]" matches '!', '"', '#', and '$' (as first range matches nothing).
Note
In the above, each double backslash denotes a single graphical backslash character (C string notation is used).
Unlike shell globbing, "[--0]" *does* match the slash character '/' (along with '-', '.', and '0' that all fall within the range).
Parameters
ignore_case Whether to ignore the case of the letters (a-z) in comparisons
Returns
Non-zero if "text" matches "mask"; otherwise (including pattern errors), return zero
See also
UTIL_MatchesMask

Definition at line 1377 of file ncbi_util.c.

References mask, text(), and x_MatchesMask().

Referenced by UTIL_MatchesMask().

◆ UTIL_NcbiLocalHostName() char* UTIL_NcbiLocalHostName ( char *  hostname )

Cut off well-known NCBI domain suffix out of the passed "hostname".

Parameters
hostname Hostname to shorten (if possible)
Returns
NULL if the hostname wasn't modified; otherwise, return "hostname" (shortened in place)

Definition at line 1390 of file ncbi_util.c.

References assert, i, len, and strncasecmp.

Referenced by x_ClientAddress().

◆ UTIL_PrintableStringEx()

Create a printable representation of a block of data of the specified size (or, if size is 0, strlen(data)), and return the buffer pointer past the last stored character (non '\0'-terminated).

Non-printable characters can be represented in a reduced octal form as long as the result is unambiguous (unless "full" passed true (non-zero), in which case all non-printable characters get represented by full octal tetrads).

Note
Hexadecimal output is not used because it is ambiguous by the standard (can contain arbitrary number of hex digits, which may be indistiguishable from the following text[a-z][A-Z] or numerals[0-9]).
The input buffer "buf" where to store the printable representation is assumed to be of adequate size to hold the resultant string (use UTIL_PrintableStringSize() to obtain the size prior to this call).
Parameters
data Block of data (NULL causes NULL to return regardless of "size" or "buf") size Size of block (0 causes strlen(data) to be used) buf Buffer to store the result (NULL always causes NULL to return) flags How to print representations of certain non-printable characters width Insert escaped line breaks when output line exceeds "width"; no-op if 0
Returns
Next position in the buffer past the last stored character
Warning
The call *does not* '\0'-terminate its output!
Successive calls of UTIL_PrintableString() that append to the same buffer one after another may not produce a well-formed C string literal, in all.
See also
UTIL_PrintableStringSize, EUTIL_PrintableFlags

Definition at line 223 of file ncbi_util.c.

References flags, fUTIL_PrintableFullOctal, fUTIL_PrintableNoNewLine, isprint(), ncbi::grid::netcache::search::fields::size, and UTIL_PRINTABLE_WIDTH_MIN.

Referenced by LOG_ComposeMessage(), and s_LOG_Handler().

◆ UTIL_PrintableStringSize() size_t UTIL_PrintableStringSize ( const char *  data, size_t  size  ) ◆ UTIL_ReleaseBufferOnHeap() ◆ UTIL_Timezone() time_t UTIL_Timezone ( void  )

Return timezone offset (in seconds West of UTC) for the current time zone.

Must be called after either mktime() or localtime() or tzset() to return a valid result. On platforms that do not provide TZ information, the result is cached internally for the life of the application.

Definition at line 1437 of file ncbi_util.c.

References assert, CORE_LOCK_WRITE, CORE_UNLOCK, and timezone.

Referenced by x_FTPParseMdtm(), and x_ParseExpires().

◆ block_len size_t SHASH_Descriptor::block_len

Definition at line 580 of file ncbi_util.h.

◆ client_host char SConnNetInfo::client_host[255+1] ◆ cred ◆ credentials ◆ debug_printout ◆ digest_len size_t SHASH_Descriptor::digest_len

Definition at line 581 of file ncbi_util.h.

◆ dynamic int SLOG_Message::dynamic ◆ err_code int SLOG_Message::err_code ◆ err_subcode int SLOG_Message::err_subcode ◆ external unsigned SConnNetInfo::external ◆ file const char* SLOG_Message::file ◆ fini void(* SHASH_Descriptor::fini) (void *ctx, void *digest)

Definition at line 585 of file ncbi_util.h.

◆ firewall

Definition at line 200 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), s_Adjust(), s_Connect(), s_Open(), s_Resolve(), s_SocketConnectorBuilder(), s_VT_Open(), SERV_Print(), SERVICE_CreateConnectorEx(), CConnTest::x_GetFirewallConfiguration(), and x_Open().

◆ func const char* SLOG_Message::func ◆ host [1/2] char SConnNetInfo::host[255+1]

Definition at line 212 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), CFtpUtils::GetDirContent(), s_Adjust(), s_CallAdjust(), s_Connect(), s_CreateConnector(), s_Open(), s_Resolve(), s_SocketConnectorBuilder(), s_VT_Open(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), x_FTPCloseCntl(), x_FTPLogin(), x_Redirect(), x_SetHostPort(), x_SetHttpHostTag(), x_SetupConnectionParams(), and x_SetupHttpProxy().

◆ host [2/2] const char* SURLExtra::host ◆ http_proxy_host char SConnNetInfo::http_proxy_host[255+1]

Definition at line 215 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), s_CallAdjust(), s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_SocketConnectorBuilder(), s_VT_Open(), x_Authenticate(), x_SetHostPort(), CHttpRequest::x_SetProxy(), and x_SetupConnectionParams().

◆ http_proxy_leak unsigned SConnNetInfo::http_proxy_leak ◆ http_proxy_mask ◆ http_proxy_pass char SConnNetInfo::http_proxy_pass[63+1] ◆ http_proxy_port unsigned short SConnNetInfo::http_proxy_port

Definition at line 216 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), s_CallAdjust(), s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_SocketConnectorBuilder(), s_VT_Open(), x_Authenticate(), x_SetHostPort(), CHttpRequest::x_SetProxy(), and x_SetupConnectionParams().

◆ http_proxy_skip unsigned SConnNetInfo::http_proxy_skip ◆ http_proxy_user char SConnNetInfo::http_proxy_user[63+1] ◆ http_push_auth unsigned SConnNetInfo::http_push_auth ◆ http_referer const char* SConnNetInfo::http_referer ◆ http_user_header const char* SConnNetInfo::http_user_header ◆ http_version unsigned SConnNetInfo::http_version ◆ init ◆ kMaxSpan const double CRateMonitor::kMaxSpan protected ◆ kMinSpan const double CRateMonitor::kMinSpan protected ◆ kSpan const double CRateMonitor::kSpan protected ◆ kWeight const double CRateMonitor::kWeight protected ◆ lb_disable unsigned SConnNetInfo::lb_disable ◆ level ◆ line ◆ m_Data list<TMark> CRateMonitor::m_Data protected ◆ m_Host ◆ m_Port unsigned short CSERV_Info::m_Port private ◆ m_Rate [1/2] double CRateMonitor::m_Rate mutableprotected ◆ m_Rate [2/2] double CSERV_Info::m_Rate private ◆ m_Size Uint8 CRateMonitor::m_Size protected ◆ m_Type ◆ magic unsigned int SConnNetInfo::magic ◆ max_try unsigned short SConnNetInfo::max_try ◆ message const char* SLOG_Message::message ◆ module const char* SLOG_Message::module ◆ pass char SConnNetInfo::pass[63+1] ◆ path char SConnNetInfo::path[4095+1]

Definition at line 214 of file ncbi_connutil.h.

Referenced by CConn_FTPDownloadStream::CConn_FTPDownloadStream(), CConn_FTPUploadStream::CConn_FTPUploadStream(), ConnNetInfo_CloneInternal(), CFtpUtils::GetDirContent(), s_Adjust(), s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_FTPDir(), s_Resolve(), s_SocketConnectorBuilder(), s_VT_Open(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), x_FTPDir(), x_SetDefaultReferer(), and x_SetupHttpProxy().

◆ port unsigned short SConnNetInfo::port

Definition at line 213 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), s_Adjust(), s_CallAdjust(), s_Connect(), s_CreateConnector(), s_Open(), s_Resolve(), s_SocketConnectorBuilder(), s_VT_Open(), x_FTPCloseCntl(), x_FTPLogin(), x_Redirect(), x_SetHostPort(), x_SetHttpHostTag(), x_SetupConnectionParams(), and x_SetupHttpProxy().

◆ raw_data const void* SLOG_Message::raw_data ◆ raw_size size_t SLOG_Message::raw_size ◆ req_method

Definition at line 197 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), s_Adjust(), s_AdjustNetParams(), s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_Open(), s_Read(), s_ReadHeader(), s_Resolve(), s_SocketConnectorBuilder(), s_VT_Write(), x_Redirect(), x_SetDefaultReferer(), x_SetupConnectionParams(), x_SetupFromNamerd(), and x_SetupHttpProxy().

◆ reserved unsigned SConnNetInfo::reserved ◆ scheme

Definition at line 198 of file ncbi_connutil.h.

Referenced by ConnNetInfo_CloneInternal(), CFtpUtils::GetDirContent(), s_Adjust(), s_CallAdjust(), s_Connect(), s_CreateConnector(), s_CreateHttpConnector(), s_Open(), s_Resolve(), s_SocketConnectorBuilder(), SERV_LINKERD_Open(), x_Authenticate(), CDownloadJob::x_Download(), CDownloadJob::x_DownloadAndExtract(), x_Redirect(), x_SetDefaultReferer(), x_SetHttpHostTag(), x_SetupConnectionParams(), x_SetupFromNamerd(), and x_SetupHttpProxy().

◆ sec unsigned int STimeoutTag::sec

seconds

Definition at line 76 of file ncbi_types.h.

Referenced by CONN_Wait(), CRemoteAppLauncher::CRemoteAppLauncher(), CExecute::Exec(), CConnTest::ExtraCheckOnFailure(), CConn_Streambuf::Fetch(), g_CTimeoutToSTimeout(), g_STimeoutToCTimeout(), CGencollSvc::GetGenCollService(), CSeqUtils::GetGiPlacements(), CUrlUtils::GetLastModified(), CSeqUtils::GetLocPlacements(), CServer_ConnectionPool::GetPollAndTimerVec(), CSocket::GetTimeout(), SNetServerImpl::SConnectDeadline::IsExpired(), CConnTestThread::Main(), SNetServerImpl::SConnectDeadline::Min(), NcbiMsToTimeout(), NcbiTimeoutToMs(), operator<(), operator>(), CId1FetchApp::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), s_Close(), s_CONN_Read(), s_CONN_Write(), s_Connect_(), s_ConnectAndSend(), s_GetGeneWeight(), s_PreRead(), s_ReadHeader(), s_SetTimeout(), s_to2tv(), s_tv2to(), CTaxon3::SendRequest(), CConn_Streambuf::showmanyc(), SNetScheduleNotificationReceiver::SNetScheduleNotificationReceiver(), URL_ConnectEx(), CNetScheduleNotificationHandler::WaitForNotification(), CId1Reader::x_ConnectAtSlot(), CId2Reader::x_ConnectAtSlot(), x_DrainData(), CId2FetchApp::x_InitConnection(), CSFTranslationJob::x_InitGeneticCode(), x_IsLongerTimeout(), CConn_Streambuf::x_Message(), x_Sendmail_InitEnv(), CReaderServiceConnector::x_SetTimeoutTo(), x_StoreTimeoutNormalized(), CConnTest::x_TimeoutMsg(), and CServer_ConnectionPool::x_UpdateExpiration().

◆ stateless unsigned SConnNetInfo::stateless ◆ svc const char SConnNetInfo::svc[1] ◆ timeout ◆ tmo ◆ unused unsigned short SConnNetInfo::unused ◆ update ◆ usec unsigned int STimeoutTag::usec

microseconds (modulo 1,000,000)

Definition at line 77 of file ncbi_types.h.

Referenced by CONN_Wait(), CRemoteAppLauncher::CRemoteAppLauncher(), CExecute::Exec(), CConnTest::ExtraCheckOnFailure(), CConn_Streambuf::Fetch(), g_CTimeoutToSTimeout(), g_STimeoutToCTimeout(), CGencollSvc::GetGenCollService(), CSeqUtils::GetGiPlacements(), CUrlUtils::GetLastModified(), CSeqUtils::GetLocPlacements(), CServer_ConnectionPool::GetPollAndTimerVec(), CSocket::GetTimeout(), SNetServerImpl::SConnectDeadline::IsExpired(), CConnTestThread::Main(), SNetServerImpl::SConnectDeadline::Min(), NcbiMsToTimeout(), NcbiTimeoutToMs(), operator<(), operator>(), CId1FetchApp::Run(), CNetScheduleDApp::Run(), CNetStorageDApp::Run(), s_Close(), s_CONN_Read(), s_CONN_Write(), s_Connect_(), s_ConnectAndSend(), s_GetGeneWeight(), s_PreRead(), s_ReadHeader(), s_SetTimeout(), s_to2tv(), s_tv2to(), CTaxon3::SendRequest(), CConn_Streambuf::showmanyc(), SNetScheduleNotificationReceiver::SNetScheduleNotificationReceiver(), URL_ConnectEx(), CNetScheduleNotificationHandler::WaitForNotification(), CId1Reader::x_ConnectAtSlot(), CId2Reader::x_ConnectAtSlot(), x_DrainData(), CId2FetchApp::x_InitConnection(), CSFTranslationJob::x_InitGeneticCode(), x_IsLongerTimeout(), CConn_Streambuf::x_Message(), x_Sendmail_InitEnv(), CReaderServiceConnector::x_SetTimeoutTo(), x_StoreTimeoutNormalized(), CConnTest::x_TimeoutMsg(), and CServer_ConnectionPool::x_UpdateExpiration().

◆ user char SConnNetInfo::user[63+1]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4