本文整理汇总了C++中ExitProgram函数的典型用法代码示例。如果您正苦于以下问题:C++ ExitProgram函数的具体用法?C++ ExitProgram怎么用?C++ ExitProgram使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ExitProgram函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
/*
* This demonstrates the Cdk preprocess feature.
*/
int main (void)
{
/* *INDENT-EQLS* */
CDKSCREEN *cdkscreen = 0;
CDKENTRY *widget = 0;
const char *title = "<C>Type in anything you want\n<C>but the dreaded letter </B>G<!B>!";
char *info;
const char *mesg[10];
char temp[256];
cdkscreen = initCDKScreen (NULL);
/* Start CDK colors. */
initCDKColor ();
/* Create the entry field widget. */
widget = newCDKEntry (cdkscreen, CENTER, CENTER,
title, 0, A_NORMAL, '.', vMIXED,
40, 0, 256, TRUE, FALSE);
/* Is the widget null? */
if (widget == 0)
{
/* Clean up. */
destroyCDKScreen (cdkscreen);
endCDK ();
printf ("Cannot create the entry box. Is the window too small?\n");
ExitProgram (EXIT_FAILURE);
}
setCDKEntryPreProcess (widget, entryPreProcessCB, 0);
/* Activate the entry field. */
info = activateCDKEntry (widget, 0);
/* Tell them what they typed. */
if (widget->exitType == vESCAPE_HIT)
{
mesg[0] = "<C>You hit escape. No information passed back.";
mesg[1] = "",
mesg[2] = "<C>Press any key to continue.";
popupLabel (cdkscreen, (CDK_CSTRING2)mesg, 3);
}
else if (widget->exitType == vNORMAL)
{
mesg[0] = "<C>You typed in the following";
sprintf (temp, "<C>(%.*s)", (int)(sizeof (temp) - 20), info);
mesg[1] = temp;
mesg[2] = "";
mesg[3] = "<C>Press any key to continue.";
popupLabel (cdkscreen, (CDK_CSTRING2)mesg, 4);
}
/* Clean up and exit. */
destroyCDKEntry (widget);
destroyCDKScreen (cdkscreen);
endCDK ();
ExitProgram (EXIT_SUCCESS);
}
开发者ID:ThomasDickey,项目名称:cdk-snapshots,代码行数:63,代码来源:preprocess_ex.c
示例2: main
int main(int argc, char **argv)
{
/* Declare variables. */
CDKSCREEN *cdkscreen;
CDKLABEL *demo;
WINDOW *cursesWin;
char *mesg[4];
CDK_PARAMS params;
CDKparseParams(argc, argv, ¶ms, CDK_MIN_PARAMS);
/* Set up CDK. */
cursesWin = initscr();
cdkscreen = initCDKScreen (cursesWin);
/* Start CDK Colors. */
initCDKColor();
/* Set the labels up. */
mesg[0] = "</5><#UL><#HL(30)><#UR>";
mesg[1] = "</5><#VL(10)>Hello World!<#VL(10)>";
mesg[2] = "</5><#LL><#HL(30)><#LR>";
/* Declare the labels. */
demo = newCDKLabel (cdkscreen,
CDKparamValue(¶ms, 'X', CENTER),
CDKparamValue(¶ms, 'Y', CENTER),
mesg, 3,
CDKparamValue(¶ms, 'N', TRUE),
CDKparamValue(¶ms, 'S', TRUE));
setCDKLabelBackgroundAttrib (demo, COLOR_PAIR(2));
/* Is the label null? */
if (demo == 0)
{
/* Clean up the memory. */
destroyCDKScreen (cdkscreen);
/* End curses... */
endCDK();
/* Spit out a message. */
printf ("Oops. Can't seem to create the label. Is the window too small?\n");
ExitProgram (EXIT_FAILURE);
}
/* Draw the CDK screen. */
refreshCDKScreen (cdkscreen);
waitCDKLabel (demo, ' ');
/* Clean up. */
destroyCDKLabel (demo);
destroyCDKScreen (cdkscreen);
endCDK();
ExitProgram (EXIT_SUCCESS);
}
开发者ID:iamjamestl,项目名称:school,代码行数:58,代码来源:hello_ex.c
示例3: do_options
static void
do_options(int c, char *op[])
{
register int i;
if (c > 1) {
for (i = 1; i < c; i++) {
switch (op[i][0]) {
default:
case '?':
(void) fprintf(stderr, "Usage: battle [-s | -b] [-c]\n");
(void) fprintf(stderr, "\tWhere the options are:\n");
(void) fprintf(stderr, "\t-s : play a salvo game\n");
(void) fprintf(stderr, "\t-b : play a blitz game\n");
(void) fprintf(stderr, "\t-c : ships may be adjacent\n");
ExitProgram(EXIT_FAILURE);
break;
case '-':
switch (op[i][1]) {
case 'b':
blitz = 1;
if (salvo == 1) {
(void) fprintf(stderr,
"Bad Arg: -b and -s are mutually exclusive\n");
ExitProgram(EXIT_FAILURE);
}
break;
case 's':
salvo = 1;
if (blitz == 1) {
(void) fprintf(stderr,
"Bad Arg: -s and -b are mutually exclusive\n");
ExitProgram(EXIT_FAILURE);
}
break;
case 'c':
closepack = 1;
break;
default:
(void) fprintf(stderr,
"Bad arg: type \"%s ?\" for usage message\n",
op[0]);
ExitProgram(EXIT_FAILURE);
}
}
}
}
}
开发者ID:tizenorg,项目名称:external.ncurses,代码行数:48,代码来源:bs.c
示例4: usage
static void
usage(void)
{
#define SKIP(s) /* nothing */
#define KEEP(s) s "\n"
static const char msg[] =
{
KEEP("")
KEEP("Options:")
SKIP(" -a arpanet (obsolete)")
KEEP(" -c set control characters")
SKIP(" -d dialup (obsolete)")
KEEP(" -e ch erase character")
KEEP(" -I no initialization strings")
KEEP(" -i ch interrupt character")
KEEP(" -k ch kill character")
KEEP(" -m mapping map identifier to type")
SKIP(" -p plugboard (obsolete)")
KEEP(" -Q do not output control key settings")
KEEP(" -q display term only, do no changes")
KEEP(" -r display term on stderr")
SKIP(" -S (obsolete)")
KEEP(" -s output TERM set command")
KEEP(" -V print curses-version")
KEEP(" -w set window-size")
KEEP("")
KEEP("If neither -c/-w are given, both are assumed.")
};
#undef KEEP
#undef SKIP
(void) fprintf(stderr, "Usage: %s [options] [terminal]\n", _nc_progname);
fputs(msg, stderr);
ExitProgram(EXIT_FAILURE);
/* NOTREACHED */
}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:35,代码来源:tset.c
示例5: bye_kids
/*
** bye_kids(exit-condition)
**
** Shutdown the terminal, clear the signals, and exit
*/
void
bye_kids(int n)
{ /* reset the tty and exit */
ignoresig();
if (send_reset_init) {
if (exit_ca_mode) {
tc_putp(exit_ca_mode);
}
if (initial_stty_query(TTY_XON_XOFF)) {
if (enter_xon_mode) {
tc_putp(enter_xon_mode);
}
} else if (exit_xon_mode) {
tc_putp(exit_xon_mode);
}
}
if (debug_fp) {
fclose(debug_fp);
}
if (log_fp) {
fclose(log_fp);
}
tty_reset();
fclose(stdin);
fclose(stdout);
fclose(stderr);
if (not_a_tty)
sleep(1);
ExitProgram(n);
}
开发者ID:SamB,项目名称:debian-tack,代码行数:35,代码来源:init.c
示例6: main
int
main(int argc, char *argv[])
{
WINDOW *stsbox;
WINDOW *stswin;
setlocale(LC_ALL, "");
if (argc < 2) {
fprintf(stderr, "usage: %s file\n", argv[0]);
return EXIT_FAILURE;
}
initscr();
test_set_escdelay();
test_set_tabsize();
stsbox = derwin(stdscr, BASE_Y, COLS, 0, 0);
box(stsbox, 0, 0);
wnoutrefresh(stsbox);
stswin = derwin(stsbox, BASE_Y - 2, COLS - 2, 1, 1);
keypad(stswin, TRUE);
test_opaque(1, argv, stswin);
endwin();
ExitProgram(EXIT_SUCCESS);
}
开发者ID:SayCV,项目名称:rtems-addon-packages,代码行数:30,代码来源:test_opaque.c
示例7: die
static void
die(int onsig)
{
(void) signal(onsig, SIG_IGN);
endwin();
ExitProgram(EXIT_SUCCESS);
}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:7,代码来源:blue.c
示例8: main
int
main(int argc, char *argv[])
{
WINDOW *chrbox;
WINDOW *chrwin;
WINDOW *strwin;
setlocale(LC_ALL, "");
if (argc < 2) {
fprintf(stderr, "usage: %s file\n", argv[0]);
return EXIT_FAILURE;
}
initscr();
chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0);
box(chrbox, 0, 0);
wnoutrefresh(chrbox);
chrwin = derwin(chrbox, 1, COLS - 2, 1, 1);
strwin = derwin(chrbox, 4, COLS - 2, 2, 1);
test_inchs(1, argv, chrwin, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
}
开发者ID:AaronDP,项目名称:ncurses-5.9_adbshell,代码行数:28,代码来源:inch_wide.c
示例9: failed
static void
failed(const char *msg)
{
perror(msg);
cleanup();
ExitProgram(EXIT_FAILURE);
}
开发者ID:CSU-GH,项目名称:okl4_3.0,代码行数:7,代码来源:tic.c
示例10: failed
static void
failed(const char *s)
{
perror(s);
endwin();
ExitProgram(EXIT_FAILURE);
}
开发者ID:Scarletts,项目名称:LiteBSD,代码行数:7,代码来源:movewindow.c
示例11: usage
static void
usage(void)
{
static const char *msg[] =
{
"Usage: demo_terminfo [options] [terminal]",
"",
"If no options are given, print all (boolean, numeric, string)",
"capabilities for the given terminal, using short names.",
"",
"Options:",
" -b print boolean-capabilities",
" -f print full names",
" -n print numeric-capabilities",
" -r COUNT repeat for given count",
" -s print string-capabilities",
#ifdef NCURSES_VERSION
" -x print extended capabilities",
#endif
};
unsigned n;
for (n = 0; n < SIZEOF(msg); ++n) {
fprintf(stderr, "%s\n", msg[n]);
}
ExitProgram(EXIT_FAILURE);
}
开发者ID:ysleu,项目名称:RTL8685,代码行数:26,代码来源:demo_terminfo.c
示例12: onsig
static void
onsig(int n GCC_UNUSED)
{
interrupted = TRUE;
cleanup();
ExitProgram(EXIT_FAILURE);
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:7,代码来源:railroad.c
示例13: onsig
static void
onsig(int n GCC_UNUSED)
{
curs_set(1);
endwin();
ExitProgram(EXIT_FAILURE);
}
开发者ID:Scarletts,项目名称:LiteBSD,代码行数:7,代码来源:rain.c
示例14: main
int
main(int argc, char *argv[])
{
int ch;
char buffer[80];
attr_t underline;
bool i_option = FALSE;
setlocale(LC_ALL, "");
while ((ch = getopt(argc, argv, "i")) != -1) {
switch (ch) {
case 'i':
i_option = TRUE;
break;
default:
usage();
}
}
printf("starting filter program using %s...\n",
i_option ? "initscr" : "newterm");
filter();
if (i_option) {
initscr();
} else {
(void) newterm((char *) 0, stdout, stdin);
}
cbreak();
keypad(stdscr, TRUE);
if (has_colors()) {
int background = COLOR_BLACK;
start_color();
#if HAVE_USE_DEFAULT_COLORS
if (use_default_colors() != ERR)
background = -1;
#endif
init_pair(1, COLOR_CYAN, (short) background);
underline = (attr_t) COLOR_PAIR(1);
} else {
underline = A_UNDERLINE;
}
while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR
&& strlen(buffer) != 0) {
reset_shell_mode();
printf("\n");
fflush(stdout);
IGNORE_RC(system(buffer));
reset_prog_mode();
touchwin(stdscr);
erase();
refresh();
}
printw("done");
refresh();
endwin();
ExitProgram(EXIT_SUCCESS);
}
开发者ID:chitranshi,项目名称:ncurses,代码行数:60,代码来源:filter.c
示例15: main
int
main(int argc, char *argv[])
{
int n;
int repeat;
char *name;
int r_opt = 1;
while ((n = getopt(argc, argv, "bfnr:sx")) != -1) {
switch (n) {
case 'b':
b_opt = TRUE;
break;
case 'f':
f_opt = TRUE;
break;
case 'n':
n_opt = TRUE;
break;
case 'r':
if ((r_opt = atoi(optarg)) <= 0)
usage();
break;
case 's':
s_opt = TRUE;
break;
#ifdef NCURSES_VERSION
case 'x':
x_opt = TRUE;
use_extended_names(TRUE);
break;
#endif
default:
usage();
break;
}
}
if (!(b_opt || n_opt || s_opt || x_opt)) {
b_opt = TRUE;
n_opt = TRUE;
s_opt = TRUE;
}
for (repeat = 0; repeat < r_opt; ++repeat) {
if (optind < argc) {
for (n = optind; n < argc; ++n) {
demo_terminfo(argv[n]);
}
} else if ((name = getenv("TERM")) != 0) {
demo_terminfo(name);
} else {
static char dumb[] = "dumb";
demo_terminfo(dumb);
}
}
ExitProgram(EXIT_SUCCESS);
}
开发者ID:ysleu,项目名称:RTL8685,代码行数:59,代码来源:demo_terminfo.c
示例16: QMainWindow
XilinxGUI::XilinxGUI(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
QObject::connect(ui.actExit, SIGNAL(triggered()), this, SLOT(ExitProgram()));
QObject::connect(ui.btnShowPic, SIGNAL(clicked()), this, SLOT(ShowPic()));
}
开发者ID:Varyier,项目名称:xilinx_cw,代码行数:8,代码来源:xilinxgui.cpp
示例17: FatalError
static void
FatalError(const char *f,...)
{
va_list args;
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
ExitProgram(1);
}
开发者ID:aosm,项目名称:X11apps,代码行数:9,代码来源:iso2022.c
示例18: exit_error
static void
exit_error(void)
{
restore_tty_settings();
(void) fprintf(stderr, "\n");
fflush(stderr);
ExitProgram(EXIT_FAILURE);
/* NOTREACHED */
}
开发者ID:ThomasDickey,项目名称:ncurses-snapshots,代码行数:9,代码来源:tset.c
示例19: sighndl
static RETSIGTYPE
sighndl(int signo)
{
signal(signo, sighndl);
sigtermed = signo;
if (redirected) {
endwin();
ExitProgram(EXIT_FAILURE);
}
}
开发者ID:AaronDP,项目名称:ncurses-5.9_adbshell,代码行数:10,代码来源:gdc.c
示例20: exit_error
static void
exit_error(void)
{
if (can_restore)
SET_TTY(STDERR_FILENO, &original);
(void) fprintf(stderr, "\n");
fflush(stderr);
ExitProgram(EXIT_FAILURE);
/* NOTREACHED */
}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:10,代码来源:tset.c
注:本文中的ExitProgram函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论