home *** CD-ROM | disk | FTP | other *** search
- /* Next available MSG number is 88 */
-
- /*
- ADS_PERR.C
- ¬⌐┼v (C) 1988-1992 Autodesk ñ╜Ñq
-
- Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
- ¡∞½h :
-
- 1) ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
- 2) ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
-
- Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
- Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
-
-
-
- ADS_PERR.C - ADS routine to print the error message
- associated with the value of "errno" upon failure
- of a call to AutoCAD. This routine is meant to be
- invoked by other ADS programs, and contains a table
- of the current error messages as found in ol_errno.h.
- This routine is meant to parallel the Unix
- perror() function.
-
- ads_perror() is a Lisp-callable or invokable function that
- takes an optional single argument and prints the message on
- the AutoCAD command line. The syntax is:
-
- (ads_perror "string")
-
- The string is optional; if provided, it is printed on a
- separate line before the system error message. To be of
- most use, the argument string should include the name of the
- program that incurred the error. The error number is taken
- from the system variable "errno", which is set when most
- errors occur, but not cleared when non-erroneous calls are
- made.
-
- The STANDALONE macro is obsolete. Forget it.
- */
-
- #include <stdio.h>
- #include <string.h>
- #include "adslib.h"
- #include "ol_errno.h"
-
-
- /* The error message table */
-
- char *errmsg[] = { /* ERRNO ╜X */
- /*MSG1*/"╡L«─¬║íu▓┼╕╣¬φ (symbol table)ívªW║┘íC", /* 1 */
- /*MSG2*/"╡L«─¬║ªW║┘ (íu╣╧ñ╕ív⌐╬íu┐∩╢░ív) ñ║«eíC", /* 2 */
- /*MSG3*/"╢WÑXíu┐∩╢░ívñW¡¡íC", /* 3 */
- /*MSG4*/"íu┐∩╢░ív╡L«─íC", /* 4 */
- /*MSG5*/"íu╣╧╕s⌐w╕q╣╧ñ╕ív¿╧Ñ╬ñúÑ┐╜TíC", /* 5 */
- /*MSG6*/"íuXref ╣╧ñ╕ív¿╧Ñ╬ñúÑ┐╜TíC", /* 6 */
- /*MSG7*/"¼D┐∩íu╣╧ñ╕┐∩╢░ívÑó▒╤íC", /* 7 */
- /*MSG8*/"íu╣╧ñ╕└╔«╫ív╡▓º⌠íC", /* 8 */
- /*MSG9*/"íu╣╧╕s⌐w╕q└╔«╫ív╡▓º⌠íC", /* 9 */
- /*MSG10*/"íueidlastívÑó▒╤íC", /* 10 */
- /*MSG11*/"╣∩íu╡°╡íív╢iªµ¬║íuentdelívñúªX¬kíC", /* 11 */
- /*MSG12*/"ª╣º@╖~ñúñ╣│\134ªbíu╗EªX╜uíúPLINEíñív½ⁿÑO┤┴╢í░⌡ªµíC" /* 12 */
- /*MSG13*/"íu╣╧╜Xív╡L«─íC", /* 13 */
- /*MSG14*/"íu╣╧╜XívÑ╝▒╥Ñ╬íC", /* 14 */
- /*MSG15*/"íuTRANSív¬║»┴¿D╡L«─íC", /* 15 */
- /*MSG16*/"íu¬┼╢í┬α╕mív¬║╗▌»┴╡L«─íC", /* 16 */
- /*MSG17*/"╡L«─í╨¿╧Ñ╬íuñwºR░ú¬║╣╧ñ╕ívíC" /* 17 */
- /*MSG18*/"íu¬φªW (table name)ív╡L«─íC", /* 18 */
- /*MSG19*/"íu¬φ╢╡¿τ╝╞ív¬║íuñ▐╝╞ív╡L«─íC", /* 19 */
- /*MSG20*/"╖N╣╧│]⌐wíu░▀┼¬ív┼▄╝╞íC", /* 20 */
- /*MSG21*/"íu0ív ¡╚╡L«─íC", /* 21 */
- /*MSG22*/"╝╞¡╚╢WÑX╜d│≥íC", /* 22 */
- /*MSG23*/"╢iªµ╜╞┬°¬║¡½Ñ═íC", /* 23 */
- /*MSG24*/"╖N╣╧┼▄º≤íu╣╧ñ╕├■ºOívíC", /* 24 */
- /*MSG25*/"íu╝hªWívª│╗~íC", /* 25 */
- /*MSG26*/"íu╜u½¼ªW║┘ívª│╗~íC", /* 26 */
- /*MSG27*/"íu├CªΓªW║┘ívª│╗~íC", /* 27 */
- /*MSG28*/"íuªr½¼ªW║┘ívª│╗~íC", /* 28 */
- /*MSG29*/"íuº╬¬¼ªW║┘ívª│╗~íC", /* 29 */
- /*MSG30*/"ѵÑIíu╣╧ñ╕├■ºOív¬║íu─µ╢╡ívª│╗~íC", /* 30 */
- /*MSG31*/"╖N╣╧ entmod ñwíuºR░úív¬║╣╧ñ╕íC", /* 31 */
- /*MSG32*/"╖N╣╧ entmodíuSEQENDívíC", /* 32 */
- /*MSG33*/"╖N╣╧º≤º∩íu╣╧╜XívíC", /* 33 */
- /*MSG34*/"íu╡°╡íÑi▓{│]⌐wív¬║¡╫º∩ñúªX▓zíC", /* 34 */
- /*MSG35*/"╣╧ñ╕ª∞⌐≤íu┬Ω┼@ív¬║╝hñWíC", /* 35 */
- /*MSG36*/"íu╣╧ñ╕├■ºOívª│╗~íC", /* 36 */
- /*MSG37*/"íuPLINE ╣╧ñ╕ívª│╗~íC", /* 37 */
- /*MSG38*/"íu╣╧╕sívññª│ñúº╣╛π¬║íu╜╞┬°╣╧ñ╕ívíC", /* 38 */
- /*MSG39*/"íu╣╧╕sªW║┘ív¬║íu─µ╢╡ív╡L«─íC", /* 39 */
- /*MSG40*/"íu╣╧╕s║X╝╨ív¬║íu─µ╢╡ív¡½╜╞íC", /* 40 */
- /*MSG41*/"íu╣╧╕sªW║┘ív¬║íu─µ╢╡ív¡½╜╞íC", /* 41 */
- /*MSG42*/"íu¬kªV╢qívª│╗~íC", /* 42 */
- /*MSG43*/"║|»╩íu╣╧╕sªW║┘ívíC", /* 43 */
- /*MSG44*/"║|»╩íu╣╧╕s║X╝╨ívíC", /* 44 */
- /*MSG45*/"╡L«─¬║íu░╬ªW╣╧╕sívíC", /* 45 */
- /*MSG46*/"╡L«─¬║íu╣╧╕s⌐w╕q╣╧ñ╕ívíC", /* 46 */
- /*MSG47*/"║|»╩íu⌐RÑO─µ╢╡ívíC", /* 47 */
- /*MSG48*/"╡L¬k┐δ╗{¬║íu⌐╡ª∙╕Ω«╞├■ºOívíC", /* 48 */
- /*MSG49*/"Xdata ññªΩªC¬║íu▒_▓╒ívñúÑ┐╜TíC", /* 49 */
- /*MSG50*/"íuAPPID ─µ╢╡ív¬║ª∞╕mñúÑ┐╜TíC", /* 50 */
- /*MSG51*/"╢WÑXíuXdataív«e┐nñW¡¡íC", /* 51 */
- /*MSG52*/"╣╧ñ╕┐∩╢░ª]íu¬┼ª^└│ívª╙Ñó▒╤íC", /* 52 */
- /*MSG53*/"Xdata ññíu└│Ñ╬├■╢╡ív¬║ªW║┘¡½╜╞íC", /* 53 */
- /*MSG56*/"╖N╣╧½╪Ñ▀⌐╬¡╫º∩íu╡°╡í╣╧ñ╕ívíC", /* 54 */
- /*MSG57*/"╖N╣╧½╪Ñ▀íuXrefív⌐╬íu▒q└H▓┼╕╣ívíC", /* 55 */
- /*MSG58*/"íussget ┬o┬^ívª│╗~: ¡zÑyÑ╝▓╫ñεíC", /* 56 */
- /*MSG59*/"íussget ┬o┬^ívª│╗~: ║|»╩íuñ±╕╒▓┼ívíC", /* 57 */
- /*MSG60*/"íussget ┬o┬^ívª│╗~:íuñ±╕╒▓┼ívªrªΩ╡L«─íC", /* 58 */
- /*MSG61*/"íussget ┬o┬^ívª│╗~:íu¬┼¡zÑyív⌐╬íu▒_▓╒ñúÑ┐╜TívíC", /* 59 */
- /*MSG62*/"íussget ┬o┬^ívª│╗~:íu░_⌐lí■╡▓º⌠ív¡zÑyÑ╝░t▓┼íC", /* 60 */
- /*MSG63*/"íussget ┬o┬^ívª│╗~:íuXOR/NOTív╣B║Γ▓┼¬║╝╞Ñ╪┐∙╗~íC", /* 61 */
- /*MSG64*/"íussget ┬o┬^ívª│╗~: ╢WÑXíu▒_▓╒╝h╢ÑívñW¡¡íC", /* 62 */
- /*MSG65*/"íussget ┬o┬^ívª│╗~: íu╕s╜X (group code)ív╡L«─íC", /* 63 */
- /*MSG66*/"íussget ┬o┬^ívª│╗~: íuªrªΩív┤·╕╒╡L«─íC", /* 64 */
- /*MSG67*/"íussget ┬o┬^ívª│╗~: íuªV╢qív┤·╕╒╡L«─íC", /* 65 */
- /*MSG68*/"íussget ┬o┬^ívª│╗~: íu╣Ω╝╞ív┤·╕╒╡L«─íC", /* 66 */
- /*MSG69*/"íussget ┬o┬^ívª│╗~: íu╛π╝╞ív┤·╕╒╡L«─íC", /* 67 */
- /*MSG70*/"íu╝╞ñ╞╗÷ívñú¼Oíu╝╞ª∞¬Oív", /* 68 */
- /*MSG71*/"íu╝╞ª∞¬OívÑ╝«╒Ñ┐íC", /* 69 */
- /*MSG72*/"╢╟ñ⌐ (TABLET) ¿τ╝╞¬║íuñ▐╝╞ív╡L«─íC", /* 70 */
- /*MSG73*/"╡L¿¼░≈¬║íu░O╛╨¬┼╢íív¿╤░t╕míu╡▓¬G╜w╜─░╧ívíC", /* 71 */
- /*MSG74*/"▒NíuNULL ½ⁿ╝╨ív┤ú¿╤º@¼░íuñ▐╝╞ívíC", /* 72 */
- /*MSG75*/"½ⁿ⌐w¬║íu└╔«╫ív╡L¬k╢}▒╥íC", /* 73 */
- /*MSG76*/"½ⁿ⌐w¬║íu└│Ñ╬╡{ªíívñw╕ⁿñJíC", /* 74 */
- /*MSG77*/"ñw╣F¿∞ñ╣│\134╕ⁿñJñºíuADS └│Ñ╬╡{ªíív¬║ñW¡¡íC", /* 75 */
- /*MSG78*/"½ⁿ⌐w¬║íu└│Ñ╬╡{ªíív╡L¬k░⌡ªµíC", /* 76 */
- /*MSG79*/"íuADS └│Ñ╬╡{ªíív¬⌐Ñ╗╕╣╜Xñú¼█«eíC", /* 77 */
- /*MSG80*/"íuADS └│Ñ╬╡{ªíívÑ┐ªb╣Bº@, ⌐╬¼Oíu▒_▓╒ívª╙╡L¬k¡½╖s╕ⁿñJíC", /* 78 */
- /*MSG81*/"íuADS └│Ñ╬╡{ªíív⌐┌ªµíuXUNLOADívíC", /* 79 */
- /*MSG82*/"½ⁿ⌐wñºíuADS └│Ñ╬╡{ªíív⌐|Ñ╝╕ⁿñJíC", /* 80 */
- /*MSG83*/"╡L¿¼░≈¬║íu░O╛╨¬┼╢íívÑH¿╤╕ⁿñJíuADS └│Ñ╬╡{ªíív", /* 81 */
- /*MSG84*/"íu┬α╕m»x░}ív╡L«─íC", /* 82 */
- /*MSG85*/"íu▓┼╕╣ªW║┘ív╡L«─íC", /* 83 */
- /*MSG86*/"íu▓┼╕╣╝╞¡╚ív╡L«─íC", /* 84 */
- /*MSG87*/"íu╣∩╕▄«╪ívº@Ñ╬ñº╗┌ñúñ╣│\134ª╣╣Bº@íC", /* 85 */
- };
-
- /* Local function declarations */
-
- int ads_perror _((void));
-
- #define STANDALONE 1 /* This is meant to be ads_invoked */
-
- #ifdef STANDALONE
-
- void main _((int, char **));
- int loadfuncs _((void));
-
-
- /* MAIN -- the main routine */
- void
- main(argc,argv)
- int argc;
- char *argv[];
- {
- int stat;
- short scode = RSRSLT;
-
- ads_init(argc, argv);
-
- for ( ;; ) {
-
- if ((stat = ads_link(scode)) < 0) {
- printf(/*MSG54*/"ADS_PERR: Ñ╤ ads_link() ╢╟ª^¬║ñú¿╬¬¼║A = %d\n",
- stat);
- fflush(stdout);
- exit(1);
- }
-
- scode = RSRSLT; /* default return value */
-
- /* Check for AT LEAST the following cases here */
- switch (stat) {
-
- case RQXLOAD:
- scode = loadfuncs() ? RSRSLT : -RSERR;
- break;
-
- case RQSUBR:
- ads_perror();
- break;
-
- default:
- break;
-
- }
- }
- }
-
-
- /* LOADFUNCS -- Define external functions with AutoLISP */
- static int loadfuncs()
- {
- if (!ads_defun(/*MSG0*/"ads_perror", 0))
- return FALSE;
-
- /* Although this function is never involved in some recursive call,
- we ads_regfunc it so that future implementations may do away
- with the need to go through the dispatch loop.
- */
-
- ads_regfunc(ads_perror, 0);
- return 1;
- }
-
- #endif /* STANDALONE */
-
- #ifdef STANDALONE
- static
- #endif
- int
- /*FCN*/ads_perror()
- {
- struct resbuf *argl, errval;
-
- argl = ads_getargs();
-
- if (ads_getfuncode() != 0) /* This is the ONLY function here */
- return RSRSLT;
-
- if (ads_getvar(/*MSG0*/"ERRNO", &errval) == RTERROR)
- return RSRSLT;
-
- if (errval.resval.rint < 1 || errval.resval.rint > MAX_OL_ERRNO)
- return RSRSLT;
-
- if (argl && argl->restype == RTSTR && strlen(argl->resval.rstring))
- ads_printf("%s: ", argl->resval.rstring);
-
- ads_printf("%s\n", errmsg[errval.resval.rint - 1]);
-
- ads_relrb(argl);
- ads_retvoid();
-
- return RSRSLT;
- }