• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ process_commands函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中process_commands函数的典型用法代码示例。如果您正苦于以下问题:C++ process_commands函数的具体用法?C++ process_commands怎么用?C++ process_commands使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了process_commands函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, char **argv)
{
	struct gengetopt_args_info opts;
	struct vfi_source *s;
	struct vfi_dev *dev;

	vfi_open(&dev,NULL,opts.timeout_arg);

	cmdline_parser_init(&opts);

	cmdline_parser(argc,argv,&opts);

	if (opts.file_given) {
		vfi_setup_file(dev,&s,fopen(opts.file_arg,"r"));
		process_commands(dev,s,&opts);
	}

	if (opts.inputs_num) {
		setup_inputs(dev,&s,&opts);
		process_commands(dev,s,&opts);
	}

	if (opts.interactive_given) {
		vfi_setup_file(dev,&s,stdin);
		process_commands(dev,s,&opts);
	}

	vfi_close(dev);

	return 0;
}
开发者ID:philterry,项目名称:vfi_app,代码行数:31,代码来源:testprog.c


示例2: srvmgr_module_run

int srvmgr_module_run(char *base_path, char *data, int authorized)
{
	char config_file[BUFSIZE];
	tTokenizer t;
	int ret;

	if (strncmp(data, MODULE_KEYWORD, strlen(MODULE_KEYWORD)) != 0)
		return -ENOTSUP;

	DPRINTF("[%s] Input data: '%s' ( user %s authorized )\n", MODULE_IDENTIFICATION,
		data, authorized ? "is" : "NOT");

	t = tokenize(data);
	if (t.numTokens == 0)
		return -EINVAL;

	snprintf(config_file, sizeof(config_file), "%s/manager.conf", base_path);
	if (access(config_file, R_OK) != 0) {
		DPRINTF("%s: Cannot read configuration file '%s'\n", __FUNCTION__,
			config_file);
		free_tokens(t);
		return -EINVAL;
	}

	ret = process_commands(config_file, authorized, t);
	free_tokens(t);

	return ret;
}
开发者ID:MigNov,项目名称:server-manager,代码行数:29,代码来源:mod_cron.c


示例3: process_commands

void zmq::socket_base_t::in_event ()
{
    //  Process any commands from other threads/sockets that may be available
    //  at the moment. Ultimately, socket will be destroyed.
    process_commands (false, false);
    check_destroy ();
}
开发者ID:XyzalZhang,项目名称:SPlayer,代码行数:7,代码来源:socket_base.cpp


示例4: get_command

void get_command() {
    if ( pc.readable() ) {
        serial_char = pc.getc();

        if (serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1) ) {
            if (!serial_count) {
                return; //empty line
            }
            cmdbuffer[serial_count] = 0; //terminate string

            process_commands();

            comment_mode = false; //for new command
            serial_count = 0; //clear buffer
            //Serial.println("ok");
        } else {
            if (serial_char == ';') {
                comment_mode = true;
            }
            if (!comment_mode) {
                cmdbuffer[serial_count++] = serial_char;
            }
        }
    }


}
开发者ID:garychan,项目名称:RepRap-Firmware-for-mbed-microcontroller,代码行数:27,代码来源:main.cpp


示例5: rn42_task

/******************************************************************************
    rn42_task
*//**
    @brief Handles receiving data from the RN42 bluetooth module.
******************************************************************************/
void
rn42_task(void)
{
    static bool connected = false;
    bool current_status = rn42_connected();

    if (connected != current_status)
    {
        connected = current_status;

        if (connected)
        {
            LED_On(LED1);
        }
        else
        {
            LED_Off(LED1);
        }
    }

    if (connected)
    {
        process_commands();
    }
}
开发者ID:nheijermans,项目名称:eos350d-bluetooth-usb,代码行数:30,代码来源:rn42.c


示例6: DriverPriorityQueue

 DriverPriorityQueue() : q(regular_gt){
     std::string allowable[] = {"r","R",""};
     bool (*gt)(const std::string& a, const std::string& b);
     gt = (ics::prompt_string("Enter comparison for Priority Queue: r[egular] or R[everse]\n  regular means smaller values have higher priority","r",allowable) =="r" ? regular_gt : reverse_gt);
     q = PriorityQueueType(gt);
     process_commands("");
   };
开发者ID:sameel,项目名称:Coding-in-CPlusPLus,代码行数:7,代码来源:driver_priority_queue.hpp


示例7: process_commands

int zmq::socket_base_t::term_endpoint (const char *addr_)
{
    //  Check whether the library haven't been shut down yet.
    if (unlikely (ctx_terminated)) {
        errno = ETERM;
        return -1;
    }

    //  Check whether endpoint address passed to the function is valid.
    if (unlikely (!addr_)) {
        errno = EINVAL;
        return -1;
    }

    //  Process pending commands, if any, since there could be pending unprocessed process_own()'s
    //  (from launch_child() for example) we're asked to terminate now.
    int rc = process_commands (0, false);
    if (unlikely (rc != 0))
        return -1;

    //  Parse addr_ string.
    std::string protocol;
    std::string address;
    if (parse_uri (addr_, protocol, address) || check_protocol (protocol))
        return -1;

    // Disconnect an inproc socket
    if (protocol == "inproc") {
        if (unregister_endpoint (std::string (addr_), this) == 0)
            return 0;
        std::pair <inprocs_t::iterator, inprocs_t::iterator> range = inprocs.equal_range (std::string (addr_));
        if (range.first == range.second) {
            errno = ENOENT;
            return -1;
        }

        for (inprocs_t::iterator it = range.first; it != range.second; ++it)
            it->second->terminate (true);
        inprocs.erase (range.first, range.second);
        return 0;
    }

    //  Find the endpoints range (if any) corresponding to the addr_ string.
    std::pair <endpoints_t::iterator, endpoints_t::iterator> range = endpoints.equal_range (std::string (addr_));
    if (range.first == range.second) {
        errno = ENOENT;
        return -1;
    }

    for (endpoints_t::iterator it = range.first; it != range.second; ++it) {
        //  If we have an associated pipe, terminate it.
        if (it->second.second != NULL)
            it->second.second->terminate (false);
        term_child (it->second.first);
    }
    endpoints.erase (range.first, range.second);
    return 0;
}
开发者ID:malloc-free,项目名称:libzmq,代码行数:58,代码来源:socket_base.cpp


示例8: process_commands

int zmq::socket_base_t::getsockopt (int option_, void *optval_,
                                    size_t *optvallen_)
{
    if (unlikely (ctx_terminated)) {
        errno = ETERM;
        return -1;
    }

    if (option_ == ZMQ_RCVMORE) {
        if (*optvallen_ < sizeof (int)) {
            errno = EINVAL;
            return -1;
        }
        *((int*) optval_) = rcvmore ? 1 : 0;
        *optvallen_ = sizeof (int);
        return 0;
    }

    if (option_ == ZMQ_FD) {
        if (*optvallen_ < sizeof (fd_t)) {
            errno = EINVAL;
            return -1;
        }
        *((fd_t*) optval_) = mailbox.get_fd ();
        *optvallen_ = sizeof (fd_t);
        return 0;
    }

    if (option_ == ZMQ_EVENTS) {
        if (*optvallen_ < sizeof (int)) {
            errno = EINVAL;
            return -1;
        }
        int rc = process_commands (0, false);
        if (rc != 0 && (errno == EINTR || errno == ETERM))
            return -1;
        errno_assert (rc == 0);
        *((int*) optval_) = 0;
        if (has_out ())
            *((int*) optval_) |= ZMQ_POLLOUT;
        if (has_in ())
            *((int*) optval_) |= ZMQ_POLLIN;
        *optvallen_ = sizeof (int);
        return 0;
    }

    if (option_ == ZMQ_LAST_ENDPOINT) {
        if (*optvallen_ < last_endpoint.size () + 1) {
            errno = EINVAL;
            return -1;
        }
        strcpy (static_cast <char *> (optval_), last_endpoint.c_str ());
        *optvallen_ = last_endpoint.size () + 1;
        return 0;
    }

    return options.getsockopt (option_, optval_, optvallen_);
}
开发者ID:BugFreeSoftware,项目名称:Open-Transactions,代码行数:58,代码来源:socket_base.cpp


示例9: process_commands

int zmq::socket_base_t::getsockopt (int option_, void *optval_,
    size_t *optvallen_)
{
    if (unlikely (ctx_terminated)) {
        errno = ETERM;
        return -1;
    }

    if (option_ == ZMQ_RCVLABEL) {
        if (*optvallen_ < sizeof (int)) {
            errno = EINVAL;
            return -1;
        }
        *((int*) optval_) = rcvlabel ? 1 : 0;
        *optvallen_ = sizeof (int);
        return 0;
    }

    if (option_ == ZMQ_RCVMORE) {
        if (*optvallen_ < sizeof (int)) {
            errno = EINVAL;
            return -1;
        }
        *((int*) optval_) = rcvmore ? 1 : 0;
        *optvallen_ = sizeof (int);
        return 0;
    }

    if (option_ == ZMQ_FD) {
        if (*optvallen_ < sizeof (fd_t)) {
            errno = EINVAL;
            return -1;
        }
        *((fd_t*) optval_) = mailbox.get_fd ();
        *optvallen_ = sizeof (fd_t);
        return 0;
    }

    if (option_ == ZMQ_EVENTS) {
        if (*optvallen_ < sizeof (int)) {
            errno = EINVAL;
            return -1;
        }
        int rc = process_commands (0, false);
        if (rc != 0 && (errno == EINTR || errno == ETERM))
            return -1;
        errno_assert (rc == 0);
        *((int*) optval_) = 0;
        if (has_out ())
            *((int*) optval_) |= ZMQ_POLLOUT;
        if (has_in ())
            *((int*) optval_) |= ZMQ_POLLIN;
        *optvallen_ = sizeof (int);
        return 0;
    }

    return options.getsockopt (option_, optval_, optvallen_);
}
开发者ID:adymitruk,项目名称:zeromq3-0,代码行数:58,代码来源:socket_base.cpp


示例10: process_commands

int zmq::socket_base_t::send (::zmq_msg_t *msg_, int flags_)
{
    //  Check whether the library haven't been shut down yet.
    if (unlikely (ctx_terminated)) {
        errno = ETERM;
        return -1;
    }

    //  Check whether message passed to the function is valid.
    if (unlikely ((msg_->flags | ZMQ_MSG_MASK) != 0xff)) {
        errno = EFAULT;
        return -1;
    }

    //  Process pending commands, if any.
    int rc = process_commands (false, true);
    if (unlikely (rc != 0))
        return -1;

    //  At this point we impose the MORE flag on the message.
    if (flags_ & ZMQ_SNDMORE)
        msg_->flags |= ZMQ_MSG_MORE;

    //  Try to send the message.
    rc = xsend (msg_, flags_);
    if (rc == 0)
        return 0;

    //  In case of non-blocking send we'll simply propagate
    //  the error - including EAGAIN - upwards.
    if (flags_ & ZMQ_NOBLOCK)
        return -1;

    //  Oops, we couldn't send the message. Wait for the next
    //  command, process it and try to send the message again.
    while (rc != 0) {
        if (errno != EAGAIN)
            return -1;
        if (unlikely (process_commands (true, false) != 0))
            return -1;
        rc = xsend (msg_, flags_);
    }
    return 0;
}
开发者ID:ninoles,项目名称:zeromq2-2,代码行数:44,代码来源:socket_base.cpp


示例11: gcode_loop

void gcode_loop(void) {
    if (buflen < (BUFSIZE - 1))
        get_command();

    if (buflen) {
        process_commands();
        buflen = (buflen - 1);
        bufindr = (bufindr + 1) % BUFSIZE;
    }
}
开发者ID:emente,项目名称:Freecut,代码行数:10,代码来源:gcode.c


示例12: main

int main(int argc,char ** argv)
{
  daemon_init();
  for (;;)
  {
    process_commands();
    sleep(10);
  }
  return 0;
}
开发者ID:sandeshghimire,项目名称:raspberry-pi-app,代码行数:10,代码来源:led_test.c


示例13: main

/*************************M*A*I*N*************************/
int main(void) {
	turtle_t boo;
	pen_t pen;
	srand(time(NULL));

	set_ps_header(HEIGHT, WIDTH);
	process_commands(&boo, &pen);
	set_ps_display();

	return 0;
}
开发者ID:b-e-t,项目名称:LOGO-Turtle-simulation,代码行数:12,代码来源:turtle_B.c


示例14: main

int main(int argc, char *argv[])
{
	init();
	if(init_setting() != 0){
		print_errmsg("ERROR: SETTING init fail. \n");
		return 1;	
	}
	if(gc_init() != 0){
		print_errmsg("ERROR: G_CODE init fail. \n");
		return 1;
	}
	if (cm_init() == false)
	{
		print_errmsg("ERROR: USB-DEV init fail. \n");
		return 1;
	}
  
	if (cmd_init() == false)
	{
		print_errmsg("ERROR: G code init fail.\n");
		cm_close();
		return 1;
	}
	
	if (tp_init() == false)
	{
		print_errmsg("ERROR: Temperature library init fail. \n");
		cmd_close();
		cm_close();
		return 1;
	}

	plan_init();
	Config_ResetDefault();
	st_init();

	while(1) {
		LCD(10UL);
		getCommand(10UL);
		process_commands(50UL);
		stepper(1000L);
		manageHeater(10UL);
	}

	st_close();
	plan_close();
	tp_close();
	cmd_close();
	cm_close();
	//debug
	//sfp_close();
	return 0;
}
开发者ID:brucetsao,项目名称:Print3D,代码行数:53,代码来源:main.cpp


示例15: process_commands

int zmq::socket_base_t::send (::zmq_msg_t *msg_, int flags_)
{

	//LOGD() << "zmq::socket_base_t::send" << LOG_ENDL();

    if (unlikely (ctx_terminated)) {
        errno = ETERM;
        return -1;
    }

    //  Process pending commands, if any.
    int rc = process_commands (false, true);
    if (unlikely (rc != 0))
        return -1;

    //  At this point we impose the MORE flag on the message.
    if (flags_ & ZMQ_SNDMORE)
        msg_->flags |= ZMQ_MSG_MORE;

    //  Try to send the message.
    rc = xsend (msg_, flags_);
    if (rc == 0)
        return 0;

    //  In case of non-blocking send we'll simply propagate
    //  the error - including EAGAIN - upwards.
    if (flags_ & ZMQ_NOBLOCK)
        return -1;

    //  Oops, we couldn't send the message. Wait for the next
    //  command, process it and try to send the message again.
    while (rc != 0) {
        if (errno != EAGAIN)
            return -1;
        if (unlikely (process_commands (true, false) != 0))
            return -1;
        rc = xsend (msg_, flags_);
    }
    return 0;
}
开发者ID:Undev,项目名称:zeromq2-1,代码行数:40,代码来源:socket_base.cpp


示例16: loop

/*-------------------------------------------------
* And the primary command parser loop
*/
void loop()
{
  if(buflen < (BUFSIZE-1))
    get_command();

  if(buflen)
  {
    process_commands();
    buflen = (buflen-1);
    bufindr = (bufindr + 1)%BUFSIZE;
  } else {
	manage_inactivity();
  }
}
开发者ID:neocoretechs,项目名称:WireOO,代码行数:17,代码来源:RoboCore_main.cpp


示例17: TIMER_CALLBACK

static TIMER_CALLBACK( vsync_update )
{
	const device_config *laserdisc = device_list_first(machine->config->devicelist, LASERDISC);
	int vblank_scanline;
	attotime target;

	/* handle commands */
	if (!param)
		process_commands(laserdisc);

	/* set a timer to go off on the next VBLANK */
	vblank_scanline = video_screen_get_visible_area(machine->primary_screen)->max_y + 1;
	target = video_screen_get_time_until_pos(machine->primary_screen, vblank_scanline, 0);
	timer_set(machine, target, NULL, 0, vsync_update);
}
开发者ID:nitrologic,项目名称:emu,代码行数:15,代码来源:ldplayer.c


示例18: main

int main(void) {
    enum CID cid;
    puts("Добропожаловать в программу базы кораблей!");
    db_ship();
    puts("вот команды, которые вам понадобятся для работы:");
    show_help();
    
    while (1) {
       putchar('>'); //fflush(stdout);
       cid = input();
        if (cid == EXIT)
              return 0;
       process_commands(cid);
}

}
开发者ID:vovach777,项目名称:shipDB,代码行数:16,代码来源:app.c


示例19: ENTER_MUTEX

void zmq::socket_base_t::in_event ()
{
    //  This function is invoked only once the socket is running in the context
    //  of the reaper thread. Process any commands from other threads/sockets
    //  that may be available at the moment. Ultimately, the socket will
    //  be destroyed.
    ENTER_MUTEX ();

    //  If the socket is thread safe we need to unsignal the reaper signaler
    if (thread_safe)
        reaper_signaler->recv();

    process_commands (0, false);
    EXIT_MUTEX ();
    check_destroy ();
}
开发者ID:hjybdrs,项目名称:libzmq,代码行数:16,代码来源:socket_base.cpp


示例20: loop

void loop()
{
  unsigned long current_time = millis();

  if (current_time - last_time > 1000 || last_time == -1) {
    ledState = ledState == HIGH ? LOW : HIGH;
    digitalWrite(HEARTBEAT_LED, ledState);

    maintain_system(current_time);

    last_time = current_time;

    uptime += 1;
  }

  process_commands();
  delay(1);
}
开发者ID:tmclane,项目名称:fermware,代码行数:18,代码来源:main.cpp



注:本文中的process_commands函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ process_events函数代码示例发布时间:2022-05-30
下一篇:
C++ process_block函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap