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

C++ cleanup_exit函数代码示例

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

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



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


示例16: stdouterr_sent

void stdouterr_sent(struct handle *h, size_t new_backlog, int err)
{
    if (err) {
	char buf[4096];
	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
		      buf, lenof(buf), NULL);
	buf[lenof(buf)-1] = '\0';
	if (buf[strlen(buf)-1] == '\n')
	    buf[strlen(buf)-1] = '\0';
	fprintf(stderr, "Unable to write to standard %s: %s\n",
		(h == stdout_handle ? "output" : "error"), buf);
	cleanup_exit(0);
    }

    if (backend_connected(backend)) {
        backend_unthrottle(backend, (handle_backlog(stdout_handle) +
                                     handle_backlog(stderr_handle)));
    }
}
开发者ID:NaldoDj,项目名称:VeraCrypt,代码行数:19,代码来源:winplink.c


示例17: console_get_line

int console_get_line(const char *prompt, char *str,
			    int maxlen, int is_pw)
{
    HANDLE hin, hout;
    DWORD savemode, newmode, i;

    if (console_batch_mode) {
	if (maxlen > 0)
	    str[0] = '\0';
	return 0;
    } else {
	hin = GetStdHandle(STD_INPUT_HANDLE);
	hout = GetStdHandle(STD_OUTPUT_HANDLE);
	if (hin == INVALID_HANDLE_VALUE || hout == INVALID_HANDLE_VALUE) {
	    fprintf(stderr, "Cannot get standard input/output handles\n");
	    cleanup_exit(1);
	}

	GetConsoleMode(hin, &savemode);
	newmode = savemode | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT;
	if (is_pw)
	    newmode &= ~ENABLE_ECHO_INPUT;
	else
	    newmode |= ENABLE_ECHO_INPUT;
	SetConsoleMode(hin, newmode);

	WriteFile(hout, prompt, strlen(prompt), &i, NULL);
	ReadFile(hin, str, maxlen - 1, &i, NULL);

	SetConsoleMode(hin, savemode);

	if ((int) i > maxlen)
	    i = maxlen - 1;
	else
	    i = i - 2;
	str[i] = '\0';

	if (is_pw)
	    WriteFile(hout, "\r\n", 2, &i, NULL);

	return 1;
    }
}
开发者ID:rdebath,项目名称:sgt,代码行数:43,代码来源:wincons.c


示例18: main

int main(int argc, char **argv)
{
    extern int pt_main(int argc, char **argv);
    int ret;

    sk_init();
    flags = FLAG_VERBOSE | FLAG_INTERACTIVE;
    default_protocol = be_default_protocol;
    /* Find the appropriate default port. */
    {
	Backend *b = backend_from_proto(default_protocol);
	default_port = 0; /* illegal */
	if (b)
	    default_port = b->default_port;
    }
    ret = pt_main(argc, argv);
    cleanup_exit(ret);
    return ret;             /* not reached, but placates optimisers */
}
开发者ID:ChrisAntaki,项目名称:putty,代码行数:19,代码来源:uxputty.c


示例19: verify_ssh_host_key

int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
                        char *keystr, char *fingerprint,
                        void (*callback)(void *ctx, int result), void *ctx)
{
    int ret;
    static const char absentmsg_batch[] =
	"The server's host key is not cached in the registry. You\n"
	"have no guarantee that the server is the computer you\n"
	"think it is.\n"
	"The server's %s key fingerprint is:\n"
	"%s\n"
	"Connection abandoned.\n";

    static const char wrongmsg_batch[] =
	"WARNING - POTENTIAL SECURITY BREACH!\n"
	"The server's host key does not match the one PuTTY has\n"
	"cached in the registry. This means that either the\n"
	"server administrator has changed the host key, or you\n"
	"have actually connected to another computer pretending\n"
	"to be the server.\n"
	"The new %s key fingerprint is:\n"
	"%s\n"
	"Connection abandoned.\n";

    /*
     * Verify the key against the registry.
     */
    ret = verify_host_key(host, port, keytype, keystr);

    if (ret == 0)		       /* success - key matched OK */
	return 1;

    if (ret == 2) {		       /* key was different */
        appendLogF(wrongmsg_batch, keytype, fingerprint);
        return 0;
    }
    if (ret == 1) {		       /* key was absent */
        appendLogF(absentmsg_batch, keytype, fingerprint);
        cleanup_exit(1);
    }
    return 1;
}
开发者ID:emonkak,项目名称:putty,代码行数:42,代码来源:wincons2.c


示例20: fputs

char *ssh_sftp_get_cmdline(char *prompt, int no_fds_ok)
{
    int ret;
    struct command_read_ctx actx, *ctx = &actx;
    DWORD threadid;
    HANDLE hThread;

    fputs(prompt, stdout);
    fflush(stdout);

    if ((sftp_ssh_socket == INVALID_SOCKET && no_fds_ok) ||
	p_WSAEventSelect == NULL) {
	return fgetline(stdin);	       /* very simple */
    }

    /*
     * Create a second thread to read from stdin. Process network
     * and timing events until it terminates.
     */
    ctx->event = CreateEvent(NULL, FALSE, FALSE, NULL);
    ctx->line = NULL;

    hThread = CreateThread(NULL, 0, command_read_thread, ctx, 0, &threadid);
    if (!hThread) {
	CloseHandle(ctx->event);
	fprintf(stderr, "Unable to create command input thread\n");
	cleanup_exit(1);
    }

    do {
	ret = do_eventsel_loop(ctx->event);

	/* Error return can only occur if netevent==NULL, and it ain't. */
	assert(ret >= 0);
    } while (ret == 0);

    CloseHandle(hThread);
    CloseHandle(ctx->event);

    return ctx->line;
}
开发者ID:svn2github,项目名称:kitty,代码行数:41,代码来源:winsftp.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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