NCBI C++ ToolKit
Macros | Typedefs | Enumerations | Functions | Variables
ncbiexec.cpp File Reference
#include <ncbi_pch.hpp>
#include <stdio.h>
#include <stdarg.h>
#include <corelib/ncbiexec.hpp>
#include <corelib/ncbifile.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/error_codes.hpp>
#include "ncbisys.hpp"
#include <process.h>
+ Include dependency graph for ncbiexec.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Corelib_System
 
#define s_CheckExecArg(x)
 
#define XGET_EXEC_ARGS(name, ptr)
 
#define XGET_PTR_ARGS(name, ptr)
 
#define XGET_PTR_ENVP(name, ptr)
 
#define XGET_EXEC_ENVP(name)    const char * const * a_##name = va_arg(vargs, const char**);
 
#define RETURN_RESULT(func)
 

Typedefs

typedef ArrayDeleter< const TXChar * > TXArgsDeleter
 
typedef AutoPtr< const TXChar *, TXArgsDeleterTXArgsOrEnv
 

Enumerations

enum  ESpawnFunc { eV , eVE , eVP , eVPE }
 

Functions

static int s_GetRealMode (CExec::EMode mode)
 
static int s_SpawnUnix (ESpawnFunc func, CExec::EMode full_mode, const char *cmdname, const char *const *argv, const char *const *envp=(const char *const *) 0)
 
string s_QuoteSpawnArg (const string &arg)
 
void s_Create_Args_L (vector< TXString > &xargs, TXArgsOrEnv &t_args, va_list &begin, const char *cmdname, const char *argv)
 
void s_Create_Args_V (vector< TXString > &xargs, TXArgsOrEnv &t_args, const char *cmdname, const char **argv)
 
void s_Create_Env (vector< TXString > &xargs, TXArgsOrEnv &t_args, const char **begin)
 

Variables

const unsigned long kWaitPrecision = 100
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Corelib_System

Definition at line 49 of file ncbiexec.cpp.

◆ RETURN_RESULT

#define RETURN_RESULT (   func)
Value:
if (status == -1) { \
NCBI_THROW(CExecException, eSpawn, "CExec::" #func "() failed"); \
} \
CResult result; \
if ((mode & static_cast<EMode>(fModeMask)) == eWait) { \
result.m_Flags = CResult::fExitCode; \
result.m_Result.exitcode = (TExitCode)status; \
} else { \
result.m_Flags = CResult::fHandle; \
result.m_Result.handle = (TProcessHandle)status; \
} \
return result
CExecException –.
Definition: ncbiexec.hpp:607
int TExitCode
Exit code type.
Definition: ncbiexec.hpp:51
TPid TProcessHandle
mdb_mode_t mode
Definition: lmdb++.h:38
else result
Definition: token2.c:20

Definition at line 490 of file ncbiexec.cpp.

◆ s_CheckExecArg

#define s_CheckExecArg (   x)

Definition at line 316 of file ncbiexec.cpp.

◆ XGET_EXEC_ARGS

#define XGET_EXEC_ARGS (   name,
  ptr 
)
Value:
const TXChar* const *a_##name; \
vector<TXString> x_##name; \
TXArgsOrEnv t_##name; \
va_list vargs; \
va_start(vargs, ptr); \
s_Create_Args_L(x_##name, t_##name, vargs, cmdname, ptr); \
a_##name = t_##name.get();
char TXChar
Definition: ncbistr.hpp:172

Definition at line 423 of file ncbiexec.cpp.

◆ XGET_EXEC_ENVP

#define XGET_EXEC_ENVP (   name)     const char * const * a_##name = va_arg(vargs, const char**);

Definition at line 484 of file ncbiexec.cpp.

◆ XGET_PTR_ARGS

#define XGET_PTR_ARGS (   name,
  ptr 
)
Value:
const TXChar* const *a_##name; \
vector<TXString> x_##name; \
TXArgsOrEnv t_##name; \
s_Create_Args_V(x_##name, t_##name, cmdname, (const char**)ptr); \
a_##name = t_##name.get();

Definition at line 455 of file ncbiexec.cpp.

◆ XGET_PTR_ENVP

#define XGET_PTR_ENVP (   name,
  ptr 
)
Value:
const TXChar* const *a_##name; \
vector<TXString> x_##name; \
TXArgsOrEnv t_##name; \
s_Create_Env(x_##name, t_##name, (const char**)ptr); \
a_##name = t_##name.get();

Definition at line 461 of file ncbiexec.cpp.

Typedef Documentation

◆ TXArgsDeleter

Definition at line 321 of file ncbiexec.cpp.

◆ TXArgsOrEnv

Definition at line 322 of file ncbiexec.cpp.

Enumeration Type Documentation

◆ ESpawnFunc

enum ESpawnFunc
Enumerator
eV 
eVE 
eVP 
eVPE 

Definition at line 108 of file ncbiexec.cpp.

Function Documentation

◆ s_Create_Args_L()

void s_Create_Args_L ( vector< TXString > &  xargs,
TXArgsOrEnv t_args,
va_list &  begin,
const char *  cmdname,
const char *  argv 
)

Definition at line 326 of file ncbiexec.cpp.

References _T_XSTRING, i, kEmptyStr, NCBI_THROW, NULL, CExec::QuoteArg(), and s_QuoteSpawnArg().

◆ s_Create_Args_V()

void s_Create_Args_V ( vector< TXString > &  xargs,
TXArgsOrEnv t_args,
const char *  cmdname,
const char **  argv 
)

Definition at line 359 of file ncbiexec.cpp.

References _T_XSTRING, i, kEmptyStr, NCBI_THROW, NULL, CExec::QuoteArg(), and s_QuoteSpawnArg().

◆ s_Create_Env()

void s_Create_Env ( vector< TXString > &  xargs,
TXArgsOrEnv t_args,
const char **  begin 
)

Definition at line 388 of file ncbiexec.cpp.

References _T_XSTRING, i, kEmptyStr, NCBI_THROW, and NULL.

◆ s_GetRealMode()

static int s_GetRealMode ( CExec::EMode  mode)
static

◆ s_QuoteSpawnArg()

string s_QuoteSpawnArg ( const string arg)

Definition at line 248 of file ncbiexec.cpp.

References ITERATE, and NPOS.

Referenced by CExec::RunSilent(), s_Create_Args_L(), and s_Create_Args_V().

◆ s_SpawnUnix()

static int s_SpawnUnix ( ESpawnFunc  func,
CExec::EMode  full_mode,
const char *  cmdname,
const char *const argv,
const char *const envp = (const char *const*)0 
)
static

Variable Documentation

◆ kWaitPrecision

const unsigned long kWaitPrecision = 100

Definition at line 704 of file ncbiexec.cpp.

Referenced by CExec::Wait().

Modified on Sat Jun 15 11:52:31 2024 by modify_doxy.py rev. 669887