home *** CD-ROM | disk | FTP | other *** search
- /* $Id: assert.c,v 2.1 1994/02/17 12:09:16 ppessi Exp $
- *
- * assert.c -- gracious assert with intuition style for SAS C 6
- *
- * Author: ppessi <Pekka.Pessi@hut.fi>
- *
- * This file is part of the AmiTCP/IP Network Library.
- *
- * Copyright © 1993 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
- * Helsinki University of Technology, Finland.
- *
- * Created : Thu Jun 15 01:24:12 1993 ppessi
- * Last modified: Thu Feb 17 07:09:11 1994 ppessi
- */
-
- #include <exec/types.h>
- #include <exec/libraries.h>
-
- #include <intuition/intuition.h>
- #include <assert.h>
-
- #include <proto/intuition.h>
- #include <proto/exec.h>
- #include <stdarg.h>
-
- extern __far const UBYTE _LibName[];
- extern const UBYTE *_ProgramName;
-
- __saveds void
- InMsg(const char *fmt, ...)
- {
- struct Library *IntuitionBase;
-
- IntuitionBase = OpenLibrary("intuition.library", 36);
-
- if (IntuitionBase != NULL) {
- struct EasyStruct libraryES;
-
- va_list va;
- va_start(va, fmt);
-
- libraryES.es_StructSize = sizeof(libraryES);
- libraryES.es_Flags = 0;
- libraryES.es_Title = (STRPTR)_LibName;
- libraryES.es_TextFormat = (STRPTR)fmt;
- libraryES.es_GadgetFormat = "Continue";
-
- EasyRequestArgs(NULL, &libraryES, NULL, va);
-
- CloseLibrary(IntuitionBase);
- }
-
- }
-
- __saveds void
- __assert(int not_failed, const char *assertion, const char *file, int line)
- {
- struct Library *IntuitionBase;
-
- if (not_failed) return;
-
- IntuitionBase = OpenLibrary("intuition.library", 36);
-
- if (IntuitionBase != NULL) {
- struct EasyStruct libraryES;
-
- libraryES.es_StructSize = sizeof(libraryES);
- libraryES.es_Flags = 0;
- libraryES.es_Title = (STRPTR)_ProgramName;
- libraryES.es_TextFormat =
- "Assertion \"%s\" failed at line %ld in file %s in library %s.";
- libraryES.es_GadgetFormat = "Continue";
-
- EasyRequest(NULL, &libraryES, NULL, assertion, line, file, _LibName);
-
- CloseLibrary(IntuitionBase);
- }
- }
-