当前位置: 首页>>代码示例>>C++>>正文


C++ cleanup_exit函数代码示例

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


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

示例1: modalfatalbox

void modalfatalbox(const char *p, ...)
{
    va_list ap;
    fprintf(stderr, "FATAL ERROR: ");
    va_start(ap, p);
    vfprintf(stderr, p, ap);
    va_end(ap);
    fputc('\n', stderr);
    cleanup_exit(1);
}
开发者ID:svn2github,项目名称:kitty,代码行数:10,代码来源:cmdgen.c

示例2: modalfatalbox

void modalfatalbox(char *fmt, ...) {
    va_list ap;
    Str255 stuff;
    
    va_start(ap, fmt);
    /* We'd like stuff to be a Pascal string */
    stuff[0] = vsprintf((char *)(&stuff[1]), fmt, ap);
    va_end(ap);
    ParamText(stuff, NULL, NULL, NULL);
    StopAlert(128, NULL);
    cleanup_exit(1);
}
开发者ID:rdebath,项目名称:sgt,代码行数:12,代码来源:macmisc.c

示例3: fatalbox

void fatalbox(char *fmt, ...)
{
    va_list ap;
    char *stuff, morestuff[100];

    va_start(ap, fmt);
    stuff = dupvprintf(fmt, ap);
    va_end(ap);
    sprintf(morestuff, "%.70s Fatal Error", appname);
    MessageBox(GetParentHwnd(), stuff, morestuff, MB_ICONERROR | MB_OK);
    sfree(stuff);
    cleanup_exit(1);
}
开发者ID:pampersrocker,项目名称:G-CVSNT,代码行数:13,代码来源:PLINK.C

示例4: modalfatalbox

void modalfatalbox(const char *fmt, ...)
{
    va_list ap;
    char* str;

    va_start(ap, fmt);
    str = dupvprintf(fmt, ap);
    va_end(ap);
    fzprintf(sftpError, "Fatal error: %s", str);
    sfree(str);

    cleanup_exit(1);
}
开发者ID:zedfoxus,项目名称:filezilla-client,代码行数:13,代码来源:cmdgen.c

示例5: connection_fatal

void connection_fatal(void *frontend, char *p, ...)
{
    struct gui_data *inst = (struct gui_data *)frontend;
    va_list ap;
    char *msg;
    va_start(ap, p);
    msg = dupvprintf(p, ap);
    va_end(ap);
    inst->exited = TRUE;
    QMessageBox::critical(qPutty,"Fatal error",msg);
    sfree(msg);
    if (conf_get_int(inst->conf, CONF_close_on_exit) == FORCE_ON)
        cleanup_exit(1);
}
开发者ID:dsmorozov,项目名称:qputty-qt5,代码行数:14,代码来源:qtwin.cpp

示例6: connection_fatal

void connection_fatal(void *frontend, char *p, ...)
{
	va_list ap;
	char *stuff, morestuff[100];

	va_start(ap, p);
	stuff = dupvprintf(p, ap);
	va_end(ap);
	sprintf(morestuff, "%.70s Fatal Error", appname);
	MessageBox(GetParentHwnd(), stuff, morestuff,
		MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
	sfree(stuff);
	cleanup_exit(1);
}
开发者ID:omnibs,项目名称:TortoiseGit,代码行数:14,代码来源:WINPLINK.C

示例7: connection_fatal

void connection_fatal(void *frontend, char *p, ...)
{
    va_list ap;
    fprintf(stderr, "FATAL ERROR: ");
    va_start(ap, p);
    vfprintf(stderr, p, ap);
    va_end(ap);
    fputc('\n', stderr);
    if (logctx) {
        log_free(logctx);
        logctx = NULL;
    }
    cleanup_exit(1);
}
开发者ID:svn2github,项目名称:kitty,代码行数:14,代码来源:winplink.c

示例8: modalfatalbox

void modalfatalbox(char *p, ...)
{
    va_list ap;
    fprintf(stderr, "FATAL ERROR: ");
    va_start(ap, p);
    vfprintf(stderr, p, ap);
    va_end(ap);
    fputc('\n', stderr);
    if (logctx) {
        log_free(logctx);
        logctx = NULL;
    }
    cleanup_exit(1);
}
开发者ID:svn2github,项目名称:kitty,代码行数:14,代码来源:winplink.c

示例9: mac_menucommand

static void mac_menucommand(long result)
{
    short menu, item;
    WindowPtr window;
#if !TARGET_API_MAC_CARBON
    Str255 da;
#endif

    menu = HiWord(result);
    item = LoWord(result);
    window = FrontWindow();
    /* Things which do the same whatever window we're in. */
    switch (menu) {
      case mApple:
        switch (item) {
          case iAbout:
	    mac_openabout();
            goto done;
#if !TARGET_API_MAC_CARBON
          default:
            GetMenuItemText(GetMenuHandle(mApple), item, da);
            OpenDeskAcc(da);
            goto done;
#endif
        }
        break;
      case mFile:
        switch (item) {
	  case iNew:
	    mac_newkey();
	    goto done;
          case iClose:
            mac_closewindow(window);
            goto done;
          case iQuit:
            cleanup_exit(0);
            goto done;
        }
        break;
    }
    /* If we get here, handling is up to window-specific code. */
    if (mac_wininfo(window)->menu != NULL)
	(*mac_wininfo(window)->menu)(window, menu, item);

  done:
    HiliteMenu(0);
}
开发者ID:LapsedAcademicsInc,项目名称:putty,代码行数:47,代码来源:macpgen.c

示例10: fatalbox

void fatalbox(char *p, ...)
{
	va_list ap;
	char *stuff, morestuff[100];

	va_start(ap, p);
	stuff = dupvprintf(p, ap);
	va_end(ap);
	sprintf(morestuff, "%.70s Fatal Error", appname);
	MessageBox(GetParentHwnd(), stuff, morestuff, MB_ICONERROR | MB_OK);
	sfree(stuff);
    if (logctx) {
        log_free(logctx);
        logctx = NULL;
    }
	cleanup_exit(1);
}
开发者ID:hfeeki,项目名称:TortoiseGit,代码行数:17,代码来源:WINPLINK.C

示例11: modalfatalbox

void modalfatalbox(char *p, ...)
{
    struct termios cf;
    va_list ap;
    premsg(&cf);
    fprintf(stderr, "FATAL ERROR: ");
    va_start(ap, p);
    vfprintf(stderr, p, ap);
    va_end(ap);
    fputc('\n', stderr);
    postmsg(&cf);
    if (logctx) {
        log_free(logctx);
        logctx = NULL;
    }
    cleanup_exit(1);
}
开发者ID:rd-alex-alex2006hw,项目名称:putty,代码行数:17,代码来源:uxplink.c

示例12: get_remote_ipaddr

const char *
get_remote_ipaddr(void)
{
	/* Check whether we have cached the ipaddr. */
	if (canonical_host_ip == NULL) {
		if (packet_connection_is_on_socket()) {
			canonical_host_ip =
			    get_peer_ipaddr(packet_get_connection_in());
			if (canonical_host_ip == NULL)
				cleanup_exit(255);
		} else {
			/* If not on socket, return UNKNOWN. */
			canonical_host_ip = xstrdup("UNKNOWN");
		}
	}
	return canonical_host_ip;
}
开发者ID:salva,项目名称:my-openssh,代码行数:17,代码来源:canohost.c

示例13: connection_fatal

void connection_fatal(void *frontend, const char *p, ...)
{
    struct termios cf;
    va_list ap;
    premsg(&cf);
    fprintf(stderr, "FATAL ERROR: ");
    va_start(ap, p);
    vfprintf(stderr, p, ap);
    va_end(ap);
    fputc('\n', stderr);
    postmsg(&cf);
    if (logctx) {
        log_free(logctx);
        logctx = NULL;
    }
    cleanup_exit(1);
}
开发者ID:autoandshare,项目名称:putty-toolpakcloud,代码行数:17,代码来源:uxplink.c

示例14: read_file

static void read_file(char * name)
{
   FILE *file = fopen(name,"r");
   int ch, j;
   char *bufptr;

   if (file == NULL) {
      sprintf(sprintfbuf, "ERROR: Cannot open file \"%s\": skipping\n", name);
      show(sprintfbuf, ON_NEW_LINE);
      globalfilebuf = NULL;
      return;
   }
   errno = 0;
   (void)fseek(file, 0, SEEK_END);
      /* fseek return value puzzling, using errno */
   if (errno) {
      sprintf(sprintfbuf, "ERROR: Reading file \"%s\": skipping\n", name);
      show(sprintfbuf, ON_NEW_LINE);
      globalfilebuf = NULL;
      return;
   }
   if ((bufptr = globalfilebuf =
            (char *)malloc((size_t)ftell(file)+1)) == NULL) {
      sprintf(sprintfbuf,
             "FATAL ERROR: Cannot allocate %ld bytes to load program text\n",
              ftell(file)+1);
      show(sprintfbuf, ON_NEW_LINE);
      cleanup_exit(EXIT_FAILURE);
   }
   strncpy(globalfilename, name, NAMELEN);
   globalfilename[NAMELEN-1] = '\0';

   rewind(file);
   while (!feof(file) && ((ch = getc(file)) != EOF))
      *bufptr++ = (char)ch;
   *bufptr = '\0';

   (void)fclose(file);

   if (standalone && globalfilebuf[0]=='#' && globalfilebuf[1]=='!')
      for (j=0; globalfilebuf[j]!=CR && globalfilebuf[j]!=LF; j++)
         globalfilebuf[j] = ' ';
   /* allow #!/usr/local/bin/pico -bis (and don't mess up mark) */
}
开发者ID:aropop,项目名称:pico,代码行数:44,代码来源:tpico.c

示例15: sighandler

static void sighandler(int signum){

	int ret = EXIT_FAILURE;

 	if (signum == -1) {
		fprintf(stderr, "Exiting due to errors.\n");
	} else {

		if (signum == SIGTERM || signum == SIGINT){
			fprintf(stderr, "Caught CTRL-C or SIGTERM.\n");
			ret = EXIT_SUCCESS;
		} else {
			fprintf(stderr, "Exiting due to errors.\n");
		}
	}

	cleanup_exit(ret);

}
开发者ID:zmike,项目名称:ezrpc,代码行数:19,代码来源:zproxy.c


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