本文整理汇总了C++中run函数的典型用法代码示例。如果您正苦于以下问题:C++ run函数的具体用法?C++ run怎么用?C++ run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: complete
static void
complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, TRUE);
}
开发者ID:Codeminded,项目名称:tinymail,代码行数:5,代码来源:camel-mime-filter-html.c
示例2: main
//.........这里部分代码省略.........
/* Finally, add rule in our forwarding table to pass to our virtual interface */
{
char *const route_args[] =
{
"ip", "route", "add", "default", "dev", dev,
"table", DNS_TABLE, NULL
};
if (0 != fork_and_exec (sbin_ip, route_args))
goto cleanup_forward_3;
}
/* drop privs *except* for the saved UID; this is not perfect, but better
than doing nothing */
#ifdef HAVE_SETRESUID
if (0 != setresuid (uid, uid, 0))
{
fprintf (stderr, "Failed to setresuid: %s\n", strerror (errno));
r = 24;
goto cleanup_route_4;
}
#else
/* Note: no 'setuid' here as we must keep our saved UID as root */
if (0 != seteuid (uid))
{
fprintf (stderr, "Failed to seteuid: %s\n", strerror (errno));
r = 24;
goto cleanup_route_4;
}
#endif
r = 0; /* did fully setup routing table (if nothing else happens, we were successful!) */
/* now forward until we hit a problem */
run (fd_tun);
/* now need to regain privs so we can remove the firewall rules we added! */
#ifdef HAVE_SETRESUID
if (0 != setresuid (uid, 0, 0))
{
fprintf (stderr, "Failed to setresuid back to root: %s\n", strerror (errno));
r = 40;
goto cleanup_route_4;
}
#else
if (0 != seteuid (0))
{
fprintf (stderr, "Failed to seteuid back to root: %s\n", strerror (errno));
r = 40;
goto cleanup_route_4;
}
#endif
/* update routing tables again -- this is why we could not fully drop privs */
/* now undo updating of routing tables; normal exit or clean-up-on-error case */
cleanup_route_4:
{
char *const route_clean_args[] =
{
"ip", "route", "del", "default", "dev", dev,
"table", DNS_TABLE, NULL
};
if (0 != fork_and_exec (sbin_ip, route_clean_args))
r += 1;
}
cleanup_forward_3:
{
开发者ID:claudiuolteanu,项目名称:gnunet-1,代码行数:67,代码来源:gnunet-helper-dns.c
示例3: dag_link
static void
dag_link(struct dag * slf,char *output, char *match, char ** look, char ** lnk)
{
int i, rv, main_count;
char * args;
struct pkg ** pks;
if(slf->sorted){
main_count = num_main_pkgs(slf);
if( main_count > 1 ){
pks = filter_relevant_main(slf, match);
}else{
pks = slf->sorted;
}
if( ! global_get_bool("-dryrun") ){
if( dag_binary_up2date( pks , output ) ){
if(! global_get_bool("-quiet")){
printf("up 2 date: %s\n", output );
}
return;
}
}
struct strvec * v = new_strvec();
v->add(v, global_get_str("-backend"));
v->add(v, "-o");
v->add(v, output );
for(i = 0; pks[i]; i++){
if(pks[i]->o_file){
v->add(v, pks[i]->o_file);
}
}
if(v->len(v) > 3){
if(!global_get_bool("-quiet") && !global_get_bool("-dryrun") ) {
printf("linking : %s\n", output );
}
if( global_get_bool("-static") ){
v->add(v, "-static");
}
if(look){
for(i = 0; look[i]; i++){
v->add(v, "-L");
v->add(v, look[i]);
}
}
if(lnk){
for(i = 0; lnk[i]; i++){
v->add(v, "-l");
v->add(v, lnk[i]);
}
}
args = v->join(v, " ");
if(global_get_bool("-dryrun")) {
printf("%s\n", args);
}else{
rv = run(args);
if(rv == -1){ panic("failed to fork()",__FILE__,__LINE__); }
if(rv){ exit(EXIT_FAILURE); }
}
free(args);
}
v->free(v);
// we have allocated a new array if we filtered
if( main_count > 1 ){
free(pks);
}
}
};
开发者ID:bjarneh,项目名称:organice,代码行数:83,代码来源:dag.c
示例4: run
void TestFixture::run(const std::string &str)
{
testToRun = str;
run();
}
开发者ID:gscacco,项目名称:cppcheck,代码行数:5,代码来源:testsuite.cpp
示例5: ATF_TC_BODY
ATF_TC_BODY(glob_star_not, tc)
{
run("a/**", 0, glob_star_not, __arraycount(glob_star_not));
}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:4,代码来源:t_glob.c
示例6: run_and_delete
void run_and_delete() {
run();
delete this;
}
开发者ID:abners,项目名称:brpc,代码行数:4,代码来源:server.cpp
示例7: main
// This test is expected to be executed either by a regular
// user or by root. If executed by a regular user it doesn't
// test all the functions that would depend on changing the
// effective user id. If executed by a super-user everything
// gets tested. Here are different ways of execing the test binary:
// 1. regular user assuming user == yarn user
// $ test-container-executor
// 2. regular user with a given yarn user
// $ test-container-executor yarn_user
// 3. super user with a given user and assuming user == yarn user
// # test-container-executor user
// 4. super user with a given user and a given yarn user
// # test-container-executor user yarn_user
int main(int argc, char **argv) {
LOGFILE = stdout;
ERRORFILE = stderr;
// clean up any junk from previous run
if (system("chmod -R u=rwx " TEST_ROOT "; rm -fr " TEST_ROOT)) {
exit(1);
}
if (mkdirs(TEST_ROOT "/logs/userlogs", 0755) != 0) {
exit(1);
}
if (write_config_file(TEST_ROOT "/test.cfg", 1) != 0) {
exit(1);
}
read_config(TEST_ROOT "/test.cfg");
local_dirs = extract_values(strdup(NM_LOCAL_DIRS));
log_dirs = extract_values(strdup(NM_LOG_DIRS));
create_nm_roots(local_dirs);
// See the description above of various ways this test
// can be executed in order to understand the following logic
char* current_username = strdup(getpwuid(getuid())->pw_name);
if (getuid() == 0 && (argc == 2 || argc == 3)) {
username = argv[1];
yarn_username = (argc == 3) ? argv[2] : argv[1];
} else {
username = current_username;
yarn_username = (argc == 2) ? argv[1] : current_username;
}
set_nm_uid(geteuid(), getegid());
if (set_user(username)) {
exit(1);
}
printf("\nStarting tests\n");
printf("\nTesting resolve_config_path()\n");
test_resolve_config_path();
printf("\nTesting get_user_directory()\n");
test_get_user_directory();
printf("\nTesting get_app_directory()\n");
test_get_app_directory();
printf("\nTesting get_container_directory()\n");
test_get_container_directory();
printf("\nTesting get_container_launcher_file()\n");
test_get_container_launcher_file();
printf("\nTesting get_app_log_dir()\n");
test_get_app_log_dir();
test_check_configuration_permissions();
printf("\nTesting delete_container()\n");
test_delete_container();
printf("\nTesting delete_app()\n");
test_delete_app();
test_check_user();
// the tests that change user need to be run in a subshell, so that
// when they change user they don't give up our privs
run_test_in_child("test_signal_container_group", test_signal_container_group);
// init app and run container can't be run if you aren't testing as root
if (getuid() == 0) {
// these tests do internal forks so that the change_owner and execs
// don't mess up our process.
test_init_app();
test_run_container();
}
seteuid(0);
// test_delete_user must run as root since that's how we use the delete_as_user
test_delete_user();
free_configurations();
printf("\nTrying banned default user()\n");
//.........这里部分代码省略.........
开发者ID:jiayuhan-it,项目名称:yarn-jyhtest,代码行数:101,代码来源:test-container-executor.c
示例8: run
void BundleRTS::apply() {
run();
output();
}
开发者ID:AutonomyLab,项目名称:visual_coslam,代码行数:4,代码来源:SL_CoSLAMBA.cpp
示例9: do_async
typename std::shared_future<typename std::result_of<F(detail::convertible_to_async_helper)>::type> do_async(F f){
auto ret = std::make_shared<detail::simple_async_function_holder<F>>(f);
return ret->run();
}
开发者ID:jbandela,项目名称:cpp_async_await,代码行数:4,代码来源:std_future_helper.hpp
示例10: m_device
GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
gui::IGUIElement* parent,
IMenuManager *menumgr,
scene::ISceneManager* smgr,
MainMenuData* data,
bool& kill) :
m_device(dev),
m_parent(parent),
m_menumanager(menumgr),
m_smgr(smgr),
m_data(data),
m_texture_source(NULL),
m_sound_manager(NULL),
m_formspecgui(0),
m_buttonhandler(0),
m_menu(0),
m_kill(kill),
m_startgame(false),
m_script(0),
m_scriptdir(""),
m_irr_toplefttext(0),
m_clouds_enabled(true),
m_cloud()
{
//initialize texture pointers
for (unsigned int i = 0; i < TEX_LAYER_MAX; i++) {
m_textures[i].texture = NULL;
}
// is deleted by guiformspec!
m_buttonhandler = new TextDestGuiEngine(this);
//create texture source
m_texture_source = new MenuTextureSource(m_device->getVideoDriver());
//create soundmanager
MenuMusicFetcher soundfetcher;
#if USE_SOUND
m_sound_manager = createOpenALSoundManager(&soundfetcher);
#endif
if(!m_sound_manager)
m_sound_manager = &dummySoundManager;
//create topleft header
std::wstring t = narrow_to_wide(std::string("")); // = narrow_to_wide(std::string("MultiCraft ") + g_version_hash);
core::rect<s32> rect(0, 0, g_fontengine->getTextWidth(t), g_fontengine->getTextHeight());
rect += v2s32(4, 0);
m_irr_toplefttext =
m_device->getGUIEnvironment()->addStaticText(t.c_str(),
rect,false,true,0,-1);
//create formspecsource
m_formspecgui = new FormspecFormSource("");
/* Create menu */
m_menu = new GUIFormSpecMenu(m_device,
m_parent,
-1,
m_menumanager,
NULL /* &client */,
NULL /* gamedef */,
m_texture_source,
m_formspecgui,
m_buttonhandler,
NULL,
false);
m_menu->allowClose(false);
m_menu->lockSize(true,v2u32(800,600));
// Initialize scripting
infostream << "GUIEngine: Initializing Lua" << std::endl;
m_script = new MainMenuScripting(this);
try {
if (m_data->errormessage != "") {
m_script->setMainMenuErrorMessage(m_data->errormessage);
m_data->errormessage = "";
}
if (!loadMainMenuScript()) {
errorstream << "No future without mainmenu" << std::endl;
abort();
}
run();
}
catch(LuaError &e) {
errorstream << "MAINMENU ERROR: " << e.what() << std::endl;
m_data->errormessage = e.what();
}
m_menu->quitMenu();
m_menu->drop();
m_menu = NULL;
}
开发者ID:4aiman,项目名称:MultiCraft,代码行数:99,代码来源:guiEngine.cpp
示例11: run
MatrixXd MCDAQ_t::run_get_data() {
run();
return get_data();
}
开发者ID:henryeherman,项目名称:echidna,代码行数:4,代码来源:mcdaq.hpp
示例12: filter
static void
filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace)
{
run(mf, in, len, prespace, out, outlenptr, outprespace, FALSE);
}
开发者ID:Codeminded,项目名称:tinymail,代码行数:5,代码来源:camel-mime-filter-html.c
示例13: cli_commands
void cli::start()
{
cli_commands() = get_method_names(0);
_run_complete = fc::async( [&](){ run(); } );
}
开发者ID:FollowMyVote,项目名称:fc,代码行数:5,代码来源:cli.cpp
示例14: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
auto keys = QStyleFactory::keys();
for (auto s : keys)
{
qDebug(s.toStdString().c_str());
}
QString ss = load_stylesheet(":/Stylesheets/common.qss");
#ifdef _6IT_UI_MOBILE
ss.append(load_stylesheet(":/Stylesheets/common_mobile.qss"));
#else
ss.append(load_stylesheet(":/Stylesheets/common_desktop.qss"));
#endif
#ifdef _6IT_QT_WINRT_DESKTOP
ss.append(load_stylesheet(":/Stylesheets/winrt_desktop.qss"));
#elif defined(_6IT_QT_WINRT_PHONE)
a.setStyle(QStyleFactory::create("Fusion"));
ss.append(load_stylesheet(":/Stylesheets/winrt_phone.qss"));
#elif defined(_6IT_QT_WINRT_DESKTOP)
ss.append(load_stylesheet(":/Stylesheets/windows_desktop.qss"));
#elif defined(_6IT_QT_IOS)
ss.append(load_stylesheet(":/Stylesheets/ios.qss"));
#elif defined(_6IT_QT_ANDROID)
a.setStyle(QStyleFactory::create("Fusion"));
ss.append(load_stylesheet(":/Stylesheets/android.qss"));
#elif defined(_6IT_QT_LINUX_DESKTOP)
ss.append(load_stylesheet(":/Stylesheets/linux_desktop.qss"));
#endif
a.setStyleSheet(ss);
QThread thread;
auto pworker = new RZQtSubCWorker();
auto &worker = *pworker;
worker.moveToThread(&thread);
thread.start();
FileListWindow fileListWindow;
ViewSourceWindow editorWindow;
RunWindow runWindow;
CompileWindow compileWindow(worker);
fileListWindow.show();
QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &editorWindow, SLOT(show()));
QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &editorWindow, SLOT(loadFile(QString)));
QObject::connect(&fileListWindow, SIGNAL(sourceSelected(QString)), &fileListWindow, SLOT(hide()));
QObject::connect(&editorWindow, SIGNAL(navigatedBack()), &fileListWindow, SLOT(show()));
QObject::connect(&editorWindow, SIGNAL(navigatedBack()), &editorWindow, SLOT(hide()));
QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &editorWindow, SLOT(hide()));
QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &compileWindow, SLOT(show()));
QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &compileWindow, SLOT(clear()));
QObject::connect(&editorWindow, SIGNAL(runCode(QString const &)), &worker, SLOT(setSource(QString const &)));
QObject::connect(&compileWindow, SIGNAL(navigatedBack()), &editorWindow, SLOT(show()));
QObject::connect(&compileWindow, SIGNAL(navigatedBack()), &compileWindow, SLOT(hide()));
QObject::connect(&worker, SIGNAL(compilationWillStart()), &compileWindow, SLOT(compileStarted()));
QObject::connect(&worker, SIGNAL(compilationDidFinish()), &compileWindow, SLOT(compileFinished()));
QObject::connect(&compileWindow, SIGNAL(runClicked()), &compileWindow, SLOT(hide()));
QObject::connect(&compileWindow, SIGNAL(runClicked()), &runWindow, SLOT(show()));
QObject::connect(&compileWindow, SIGNAL(runClicked()), &worker, SLOT(run()));
QObject::connect(&runWindow, SIGNAL(navigatedBack()), &compileWindow, SLOT(show()));
QObject::connect(&runWindow, SIGNAL(navigatedBack()), &runWindow, SLOT(hide()));
QObject::connect(&worker, SIGNAL(runWillStart()), &runWindow, SLOT(runStarted()));
QObject::connect(&worker, SIGNAL(runDidFinish()), &runWindow, SLOT(runFinished()));
QObject::connect(&worker, SIGNAL(sourceChanged()), &worker, SLOT(compile()));
QObject::connect(&worker, SIGNAL(compilerConsoleOutput(QString const &, int)), &compileWindow, SLOT(printString(QString const &, int)));
QObject::connect(&worker, SIGNAL(runConsoleOutput(QString const &, int)), &runWindow, SLOT(printString(QString const &, int)));
return a.exec();
}
开发者ID:rozetti,项目名称:0x0C0DE7AB,代码行数:80,代码来源:main.cpp
示例15: glfwWindowHint
bool RenderHub::init()
{
//std::cout<<"----------------------------\n"
// <<"SPACE LION - Early Prototype\n"
// <<"----------------------------\n";
// Initialize GLFW
if(!glfwInit())
{
std::cout<<"-----\n"
<<"The time is out of joint - O cursed spite,\n"
<<"That ever I was born to set it right!\n"
<<"-----\n"
<<"Error: Couldn't initialize glfw.";
return false;
}
//std::cout<<"Initializing GLFW\n";
//glfwWindowHint(GLFW_VERSION_MAJOR,3);
//glfwWindowHint(GLFW_VERSION_MINOR,3);
glfwWindowHint(GLFW_SAMPLES, 4);
activeWindow = glfwCreateWindow(800,450,"Sea-Crossing",NULL,NULL);
if(!activeWindow)
{
std::cout<<"-----\n"
<<"The time is out of joint - O cursed spite,\n"
<<"That ever I was born to set it right!\n"
<<"-----\n"
<<"Error: Couldn't open glfw window";
glfwTerminate();
return false;
}
glfwMakeContextCurrent(activeWindow);
/*
/ The callback function needs a reference to this object,
/ so just hand it over and quietly weep in the corner.
*/
setActiveInstance(this);
glfwSetWindowSizeCallback(activeWindow,windowSizeCallback);
glfwSetWindowCloseCallback(activeWindow,windowCloseCallback);
Controls::setControlCallbacks(activeWindow);
/* Initialize glew */
//glewExperimental = GL_TRUE;
GLenum error = glewInit();
if( GLEW_OK != error)
{
std::cout<<"-----\n"
<<"The time is out of joint - O cursed spite,\n"
<<"That ever I was born to set it right!\n"
<<"-----\n"
<<"Error: "<<glewGetErrorString(error);
return false;
}
/*
/ Apparently glweInit() causes a GL ERROR 1280, so let's just catch that...
*/
glGetError();
/*
/ This is actually not supposed to be done like this!
*/
addScene();
setActiveScene(0);
run();
return true;
}
开发者ID:nireis,项目名称:sea-crossing,代码行数:73,代码来源:renderHub.cpp
示例16: main
int main(int argc, char *argv[]) {
check_usage(argc);
init(argv);
run();
return 0;
}
开发者ID:pratiksatapathy,项目名称:vEPC-handover-implementation,代码行数:6,代码来源:pgw_server.cpp
示例17: test_delete_container
void test_delete_container() {
if (initialize_user(yarn_username, local_dirs)) {
printf("FAIL: failed to initialize user %s\n", yarn_username);
exit(1);
}
char* app_dir = get_app_directory(TEST_ROOT "/local-2", yarn_username, "app_1");
char* dont_touch = get_app_directory(TEST_ROOT "/local-2", yarn_username,
DONT_TOUCH_FILE);
char* container_dir = get_container_work_directory(TEST_ROOT "/local-2",
yarn_username, "app_1", "container_1");
char buffer[100000];
sprintf(buffer, "mkdir -p %s/who/let/the/dogs/out/who/who", container_dir);
run(buffer);
sprintf(buffer, "touch %s", dont_touch);
run(buffer);
// soft link to the canary file from the container directory
sprintf(buffer, "ln -s %s %s/who/softlink", dont_touch, container_dir);
run(buffer);
// hard link to the canary file from the container directory
sprintf(buffer, "ln %s %s/who/hardlink", dont_touch, container_dir);
run(buffer);
// create a dot file in the container directory
sprintf(buffer, "touch %s/who/let/.dotfile", container_dir);
run(buffer);
// create a no permission file
sprintf(buffer, "touch %s/who/let/protect", container_dir);
run(buffer);
sprintf(buffer, "chmod 000 %s/who/let/protect", container_dir);
run(buffer);
// create a no permission directory
sprintf(buffer, "chmod 000 %s/who/let", container_dir);
run(buffer);
// delete container directory
char * dirs[] = {app_dir, 0};
int ret = delete_as_user(yarn_username, "container_1" , dirs);
if (ret != 0) {
printf("FAIL: return code from delete_as_user is %d\n", ret);
exit(1);
}
// check to make sure the container directory is gone
if (access(container_dir, R_OK) == 0) {
printf("FAIL: failed to delete the directory - %s\n", container_dir);
exit(1);
}
// check to make sure the app directory is not gone
if (access(app_dir, R_OK) != 0) {
printf("FAIL: accidently deleted the directory - %s\n", app_dir);
exit(1);
}
// but that the canary is not gone
if (access(dont_touch, R_OK) != 0) {
printf("FAIL: accidently deleted file %s\n", dont_touch);
exit(1);
}
sprintf(buffer, "chmod -R 700 %s", app_dir);
run(buffer);
sprintf(buffer, "rm -fr %s", app_dir);
run(buffer);
free(app_dir);
free(container_dir);
free(dont_touch);
}
开发者ID:jiayuhan-it,项目名称:yarn-jyhtest,代码行数:65,代码来源:test-container-executor.c
示例18: main
int main(int argc, char *argv[]){
run();
return 0;
}
开发者ID:haroonhassan,项目名称:project_fox,代码行数:4,代码来源:playerdemo.c
示例19: qDebug
void UfrawWorker::developImpl(bool preview, WorkerBase *predecessor)
{
qDebug() << "UfrawWorker::developImpl()" << this << predecessor;
double progressPhaseA = 0.1;
double progressPhaseB = 0.5;
int nof = config()->settings()->getSetting(UfrawSettings::Fuse)->value().toInt();
Magick::Image normalImg;
std::vector<UfrawProcess> ufraw(nof);
int firstIdx = -(nof-1)/2;
for( int i=0; i<nof; i++ )
{
setProgress( double(i) / nof * progressPhaseA );
qDebug() << "UfrawWorker::developImpl() running" << i << "...";
run( ufraw[i], preview, firstIdx+i, nof );
}
for( int i=0; i<nof; i++ )
{
setProgress( progressPhaseA + double(i) / nof * progressPhaseB );
ufraw[i].waitForFinished(-1);
qDebug() << "UfrawWorker::developImpl()" << i << "finished with exitcode" << ufraw[i].exitCode() << ":" << ufraw[i].console();
if( ufraw[i].exitCode() == 0 )
{
bool isNormalExposed = (firstIdx+i)==0;
bool isOverExposed = (firstIdx+i)>0;
qDebug() << "UfrawWorker::developImpl()" << i << "loading" << ufraw[i].output();
Magick::Image img, mask;
img.read( ufraw[i].output().toStdString().c_str() );
if( isNormalExposed )
{
normalImg = img;
normalImg.write( QString("/Users/manuel/tmp/test_normal.tif").toStdString().c_str() );
}
else
{
mask = masked( isOverExposed, 0.98, img );
mask.write( ufraw[i].output().toStdString().c_str() );
mask.write( QString("/Users/manuel/tmp/test_masked%1.tif").arg(i).toStdString().c_str() );
}
}
}
QStringList rawImages;
for( int i=0; i<nof; i++ )
{
rawImages << ufraw[i].output();
}
if( nof > 1 )
{
double sigma = config()->settings()->getSetting(UfrawSettings::ExposureSigma)->value().toDouble();
EnfuseProcess enfuse;
enfuse.setProgram( m_enfusePath );
enfuse.setInputs( rawImages );
enfuse.setExposureSigma( sigma );
connect( &enfuse, &EnfuseProcess::progress, [&](double progress) {
setProgress( progressPhaseA + progressPhaseB + (1-progressPhaseA-progressPhaseB)*progress );
});
enfuse.run();
enfuse.waitForFinished(-1);
qDebug() << "UfrawWorker::developImpl() enfuse finished with exitcode" << enfuse.exitCode() << ":" << enfuse.console();
if( enfuse.exitCode() == 0 )
{
qDebug() << "UfrawWorker::developImpl()" << "loading" << enfuse.output();
m_img.read( enfuse.output().toStdString().c_str() );
m_img.matte(false);
qDebug() << "UfrawWorker::developImpl() fused" << m_img.format().c_str();
}
}
else
{
m_img = normalImg;
}
}
开发者ID:manuel-koch,项目名称:rawstack,代码行数:75,代码来源:ufrawworker.cpp
示例20: main
int
main(int argc, char *argv[]) {
int i;
progname = "dmenu";
for(i = 1; i < argc; i++)
/* single flags */
if(!strcmp(argv[i], "-v") || !strcmp(argv[1], "--version")) {
fputs("dmenu-"VERSION", © 2006-2011 dmenu engineers, see LICENSE for details\n", stdout);
exit(EXIT_SUCCESS);
}
else if(!strcmp(argv[i], "-b") || !strcmp(argv[i], "--bottom"))
topbar = False;
else if(!strcmp(argv[i], "-e") || !strcmp(argv[i], "--echo"))
message = True;
else if(!strcmp(argv[i], "-ec") || !strcmp(argv[i], "--echo-centre"))
message = True, messageposition = CENTRE;
else if(!strcmp(argv[i], "-er") || !strcmp(argv[i], "--echo-right"))
message = True, messageposition = RIGHT;
else if(!strcmp(argv[i], "-i") || !strcmp(argv[i], "--insensitive"))
fstrncmp = strncasecmp;
else if(!strcmp(argv[i], "-r") || !strcmp(argv[i], "--return-early"))
returnearly = True;
else if(i==argc-1)
usage();
/* opts that need 1 arg */
else if(!strcmp(argv[i], "-et") || !strcmp(argv[i], "--echo-timeout"))
timeout = atoi(argv[++i]);
else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--height"))
height = atoi(argv[++i]);
else if(!strcmp(argv[i], "-l") || !strcmp(argv[i], "--lines"))
lines = atoi(argv[++i]);
else if(!strcmp(argv[i], "-m") || !strcmp(argv[i], "--monitor"))
monitor = atoi(argv[++i]);
else if(!strcmp(argv[i], "-p") || !strcmp(argv[i], "--prompt"))
prompt = argv[++i];
else if(!strcmp(argv[i], "-po") || !strcmp(argv[i], "--prompt-only"))
prompt = argv[++i], nostdin = True;
else if(!strcmp(argv[i], "-fn") || !strcmp(argv[i], "--font-name"))
font = argv[++i];
else if(!strcmp(argv[i], "-nb") || !strcmp(argv[i], "--normal-background"))
normbgcolor = argv[++i];
else if(!strcmp(argv[i], "-nf") || !strcmp(argv[i], "--normal-foreground"))
normfgcolor = argv[++i];
else if(!strcmp(argv[i], "-sb") || !strcmp(argv[i], "--selected-background"))
selbgcolor = argv[++i];
else if(!strcmp(argv[i], "-sf") || !strcmp(argv[i], "--selected-foreground"))
selfgcolor = argv[++i];
else
usage();
if(message) {
signal(SIGALRM, alarmhandler);
alarm(timeout);
}
dc = initdc();
initfont(dc, font);
if(!nostdin) {
readstdin();
}
setup();
run();
return EXIT_FAILURE; /* should not reach */
}
开发者ID:stilvoid,项目名称:dmenu,代码行数:66,代码来源:dmenu.c
注:本文中的run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论