void error(int n, ...) { va_list ap; va_start(ap, n); verror(n, ap); va_end(ap); }
/* * NAME: warn() * DESCRIPTION: print warning message */ static void warn(char const *message, ...) { va_list args; va_start(args, message); verror(message, args); va_end(args); }
static void bind_a_port(int spy,struct sockaddr_in * sin,int len) { if (bind(spy, (struct sockaddr*)sin, len)) { verror ("spy", NULL); sin->sin_port = htons(ntohs(sin->sin_port) + 1); bind_a_port(spy,sin,len); } else vwarn (NULL, "Spy started on port %d.", ntohs(sin->sin_port)); }
/*PRINTFLIKE1*/ static void notice(const char *fmt, ...) { va_list ap; va_start(ap, fmt); verror(fmt, ap); va_end(ap); }
static void Fatal(const char *fmt, ...) { va_list ap; va_start(ap, fmt); verror(fmt, ap); va_end(ap); exit(EXIT_FAILURE); }
void fatal_error(const char *message, ...) { va_list val; va_start(val, message); verror(0, 3, message, val); va_end(val); exit(EXIT_USER_ERR); }
void fatalerror(const char *fmt, ...) { va_list args; va_start(args, fmt); verror(fmt, args); va_end(args); exit(5); }
/* * Panic (print to stderr and abort). */ void panic(const char *fmt, ...) { va_list l; va_start(l, fmt); verror(0, "panic: ", fmt, l, 0); va_end(l); abort(); }
void FATAL(const char *fmt, ...) { va_list ap; va_start(ap, fmt); verror(fmt, ap); va_end(ap); exit(1); }
void liboctave_fatal (const char *fmt, ...) { va_list args; va_start (args, fmt); verror ("fatal", fmt, args); va_end (args); exit (1); }
int pre_assemble(int handle, int num_readings, char **reading_array) { GapIO *io; int ngels; int nconts; int idbsiz; int *relpg; int *lngthg; int *lnbr; int *rnbr; if (NULL == (io = io_handle(&handle))) return -1; /* initialise fortran arrays */ idbsiz = io_dbsize(io); relpg = &io_relpos(io,1); lngthg = &io_length(io,1); lnbr = &io_lnbr(io,1); rnbr = &io_rnbr(io,1); if (-1 == load_preassembled(io, num_readings, reading_array)) { verror(ERR_WARN, "enter_preassembled", "failed"); } update_fortran_arrays(handle, &ngels, &nconts, &idbsiz, relpg, lngthg, lnbr, rnbr); /* dbchek_(handle, relpg, lngthg, lnbr, rnbr, idm, idbsiz, ngels, nconts, &ierr); */ if (db_check(io) != 0) { verror(ERR_FATAL, "enter_preassembled", "The database is now inconsistent.\n" "You may wish to revert to a copy or to disassemble the newly " "assembled contig."); } flush2t(io); return 0; } /* end pre_assemble */
ssize_t dvmsg(int code, void *, const char *format, va_list va) { if (code == 0) return vmsg(format, va); if ( code > 0 ) vwarning(format, va); else verror(format, va); return 0; }
/* * Print an error message and optionally quit. */ void error(int quit, int e, const char *fmt, ...) { va_list l; va_start(l, fmt); if (e < 0) e = errno; verror(quit, NULL, fmt, l, e); va_end(l); }
/* Report warning msg at current filename, lineno */ void warning_or_error(bool iswarning, const char *format, ...) { va_list args; va_start(args, format); if (iswarning) vwarning(format, args); else verror(format, args); va_end(args); }
f_proc_ret fverr_(f_int *priority, char *fname, char *fmess, f_implicit name_l, f_implicit mess_l) { char mess[1024]; char name[1024]; Fstr2Cstr(fmess, mess_l, mess, 1024); Fstr2Cstr(fname, name_l, name, 1024); verror(*priority, name, "%s", mess); f_proc_return(); }
/* Report pedantic warning or error msg at current filename, lineno */ void pedwarn(const char *format, ...) { va_list args; va_start(args, format); if (flag_pedantic_errors) verror(format, args); else vwarning(format, args); va_end(args); }
/* * NAME: die() * DESCRIPTION: exit with failure status after printing message */ static void die(char const *message, ...) { va_list args; va_start(args, message); verror(message, args); va_end(args); exit(1); }
/* * Sends some text to a command and adds the command's stdout and stderr to * the output and error windows. * * Usage: tout_pipe command text */ int tcl_tout_pipe(ClientData clientData, Tcl_Interp *interp, int argc, char **argv) { int ret; if (argc != 4) return TCL_ERROR; vfuncheader("Output from command '%s'", argv[1]); ret = pipe_mania(argv[2], strlen(argv[2]), argv[1], atoi(argv[3])); if (-1 == ret) { verror(ERR_WARN, "pipe", "command '%s' failed", argv[1]); } else if (-2 == ret) { verror(ERR_WARN, "pipe", "timeout - output from command truncated"); } vTcl_SetResult(interp, "%d", ret); return TCL_OK; }
static void copy_attr_error (struct error_context *ctx, char const *fmt, ...) { int err = errno; va_list ap; /* use verror module to print error message */ va_start (ap, fmt); verror (0, err, fmt, ap); va_end (ap); }
void DrawCSTags(Tcl_Interp *interp, /* in */ int x1, int x2, int tag_num, GAnnotations *annotation, int offset, char *win_name, int width, int contig_num, int read_num) { char type[100]; char *colour = tag_db[0].bg_colour; char cmd[1024], str[5]; int k; /* counter */ sprintf(type, "{tag %s t_%d num_%d rnum_%d}", type2str(annotation->type,str), tag_num, contig_num, read_num); /* find tag colour in tag_db */ for (k = 0; k < tag_db_count; k++){ if (annotation->type == str2type(tag_db[k].id)) { /* sprintf(type, "{tag %s t_%d num_%d}", tag_db[k].search_id, tag_num, contig_num); */ colour = tag_db[k].bg_colour; break; } /* end if */ } /* end for */ /* check that TagArray type and colour been allocated */ if (type == NULL) { verror(ERR_WARN, "CalcTags", "tag type not in tag database"); return; } /* end if */ sprintf(cmd, "%s create rectangle %d %d %d %d " "-fill %s -tags %s -width %d -outline %s\n", win_name, x1, offset, x2 + 1, offset, colour, type, width, colour); Tcl_Eval(interp, cmd); /* printf("cmd %s \n", cmd); */ }
int com_error(char *format, ...) { int ret; va_list args; va_start(args, format); ret = com_vprintf(format, args); va_end(args); va_start(args, format); verror(format, args); va_end(args); return ret; }
/* * rect * * draw a rectangle given two opposite corners * */ void rect(Coord x1, Coord y1, Coord x2, Coord y2) { if (!vdevice.initialised) verror("rect: vogl not initialised"); move2(x1, y1); draw2(x2, y1); draw2(x2, y2); draw2(x1, y2); draw2(x1, y1); }
/*PRINTFLIKE1*/ static void notice(const char *fmt, ...) { va_list ap; if (g_quiet) return; /* -q or quiet pragma suppresses notice()s */ va_start(ap, fmt); verror(fmt, ap); va_end(ap); }
VOID error(CHAR *fmt, ...) { va_list ap; va_start(ap, fmt); verror(fmt, ap); va_end(ap); #ifdef PARANOIA exit(EXIT_FAILURE); #endif }
ATTR_COLD void ptokenizer::error(const char *format, ...) { va_list ap; va_start(ap, format); pstring errmsg1 = pstring(format).vprintf(ap); va_end(ap); verror(errmsg1, currentline_no(), currentline_str()); //throw error; }
int gap_parse_obj_config(cli_args *args, void *store, int objc, Tcl_Obj * const objv[]) { int i, ret = 0; cli_args *a; Tcl_Obj *one_str; one_str = Tcl_NewStringObj("1", -1); for (i = 1; i < objc; i++) { char *aname = Tcl_GetStringFromObj(objv[i], NULL); for (a = args; a->command; a++) { if (strcmp(a->command, aname) == 0) { if (a->value) { if (i == objc - 1) { verror(ERR_WARN, "parse_args", "No argument given for option '%s'\n", aname); ret = -1; break; } parse_args_obj_set(a, store, objv[++i]); } else parse_args_obj_set(a, store, one_str); break; } } if (!a->command) { verror(ERR_WARN,"parse_args", "Unknown option '%s'\n", aname); ret = -1; } } Tcl_DecrRefCount(one_str); return ret; }
void obj_invoke_op(int inum, int op) { extern HTablePtr csplot_hash[HASHMODULUS]; obj_generic *obj; if (NULL == (obj = (obj_generic *)HashSearch(csplot_hash, inum))) { verror(ERR_FATAL, "obj_invoke_op", "Unknown canvas item number! (%d)\n", inum); return; } if (obj->call.func) obj->call.func(OBJ_INVOKE_OPERATION, &op, obj, obj->call.data); }
int ok(int ret, const char *fn, ...) { va_list list; if (ret>=0) return ret; va_start(list, fn); verror("failed", fn, list); va_end(list); return -1; }
/* * bgnpolygon * * Set a flag so that we know what to do with v*() calls. */ void bgnpolygon(void) { if (vdevice.bgnmode != NONE) verror("vogl: bgnpolygon mode already belongs to some other bgn routine"); vdevice.bgnmode = VPOLY; vdevice.fill = polymodeflag; vdevice.save = 1; vdevice.inpolygon = 1; if ((sync = vdevice.sync)!=0) vdevice.sync = 0; }
static void gdb_os_error (host_callback * p, const char *format,...) { if (deprecated_error_hook) (*deprecated_error_hook) (); else { va_list args; va_start (args, format); verror (format, args); va_end (args); } }