home *** CD-ROM | disk | FTP | other *** search
- /* $Id: assert.c,v 3.2 1994/02/26 22:50:51 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: Sun Feb 27 00:50:39 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 const UBYTE _DevName[];
-
- __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)_DevName;
- libraryES.es_TextFormat = (STRPTR)fmt;
- libraryES.es_GadgetFormat = "Continue";
-
- EasyRequestArgs(NULL, &libraryES, NULL, va);
-
- CloseLibrary(IntuitionBase);
- }
-
- }
-
- #if defined(__SASC_650)
- #define CONST const
- #else
- #define CONST
- #endif
-
- __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)_DevName;
- libraryES.es_TextFormat =
- "Assertion \"%s\" failed at line %ld in file %s.";
- libraryES.es_GadgetFormat = "Continue";
-
- EasyRequest(NULL, &libraryES, NULL, assertion, line, file);
-
- CloseLibrary(IntuitionBase);
- }
- }
-