Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

error.c

Go to the documentation of this file.
00001 /****************************************************************
00002 Copyright 1990, 1993, 1994 by AT&T, Lucent Technologies and Bellcore.
00003 
00004 Permission to use, copy, modify, and distribute this software
00005 and its documentation for any purpose and without fee is hereby
00006 granted, provided that the above copyright notice appear in all
00007 copies and that both that the copyright notice and this
00008 permission notice and warranty disclaimer appear in supporting
00009 documentation, and that the names of AT&T, Bell Laboratories,
00010 Lucent or Bellcore or any of their entities not be used in
00011 advertising or publicity pertaining to distribution of the
00012 software without specific, written prior permission.
00013 
00014 AT&T, Lucent and Bellcore disclaim all warranties with regard to
00015 this software, including all implied warranties of
00016 merchantability and fitness.  In no event shall AT&T, Lucent or
00017 Bellcore be liable for any special, indirect or consequential
00018 damages or any damages whatsoever resulting from loss of use,
00019 data or profits, whether in an action of contract, negligence or
00020 other tortious action, arising out of or in connection with the
00021 use or performance of this software.
00022 ****************************************************************/
00023 
00024 #include "defs.h"
00025 
00026  void
00027 #ifdef KR_headers
00028 warni(s, t)
00029         char *s;
00030         int t;
00031 #else
00032 warni(char *s, int t)
00033 #endif
00034 {
00035         char buf[100];
00036         sprintf(buf,s,t);
00037         warn(buf);
00038         }
00039 
00040  void
00041 #ifdef KR_headers
00042 warn1(s, t)
00043         char *s;
00044         char *t;
00045 #else
00046 warn1(char *s, char *t)
00047 #endif
00048 {
00049         char buff[100];
00050         sprintf(buff, s, t);
00051         warn(buff);
00052 }
00053 
00054  void
00055 #ifdef KR_headers
00056 warn(s)
00057         char *s;
00058 #else
00059 warn(char *s)
00060 #endif
00061 {
00062         if(nowarnflag)
00063                 return;
00064         if (infname && *infname)
00065                 fprintf(diagfile, "Warning on line %ld of %s: %s\n",
00066                         lineno, infname, s);
00067         else
00068                 fprintf(diagfile, "Warning on line %ld: %s\n", lineno, s);
00069         fflush(diagfile);
00070         ++nwarn;
00071 }
00072 
00073  void
00074 #ifdef KR_headers
00075 errstr(s, t)
00076         char *s;
00077         char *t;
00078 #else
00079 errstr(char *s, char *t)
00080 #endif
00081 {
00082         char buff[100];
00083         sprintf(buff, s, t);
00084         err(buff);
00085 }
00086 
00087 
00088  void
00089 #ifdef KR_headers
00090 erri(s, t)
00091         char *s;
00092         int t;
00093 #else
00094 erri(char *s, int t)
00095 #endif
00096 {
00097         char buff[100];
00098         sprintf(buff, s, t);
00099         err(buff);
00100 }
00101 
00102  void
00103 #ifdef KR_headers
00104 errl(s, t)
00105         char *s;
00106         long t;
00107 #else
00108 errl(char *s, long t)
00109 #endif
00110 {
00111         char buff[100];
00112         sprintf(buff, s, t);
00113         err(buff);
00114 }
00115 
00116  char *err_proc = 0;
00117 
00118  void
00119 #ifdef KR_headers
00120 err(s)
00121         char *s;
00122 #else
00123 err(char *s)
00124 #endif
00125 {
00126         if (err_proc)
00127                 fprintf(diagfile,
00128                         "Error processing %s before line %ld",
00129                         err_proc, lineno);
00130         else
00131                 fprintf(diagfile, "Error on line %ld", lineno);
00132         if (infname && *infname)
00133                 fprintf(diagfile, " of %s", infname);
00134         fprintf(diagfile, ": %s\n", s);
00135         fflush(diagfile);
00136         ++nerr;
00137 }
00138 
00139  void
00140 #ifdef KR_headers
00141 yyerror(s)
00142         char *s;
00143 #else
00144 yyerror(char *s)
00145 #endif
00146 {
00147         err(s);
00148 }
00149 
00150 
00151  void
00152 #ifdef KR_headers
00153 dclerr(s, v)
00154         char *s;
00155         Namep v;
00156 #else
00157 dclerr(char *s, Namep v)
00158 #endif
00159 {
00160         char buff[100];
00161 
00162         if(v)
00163         {
00164                 sprintf(buff, "Declaration error for %s: %s", v->fvarname, s);
00165                 err(buff);
00166         }
00167         else
00168                 errstr("Declaration error %s", s);
00169 }
00170 
00171 
00172  void
00173 #ifdef KR_headers
00174 execerr(s, n)
00175         char *s;
00176         char *n;
00177 #else
00178 execerr(char *s, char *n)
00179 #endif
00180 {
00181         char buf1[100], buf2[100];
00182 
00183         sprintf(buf1, "Execution error %s", s);
00184         sprintf(buf2, buf1, n);
00185         err(buf2);
00186 }
00187 
00188 
00189  void
00190 #ifdef KR_headers
00191 Fatal(t)
00192         char *t;
00193 #else
00194 Fatal(char *t)
00195 #endif
00196 {
00197         fprintf(diagfile, "Compiler error line %ld", lineno);
00198         if (infname)
00199                 fprintf(diagfile, " of %s", infname);
00200         fprintf(diagfile, ": %s\n", t);
00201         done(3);
00202 }
00203 
00204 
00205 
00206  void
00207 #ifdef KR_headers
00208 fatalstr(t, s)
00209         char *t;
00210         char *s;
00211 #else
00212 fatalstr(char *t, char *s)
00213 #endif
00214 {
00215         char buff[100];
00216         sprintf(buff, t, s);
00217         Fatal(buff);
00218 }
00219 
00220 
00221  void
00222 #ifdef KR_headers
00223 fatali(t, d)
00224         char *t;
00225         int d;
00226 #else
00227 fatali(char *t, int d)
00228 #endif
00229 {
00230         char buff[100];
00231         sprintf(buff, t, d);
00232         Fatal(buff);
00233 }
00234 
00235 
00236  void
00237 #ifdef KR_headers
00238 badthing(thing, r, t)
00239         char *thing;
00240         char *r;
00241         int t;
00242 #else
00243 badthing(char *thing, char *r, int t)
00244 #endif
00245 {
00246         char buff[50];
00247         sprintf(buff, "Impossible %s %d in routine %s", thing, t, r);
00248         Fatal(buff);
00249 }
00250 
00251 
00252  void
00253 #ifdef KR_headers
00254 badop(r, t)
00255         char *r;
00256         int t;
00257 #else
00258 badop(char *r, int t)
00259 #endif
00260 {
00261         badthing("opcode", r, t);
00262 }
00263 
00264 
00265  void
00266 #ifdef KR_headers
00267 badtag(r, t)
00268         char *r;
00269         int t;
00270 #else
00271 badtag(char *r, int t)
00272 #endif
00273 {
00274         badthing("tag", r, t);
00275 }
00276 
00277 
00278 
00279 
00280  void
00281 #ifdef KR_headers
00282 badstg(r, t)
00283         char *r;
00284         int t;
00285 #else
00286 badstg(char *r, int t)
00287 #endif
00288 {
00289         badthing("storage class", r, t);
00290 }
00291 
00292 
00293 
00294  void
00295 #ifdef KR_headers
00296 badtype(r, t)
00297         char *r;
00298         int t;
00299 #else
00300 badtype(char *r, int t)
00301 #endif
00302 {
00303         badthing("type", r, t);
00304 }
00305 
00306  void
00307 #ifdef KR_headers
00308 many(s, c, n)
00309         char *s;
00310         char c;
00311         int n;
00312 #else
00313 many(char *s, char c, int n)
00314 #endif
00315 {
00316         char buff[250];
00317 
00318         sprintf(buff,
00319             "Too many %s.\nTable limit now %d.\nTry rerunning with the -N%c%d option.\n",
00320             s, n, c, 2*n);
00321         Fatal(buff);
00322 }
00323 
00324  void
00325 #ifdef KR_headers
00326 err66(s)
00327         char *s;
00328 #else
00329 err66(char *s)
00330 #endif
00331 {
00332         errstr("Fortran 77 feature used: %s", s);
00333         --nerr;
00334 }
00335 
00336 
00337  void
00338 #ifdef KR_headers
00339 errext(s)
00340         char *s;
00341 #else
00342 errext(char *s)
00343 #endif
00344 {
00345         errstr("f2c extension used: %s", s);
00346         --nerr;
00347 }
 

Powered by Plone

This site conforms to the following standards: