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

C++ do_stop函数代码示例

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

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



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

示例1: bluetooth

/*
void bluetooth(void) {
  unsigned int redata,Ddata,choice;
  if(identityset==1)
  {
    redatah=LPLD_UART_GetChar(UART4);
    if(redatah==255)
    {
      identityset=0;
    }
  }
  
  if(identityset==2)
  {
    identityset=0;
    redata=LPLD_UART_GetChar(UART4)+redatah*256;
    choice=redata/4096;
    redata=redata%4096;
    Ddata=redata/256*100+redata/16%16*10+redata%16;
    
    switch(choice)
    {        
    case 0:  turnleft_time_set=Ddata*10;break;
    case 1:  testvalue1=Ddata;break;//将想要实时修改的全局变量替换掉null 在串口调试助手中  
    case 2:  PID_KP=Ddata;break;//输入四位的十六进制字符串 当做十进制的输入就可以了
    case 3:  testvalue3=Ddata;break;//第一个数位你想要改变的变量对应编号
    case 4:  testvalue4=Ddata;break;
    case 5:  testvalue5=Ddata;break;
    case 6:  haoswitch=Ddata;break;
    //case 7:  kd1=Ddata;break;
    //case 8:  kd2=Ddata;break;
    //case 9:  kd3=Ddata;break;
    //case 10:  kd4=Ddata;break;
    //case 11:  kd5=Ddata;break;
    //case 12:  kd6=Ddata;break;
    //case 13:  jiuzheng=Ddata;break;
    //case 14:  null=Ddata;break;
    //case 15:  null=Ddata;break;
    default : break;
    }
    
  }
  identityset++;
}

void sendblue(int a,int b)
{
  char sendbluedata[2];
  
  sendbluedata[0]=a*16+b/256;
  
  sendbluedata[1]=b%256;  
  LPLD_UART_PutCharArr(UART4,(char*)sendbluedata,2);
}

*/
void do_control(void)
{
	switch (routechoice) {
	case C_AHEAD:
		do_goahead();		break;
	case C_GETCORNER:
		do_getcorner();		break;
	case C_LEFT:
		do_turnleft();		break;
	case C_RIGHT:
		do_turnright();		break;
	case C_STOP:
		do_stop();			break;
	case C_AROUND:
		do_turnaround();	break;
	case C_BREAK:
		do_break();			break;
	case C_START:
		do_start(); 		break;
	case C_LETSWIN:
		do_letswin(); 		break;
	default:
		do_stop();
  }
}
开发者ID:ShangxuanWu,项目名称:RoboCup,代码行数:81,代码来源:control.c


示例2: do_control

void do_control()
{
         
	switch(control_action)
	{
        case TURN_LEFT:
			do_turn_left();
            break;
		case TURN_RIGHT:
			do_turn_right();
            break;
		case TURN_BACK:
			do_turn_back();
            break;
		case GO_AHEAD:
			do_go_ahead();
            break;
        case STOP:
			do_stop();
            break;
		case GET_CROSS:
			do_get_cross();
                        break;
		default:
			do_stop();
            break;
	}
	
	#ifdef STOP_DEBUG
	car_set_left_speed(0);
	car_set_right_speed(0);
	#endif
}
开发者ID:ShangxuanWu,项目名称:RoboCup,代码行数:33,代码来源:control.c


示例3: do_cue

// Prepare deck to go into 'READY' state
void do_cue(float cuepoint)
{
	if (verbose) printf("-> do_cue(%f)\n", cuepoint);

	// Stop first
	if (get_state() == MADJACK_STATE_PLAYING ||
	    get_state() == MADJACK_STATE_PAUSED)
	{
		do_stop();
	}
	
	// Had cue-point changed?
	if (get_state() == MADJACK_STATE_READY &&
	    input_file->position != cuepoint)
	{
		if (verbose) printf("Stopping because cuepoint changed.\n");
		do_stop();
	}
	
	// Start the new thread
	if (get_state() == MADJACK_STATE_LOADING ||
	    get_state() == MADJACK_STATE_STOPPED )
	{

		// Set the decoder running
		start_decoder_thread( input_file, cuepoint );
		
	}
	else if (get_state() != MADJACK_STATE_READY)
	{
		fprintf(stderr, "Warning: Can't change from %s to state READY.\n", get_state_name(get_state()) );
	}

}
开发者ID:egasimus,项目名称:madjack,代码行数:35,代码来源:control.c


示例4: test_syscall

void test_syscall(int syscall) {

	//clear_log();
	do_intercept(syscall, 0);
	do_as_guest("./test_full nonroot %d", syscall, 0);
	do_start(syscall, -2, -EINVAL);
	do_start(syscall, 0, 0);
	do_stop(syscall, 0, 0);
	do_start(syscall, 1, 0);
	do_as_guest("./test_full stop %d 1 %d", syscall, -EPERM);
	do_stop(syscall, 1, 0);
	do_as_guest("./test_full start %d -1 %d", syscall, 0);
	do_stop(syscall, last_child, -EINVAL);
	do_release(syscall, 0);

	puts("----- START OF test_PASS -----");
	test_PASS(syscall);
	puts("----- END OF test_PASS -----");
	puts("----- START OF test_A -----");
	test_A(syscall);
	puts("----- END OF test_A -----");
	puts("----- START OF test_B -----");
	test_B(syscall, TRUE);
	puts("----- END OF test_B -----");
	puts("----- START OF test_CDE ----");
	test_CDE(syscall);
	puts("----- END OF test_CDE ----");
}
开发者ID:MeowsterEric,项目名称:CSCB09-Winter_2016,代码行数:28,代码来源:test_full.c


示例5: flush_data

static int
flush_data(ProfilerObject *self)
{
    /* Need to dump data to the log file... */
    size_t written = fwrite(self->buffer, 1, self->index, self->logfp);
    if (written == (size_t)self->index)
        self->index = 0;
    else {
        memmove(self->buffer, &self->buffer[written],
                self->index - written);
        self->index -= written;
        if (written == 0) {
            char *s = PyString_AsString(self->logfilename);
            PyErr_SetFromErrnoWithFilename(PyExc_IOError, s);
            do_stop(self);
            return -1;
        }
    }
    if (written > 0) {
        if (fflush(self->logfp)) {
            char *s = PyString_AsString(self->logfilename);
            PyErr_SetFromErrnoWithFilename(PyExc_IOError, s);
            do_stop(self);
            return -1;
        }
    }
    return 0;
}
开发者ID:xen0n,项目名称:cpython64-64,代码行数:28,代码来源:_hotshot.c


示例6: DlgProc

LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
        switch (Msg) {
	case WM_USER:
		switch (lParam) {
		case WM_LBUTTONDBLCLK:
			ShowWindow(hWndDlg, SW_SHOW);
			return TRUE;
		}
		break;
		
	case WM_TERM:
		do_stop(hWndDlg);
		break;

	case WM_INITDIALOG:
		_hwnd = hWndDlg;
		do_init();
		do_stop(_hwnd);

		start_stop(hWndDlg); /* didn't we say on by default? ;D */
		break;

	case WM_SYSCOMMAND:
		if ((wParam & 0xfff0) == SC_MINIMIZE) {
			minimize(hWndDlg);
			return TRUE;
		}
		break;

        case WM_CLOSE:
		minimize(hWndDlg);
                return TRUE;

        case WM_COMMAND:
                switch(wParam) {
		case IDOK:
			start_stop(hWndDlg);
			return TRUE;
		case IDCANCEL:
			netstat();
			return TRUE;

		case IDC_BUTTON1:
			EndDialog(hWndDlg, 0);
			return TRUE;

		case IDC_BUTTON2:
			hof();
			return TRUE;
		}
		break;
	}

	return FALSE;
}
开发者ID:Hasimir,项目名称:tcpcrypt,代码行数:56,代码来源:tcpcrypt.c


示例7: do_nonroot

int do_nonroot(int syscall) {
	do_intercept(syscall, -EPERM);
	do_release(syscall, -EPERM);
	do_start(syscall, 0, -EPERM);
	do_stop(syscall, 0, -EPERM);
	do_start(syscall, 1, -EPERM);
	do_stop(syscall, 1, -EPERM);
	do_start(syscall, getpid(), 0);
	do_start(syscall, getpid(), -EBUSY);
	do_monitor(syscall);
	do_stop(syscall, getpid(), 0);
	do_stop(syscall, getpid(), -EINVAL);
	return 0;
}
开发者ID:hugosc,项目名称:a1_CSC369,代码行数:14,代码来源:test_full.c


示例8: moving

static void moving(Info * info) {
    if (checkDone()) {
        mylogfd(SCHFD, "[sche]checkDone moving\n");
		info->state = FACE_DOOR;
		return;
	}
	if (!IsBallCatch(info)) {
		do_stop(info);
		info->state = SEARCH_BALL;
		return;
	}
    mylogfd(SCHFD,"MOVING");
    /*static int step = 0;
    if (step == 1 && checkDone()) {
        step = 0;
        info->state = BALL_CATCHED;
        do_rota_with_ball(info, 360, 1);
        return;    
    }    
    if (step == 0 && checkDone()) {
        step = 1;
        info->destP.y = 70;
        info->destP.x = 0;  
        do_catch_ball(info);
        return;
    }*/
}
开发者ID:hewr1993,项目名称:robocup,代码行数:27,代码来源:sched.c


示例9: stop_handler

static
int stop_handler(const char *path, const char *types, lo_arg **argv, int argc,
		 lo_message msg, void *user_data)
{
	do_stop();
    return 0;
}
开发者ID:egasimus,项目名称:madjack,代码行数:7,代码来源:mjosc.c


示例10: do_depend

/*
 * This is an in-fix recursive function called before s is started to
 * stop every service that depends on s, in reverse order *or* after s
 * was started to start again every service that depends on s. The
 * action parametere controls if this function should start or stop
 * the procceses that depends on s.
 * @param s A Service_T object
 * @param action An action to do on the dependant services
 */
static void do_depend(Service_T s, const char *action) {

  Service_T child;
  
  ASSERT(s);

  for(child= servicelist; child; child= child->next) {
    
    if(child->dependantlist) {

      Dependant_T d;
    
      for(d= child->dependantlist; d; d= d->next) {

	if(IS(d->dependant, s->name)) {
	
	  if(IS(action, "start"))
	    do_start(child);
          else if(IS(action, "monitor"))
	    do_monitor(child);
	
	  do_depend(child, action);
	
	  if(IS(action, "stop"))
	    do_stop(child);
          else if(IS(action, "unmonitor"))
	    do_unmonitor(child);

	  break;

	}
      }
    }
  }
}
开发者ID:bumper-app,项目名称:nicad,代码行数:44,代码来源:control.c


示例11: pit_isr0

void pit_isr0() //电机控制5ms
{  
  //读脉冲
	pulsecount = LPLD_LPTMR_GetPulseAcc();
	pulseaccu += pulsecount;
  //pulsetotal+=pulsecount;
	LPLD_LPTMR_Reset();       
	LPLD_LPTMR_Init(MODE_PLACC, 0, LPTMR_ALT1, IRQ_DISABLE, NULL);
  
  
  //分析
  //  analyse();
  //控制
	scan_infrared(r1, r2, r3, r4);
  //fisrthongwaierror();
  //secondhongwaierror();//边沿跳变获得误差
	calculate_infrared_error(r1, INFRARED_LINE1_NUM, &r1_error);
	calculate_infrared_error(r2, INFRARED_LINE2_NUM, &r2_error);
  
	if (is_enabled) do_control();
	else do_stop();
  
	static int __scan_infront_counter = 0;
	
	if (__adc > SCAN_INFRONT_THRESHOLE_SMALL 
		&& abs(r1_error - r2_error) < 2) __scan_infront_counter ++;
	else {
		__scan_infront_counter = 0;
	}
	is_car_infront = __scan_infront_counter > 5;
}
开发者ID:ShangxuanWu,项目名称:RoboCup,代码行数:31,代码来源:control.c


示例12: do_depend

/*
 * This is an in-fix recursive function called before s is started to
 * stop every service that depends on s, in reverse order *or* after s
 * was started to start again every service that depends on s. The
 * action parametere controls if this function should start or stop
 * the procceses that depends on s.
 * @param s A Service_T object
 * @param action An action to do on the dependant services
 */
static void do_depend(Service_T s, int action) {
  Service_T child;
  
  ASSERT(s);

  for (child = servicelist; child; child = child->next) {
    if (child->dependantlist) {
      Dependant_T d;
    
      for (d = child->dependantlist; d; d = d->next) {
	if (IS(d->dependant, s->name)) {
	  if (action == ACTION_START)
	    do_start(child);
          else if (action == ACTION_MONITOR)
	    do_monitor(child);
	  do_depend(child, action);
	  if (action == ACTION_STOP)
	    do_stop(child);
          else if (action == ACTION_UNMONITOR)
	    do_unmonitor(child);
	  break;
	}
      }
    }
  }
}
开发者ID:hafiz,项目名称:yoke,代码行数:35,代码来源:control.c


示例13: test_syscall

void test_syscall(int syscall) {

	//clear_log();
	do_intercept(syscall, 0);
	do_intercept(syscall, -EBUSY);
	do_as_guest("./test_full nonroot %d", syscall, 0);
	do_start(syscall, -2, -EINVAL);
	do_start(syscall, 0, 0);
	do_stop(syscall, 0, 0);
	do_start(syscall, 1, 0);
	do_as_guest("./test_full stop %d 1 %d", syscall, -EPERM);
	do_stop(syscall, 1, 0);
	do_as_guest("./test_full start %d -1 %d", syscall, 0);
	do_stop(syscall, last_child, -EINVAL);
	do_release(syscall, 0);
}
开发者ID:hugosc,项目名称:a1_CSC369,代码行数:16,代码来源:test_full.c


示例14: do_stop

void
gtk_gui::do_load_settings() {
	if (m_mainloop && m_mainloop->is_open())
		do_stop();

	m_settings_chooser = GTK_FILE_CHOOSER (gtk_file_chooser_dialog_new(gettext("Please, select a settings file"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN,"Cancel", GTK_RESPONSE_CANCEL, "Open", GTK_RESPONSE_ACCEPT, NULL));

	GtkFileFilter *filter_xml = gtk_file_filter_new();
	gtk_file_filter_set_name(filter_xml, gettext("XML files"));
	gtk_file_filter_add_pattern(filter_xml, "*.xml");
	gtk_file_chooser_add_filter(m_settings_chooser, filter_xml);

	gint result = gtk_dialog_run (GTK_DIALOG (m_settings_chooser));
	if (result == GTK_RESPONSE_ACCEPT) {
		do_settings_selected();
	}
	gtk_widget_hide(GTK_WIDGET (m_settings_chooser));

	/* Ensure that the dialog box is hidden when the user clicks a button.
	We don't need anymore the callbacks, because they can be embedded in this part of the code */
/*
	g_signal_connect_swapped (GTK_FILE_SELECTION (m_settings_selector)->ok_button,
		"clicked",
		G_CALLBACK (gtk_widget_hide),
		m_settings_selector);

	g_signal_connect_swapped (GTK_FILE_SELECTION (m_settings_selector)->cancel_button,
		"clicked",
		G_CALLBACK (gtk_widget_hide),
		m_settings_selector);
	g_signal_connect_swapped (G_OBJECT ((m_settings_selector)->ok_button),"clicked", G_CALLBACK (gtk_C_callback_settings_selected),(void*) this);
*/
}
开发者ID:InfowareConsulting,项目名称:Signage-Ambulant-Study,代码行数:33,代码来源:gtk_gui.cpp


示例15: RServerCSLtr_Stop

RIOTRtnE RServerCSLtr_Stop(RServerCSLtr * csLtr) {

	RC_ASSERT(csLtr);

	do_stop(csLtr);

	return RC_SUCCESS;
}
开发者ID:yenpai,项目名称:RIOT,代码行数:8,代码来源:RServerCSLtr.c


示例16: start_stop_daemon_main

int
start_stop_daemon_main(int argc, char **argv)
{
	unsigned long opt;
	char *signame = NULL;
	char *startas = NULL;

	bb_applet_long_options = ssd_long_options;

	bb_opt_complementaly = "K~S:S~K";
	opt = bb_getopt_ulflags(argc, argv, "KSba:n:s:u:x:", 
			&startas, &cmdname, &signame, &userspec, &execname);

	/* Check one and only one context option was given */
	if ((opt & 0x80000000UL) || (opt & (SSD_CTX_STOP | SSD_CTX_START)) == 0) {
		bb_show_usage();
	}

	if (signame) {
		signal_nr = bb_xgetlarg(signame, 10, 0, NSIG);
	}

	if (!execname && !userspec)
		bb_error_msg_and_die ("need at least one of -x or -u");

	if (!startas)
		startas = execname;

	if ((opt & SSD_CTX_START) && !startas)
		bb_error_msg_and_die ("-S needs -x or -a");

	argc -= optind;
	argv += optind;

	if (userspec && sscanf(userspec, "%d", &user_id) != 1)
		user_id = my_getpwnam(userspec);

	do_procfs();

	if (opt & SSD_CTX_STOP) {
		do_stop();
		return EXIT_SUCCESS;
	}

	if (found) {
		printf("%s already running.\n%d\n", execname ,found->pid);
		return EXIT_SUCCESS;
	}
	*--argv = startas;
	if (opt & SSD_OPT_BACKGROUND) {
		if (daemon(0, 0) == -1)
			bb_perror_msg_and_die ("unable to fork");
	}
	setsid();
	execv(startas, argv);
	bb_perror_msg_and_die ("unable to start %s", startas);
}
开发者ID:BackupTheBerlios,项目名称:athomux-svn,代码行数:57,代码来源:start_stop_daemon.c


示例17: sighandler

static void sighandler(int signum)
{
	switch (signum) {
	case SIGINT:
	case SIGTERM:
		do_stop();
		break;
	}
}
开发者ID:lubing521,项目名称:busybus,代码行数:9,代码来源:bbus-mon.c


示例18: do_nonroot

/* note this test is run after all processes have been intercepted*/
int do_nonroot(int syscall) {
	do_intercept(syscall, -EPERM);
	do_release(syscall, -EPERM);
	do_start(syscall, 0, -EPERM);
	do_stop(syscall, 0, -EPERM);
	do_start(syscall, 1, -EPERM);
	do_stop(syscall, 1, -EPERM);
	do_start(syscall, getpid(), 0);
	do_start(syscall, getpid(), -EBUSY);
	test_monitor(syscall, TRUE);
	do_stop(syscall, getpid(), 0);
	do_stop(syscall, getpid(), -EINVAL);

	puts("----- START OF test_B -----");
	test_B(syscall, FALSE);
	puts("----- END OF test_B -----");

	return 0;
}
开发者ID:MeowsterEric,项目名称:CSCB09-Winter_2016,代码行数:20,代码来源:test_full.c


示例19: test_B

void test_B(int syscall, int iamroot) {
#define subtestroot(s) printf((s" as %s\n"), (iamroot)?"root":"nonroot")

	subtestroot("EPERM: intercept");
	do_intercept(syscall, iamroot ? 0 : -EPERM);
	subtestroot("EPERM: monitor self");
	do_start(syscall, -1, 0);
	do_stop(syscall, -1, 0);
	subtestroot("EPERM: monitor all processes");
	do_start(syscall, 0, iamroot ? 0 : -EPERM);
	do_stop(syscall, 0, iamroot ? 0 : -EPERM);
	subtestroot("EPERM: monitor init process");
	do_start(syscall, 1, iamroot ? 0 : -EPERM);
	do_stop(syscall, 1, iamroot ? 0 : -EPERM);
	subtestroot("EPERM: release");
	do_release(syscall, iamroot ? 0 : -EPERM);

#undef subtestroot
}
开发者ID:MeowsterEric,项目名称:CSCB09-Winter_2016,代码行数:19,代码来源:test_full.c


示例20: forwarding_ball

static void forwarding_ball(Info * info) {
        if (IsRight(info)) info->sched_var.search_dir = -2;
        if (IsLeft(info)) info->sched_var.search_dir = 2;
        if (IsBallCatch(info))   {
            mylogfd(SCHFD, "[sche]forwarding_ball->ball_catched\n");
            info->last_cmd = CMD_STOP; 
            info->state = BALL_CATCHED;
            info->sched_var.doorseen = 0;        
            do_stop(info);            //  delet // -- redwalker
            if (!IsDoorSeen(info)) do_rota_with_ball(info, POSITI*360, 1);
           return;
        }
        if (!IsBallSeen(info)) {  
            mylogfd(SCHFD, "[sche]forwarding_ball->stop when lose ball\n");
            info->state = SEARCH_BALL;
            do_stop(info);
            return;
        }
       /* else if (IsBallVeryNear(info))
        {
            mylogfd(SCHFD, "[sche]catching_ball->forwarding_ball\n");
            info->state = CATCHING_BALL;
            info->destP.x = gety(info);
            iinfo->destP.y = -getx(info);
            do_catch_ball(info);
        }*/
        if (IsMiddle(info)) {
            do_adjust(-1);
        }
        if (IsLeft(info)) {
            do_adjust(1);
        }
        if (IsRight(info)) {
            do_adjust(0);
        }
        if (checkDone ()) {
            mylogfd(SCHFD, "[sche]checkDone forwarding_ball\n");
            info->state = SEARCH_BALL;
            mylogfd(SCHFD, "[sche]forwarding_ball->SEARCH_BALL\n");
            return;
        }         
}
开发者ID:hewr1993,项目名称:robocup,代码行数:42,代码来源:sched.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ do_sys_ftruncate函数代码示例发布时间:2022-05-30
下一篇:
C++ do_stat函数代码示例发布时间: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