Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

mcdraw_c.c

Go to the documentation of this file.
00001 
00002 /*
00003  * Copyright (c) 1986,1987,1988,1989,1990,1991,1992,1993,
00004  * by Steve McMillan, Drexel University, Philadelphia, PA.
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms are permitted
00009  * provided that the above copyright notice and this paragraph are
00010  * duplicated in all such forms and that any documentation,
00011  * advertising materials, and other materials related to such
00012  * distribution and use acknowledge that the software was developed
00013  * by the author named above.
00014  *
00015  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00017  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00018  */
00019 
00020 /*
00021   Call FORTRAN routine mcdraw, but allocate working space first.
00022 */
00023 
00024 #include <stdio.h>
00025 
00026 mcdrawc (size, string, which, len)
00027 int *size, *which;
00028 char *string;
00029 long int len;
00030 {
00031         char *x, *y, *z, *a, *w, *malloc();
00032 
00033         if ((a = malloc(12*(*size))) == NULL) err_quit(1);
00034         x = y = z = a;
00035         y += 4*(*size);
00036         z += 8*(*size);
00037 
00038         if ((w = malloc(4)) == NULL)   err_quit(2);
00039 /*      For now, w really is only one word long. */
00040 
00041         /* FORTRAN call: */
00042 
00043 #ifdef FORTRAN_TRAILING_UNDERSCORE
00044         mcdraw_(x, y, z, a, w, size, string, which, len);
00045 #else
00046         mcdraw (x, y, z, a, w, size, string, which, len);
00047 #endif
00048 }
00049 
00050 mcdrawc_(size, string, which, len)
00051 int *size, *which;
00052 char *string;
00053 long int len;
00054 {
00055     mcdrawc(size, string, which, len);
00056 }
00057 
00058 err_quit(i)
00059 int i;
00060 {
00061         printf("Error allocating memory block #%d\n", i);
00062         exit(0);
00063 }

Generated at Sun Feb 24 09:57:09 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001