appletassert.c

Go to the documentation of this file.
00001 
00002 /*  $Id: appletassert.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #ifdef fldebug
00008     
00009     #include "applet.h"
00010     #include "appletassert.h"
00011 
00012     static void convertcstring (bigstring bs) {
00013         
00014         /*
00015         convert a c string to a pascal string.
00016         */
00017         
00018         ptrbyte p;
00019         short len = 0;
00020         
00021         p = &bs [0]; /*point at the first byte in c string*/
00022         
00023         while (*p++) len++;
00024         
00025         moveright (&bs [0], &bs [1], (long) len);
00026         
00027         bs [0] = (byte) len;
00028         } /*convertcstring*/
00029         
00030     
00031     short __assert (char *expr, char *file, short line) {
00032         
00033         bigstring bsexpr, bsfile, bsline, bsmessage;
00034         static boolean flnorentry = false;
00035         
00036         if (flnorentry)
00037             return (0);
00038         
00039         flnorentry = true;
00040         
00041         moveleft (expr, bsexpr, (long) lenbigstring);
00042         
00043         moveleft (file, bsfile, (long) lenbigstring);
00044         
00045         convertcstring (bsexpr);
00046         
00047         convertcstring (bsfile);
00048         
00049         NumToString ((long) line, bsline);
00050         
00051         copystring ("\pAssertion failed in file ", bsmessage);
00052         
00053         pushstring (bsfile, bsmessage);
00054         
00055         pushstring ("\p, at line ", bsmessage);
00056         
00057         pushstring (bsline, bsmessage);
00058         
00059         pushstring ("\p. Expression is ", bsmessage);
00060         
00061         pushstring (bsexpr, bsmessage);
00062         
00063         pushstring ("\p", bsmessage);
00064         
00065         DebugStr (bsmessage);
00066         
00067         flnorentry = false;
00068         
00069         return (0);
00070     } /*__assert*/
00071 
00072 #endif

Generated on Wed May 31 18:19:39 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6