From 8fc6888d2599bb288f8ff7008994f2b66ecf6d93 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 28 Apr 2000 14:14:16 +0000 Subject: [PATCH] r6: *** empty log message *** --- include/Makefile.am | 2 +- include/ascii.h | 139 ++++++---- include/cio.h | 23 ++ include/ct.h | 167 ++++++----- include/ezplot.h | 23 ++ include/getargs.h | 25 -- include/ir.h | 27 ++ include/keyboard.h | 181 ++++++------ include/kmath.h | 23 ++ include/kstddef.h | 24 +- include/pol.h | 23 ++ include/sdf.h | 659 +++++++++++++++++++++++--------------------- include/sgp.h | 30 +- 13 files changed, 782 insertions(+), 564 deletions(-) delete mode 100644 include/getargs.h diff --git a/include/Makefile.am b/include/Makefile.am index 60b9d32..d821d3a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1 +1 @@ -noinst_HEADERS=ascii.h cio.h ct.h ezplot.h getargs.h ir.h keyboard.h kmath.h kstddef.h pol.h sdf.h sgp.h +noinst_HEADERS=ascii.h cio.h ct.h ezplot.h ir.h keyboard.h kmath.h kstddef.h pol.h sdf.h sgp.h diff --git a/include/ascii.h b/include/ascii.h index 44c6b55..f74fe1c 100644 --- a/include/ascii.h +++ b/include/ascii.h @@ -1,58 +1,81 @@ -/****************************************************************************** - * - * FILE IDENTIFICATION - * - * File Name: ASCII.H - * Author: Kevin Rosenberg - * Purpose: Header file with definitions for ASCII characrers - * Date Started: Jan 84 - * - * DESCRIPTION - * Header file contains values for ASCII characters - * - * MODIFICATION LOG - * - *****************************************************************************/ - -#ifndef ASCII_H -#define ASCII_H - -#define BACKSPACE 8 -#define LF 0x0A -#define CR 0x0D -#define BELL 0x07 - -#define SQUOTE '\'' -#define DQUOTE '\"' -#define BSLASH '\\' -#define BACKSLASH '\\' -#define SHARP '#' -#define SLASH '/' -#define ASTERICK '*' -#define COLON ':' -#define LBRACE '{' -#define RBRACE '}' -#define LPAREN '(' -#define RPAREN ')' -#define LBRACK '[' -#define RBRACK ']' -#define LANBRACK '<' -#define RANBRACK '>' -#define SEMICOL ';' -#define UNDERLIN '_' -#define COMMA ',' -#define CARET '^' -#define TILDE '~' -#define ATSIGN '@' -#define AMPERSAND '&' -#define EXCLAM '!' -#define DOLLAR '$' -#define PERCENT '%' -#define PLUS '+' -#define HYPHEN '-' -#define EQUALS '=' -#define QUESTION '?' -#define PERIOD '.' -#define VERTBAR '|' - -#endif /* #ifndef ASCII_H */ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: ascii.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: ascii.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ +/****************************************************************************** + * + * FILE IDENTIFICATION + * + * File Name: ASCII.H + * Author: Kevin Rosenberg + * Purpose: Header file with definitions for ASCII characrers + * Date Started: Jan 84 + * + * DESCRIPTION + * Header file contains values for ASCII characters + * + * MODIFICATION LOG + * + *****************************************************************************/ + +#ifndef ASCII_H +#define ASCII_H + +#define BACKSPACE 8 +#define LF 0x0A +#define CR 0x0D +#define BELL 0x07 + +#define SQUOTE '\'' +#define DQUOTE '\"' +#define BSLASH '\\' +#define BACKSLASH '\\' +#define SHARP '#' +#define SLASH '/' +#define ASTERICK '*' +#define COLON ':' +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' +#define LANBRACK '<' +#define RANBRACK '>' +#define SEMICOL ';' +#define UNDERLIN '_' +#define COMMA ',' +#define CARET '^' +#define TILDE '~' +#define ATSIGN '@' +#define AMPERSAND '&' +#define EXCLAM '!' +#define DOLLAR '$' +#define PERCENT '%' +#define PLUS '+' +#define HYPHEN '-' +#define EQUALS '=' +#define QUESTION '?' +#define PERIOD '.' +#define VERTBAR '|' + +#endif /* #ifndef ASCII_H */ diff --git a/include/cio.h b/include/cio.h index afc0444..9229fc0 100644 --- a/include/cio.h +++ b/include/cio.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: cio.h,v 1.3 2000/04/28 14:14:16 kevin Exp $ +** $Log: cio.h,v $ +** Revision 1.3 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ #ifndef __CIO_H #define __CIO_H diff --git a/include/ct.h b/include/ct.h index 0ad813e..e7f29e9 100644 --- a/include/ct.h +++ b/include/ct.h @@ -1,75 +1,92 @@ -/*---------------------------------------------------------------------*/ -/* HEADER FILE FOR TOMOGRAPY SYSTEM */ -/*---------------------------------------------------------------------*/ - -#ifndef CT_H -#define CT_H - -#ifdef HAVE_CONFIG_H -#include -#endif -#ifdef HAVE_PNG -#include "png.h" -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDDEF_H -#include -#endif -#include -#ifdef HAVE_STDARG_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_CTYPE_H -#include -#endif -#ifdef HAVE_MATH_H -#include -#endif -#ifdef HAVE_SYS_FCNTL_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG) -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SETJMP_H -#include -#endif - -#ifdef MPI_CT -#include "mpi.h" -#endif - -#include "kstddef.h" -#include "kmath.h" -#include "sgp.h" -#include "sdf.h" -#include "ir.h" -#include "getargs.h" -#include "keyboard.h" -#include "cio.h" -#include "ezplot.h" - -#ifndef basename -extern char *basename (__const char *__filename); -#endif - - -#endif - +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: ct.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: ct.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ +/*---------------------------------------------------------------------*/ +/* HEADER FILE FOR TOMOGRAPY SYSTEM */ +/*---------------------------------------------------------------------*/ + +#ifndef CT_H +#define CT_H + +#ifdef HAVE_CONFIG_H +#include +#endif +#ifdef HAVE_PNG +#include "png.h" +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STDDEF_H +#include +#endif +#include +#ifdef HAVE_STDARG_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_CTYPE_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif +#ifdef HAVE_SYS_FCNTL_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG) +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SETJMP_H +#include +#endif + +#ifdef MPI_CT +#include "mpi.h" +#endif + +#include "kstddef.h" +#include "kmath.h" +#include "sgp.h" +#include "sdf.h" +#include "ir.h" +#include "keyboard.h" +#include "cio.h" +#include "ezplot.h" + +#endif + diff --git a/include/ezplot.h b/include/ezplot.h index c5838c0..26a4c34 100644 --- a/include/ezplot.h +++ b/include/ezplot.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: ezplot.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: ezplot.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /*----------------------------------------------------------------------*/ /* EZPLOT */ /* */ diff --git a/include/getargs.h b/include/getargs.h deleted file mode 100644 index dd5d8a9..0000000 --- a/include/getargs.h +++ /dev/null @@ -1,25 +0,0 @@ -/* getargs.h Typedefs and defines for getargs - */ - - -#ifndef GETARGS_H -#define GETARGS_H - -#define INTEGER 0 -#define BOOLEAN 1 -#define CHARACTER 2 -#define STRING 3 -#define PROC 4 - - -typedef struct -{ - unsigned arg : 7 ; /* Command line switch */ - unsigned type : 4 ; /* variable type */ - int *variable ; /* pointer to variable */ - char *errmsg ; /* pointer to error message */ -} - ARG; - -#endif /* GETARGS_H */ - diff --git a/include/ir.h b/include/ir.h index 407b02b..3493e75 100644 --- a/include/ir.h +++ b/include/ir.h @@ -1,3 +1,30 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: ir.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: ir.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** Revision 1.1.1.1 2000/04/28 13:02:43 kevin +** Initial CVS import for first public release +** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /* FILE IDENTIFICATION * * Name: ir.h Header File for Image Reconstruction System diff --git a/include/keyboard.h b/include/keyboard.h index 8f867a9..ed40b82 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -1,79 +1,102 @@ -/****************************************************************************** - * - * FILE IDENTIFICATION - * - * File Name: KEYBOARD.H - * Author: Kevin Rosenberg - * Purpose: Header file for IBM-PC keyboard definitions - * Date Started: Jan 85 - * - * DESCRIPTION - * - * MODIFICATION LOG - * - *****************************************************************************/ - -#ifndef KEYBOARD_H -#define KEYBOARD_H - -#define KEY_BKSP 8 -#define KEY_TAB 9 -#define KEY_RETURN 13 -#define KEY_ESCAPE 27 - -#define KEY_HOME 0x4700 -#define KEY_UP 0x4800 -#define KEY_PGUP 0x4900 -#define KEY_LEFT 0x4B00 -#define KEY_CENTER 0x4C00 /* center of numeric keypad = 5 */ -#define KEY_RIGHT 0x4D00 -#define KEY_END 0x4F00 -#define KEY_DOWN 0x5000 -#define KEY_PGDOWN 0x5100 - -#define KEY_F1 0x3B00 -#define KEY_F2 0x3C00 -#define KEY_F3 0x3D00 -#define KEY_F4 0x3E00 -#define KEY_F5 0x3F00 -#define KEY_F6 0x4000 -#define KEY_F7 0x4100 -#define KEY_F8 0x4200 -#define KEY_F9 0x4300 -#define KEY_F10 0x4400 - -#define KEY_SHIFTF1 0x5400 -#define KEY_SHIFTF2 0x5500 -#define KEY_SHIFTF3 0x5600 -#define KEY_SHIFTF4 0x5700 -#define KEY_SHIFTF5 0x5800 -#define KEY_SHIFTF6 0x5900 -#define KEY_SHIFTF7 0x5A00 -#define KEY_SHIFTF8 0x5B00 -#define KEY_SHIFTF9 0x5C00 -#define KEY_SHIFTF10 0x5D00 - -#define KEY_CTRLF1 0x5E00 -#define KEY_CTRLF2 0x5F00 -#define KEY_CTRLF3 0x6000 -#define KEY_CTRLF4 0x6100 -#define KEY_CTRLF5 0x6200 -#define KEY_CTRLF6 0x6300 -#define KEY_CTRLF7 0x6400 -#define KEY_CTRLF8 0x6500 -#define KEY_CTRLF9 0x6600 -#define KEY_CTRLF10 0x6700 - -#define KEY_ALTF1 0x6800 -#define KEY_ALTF2 0x6900 -#define KEY_ALTF3 0x6A00 -#define KEY_ALTF4 0x6B00 -#define KEY_ALTF5 0x6C00 -#define KEY_ALTF6 0x6D00 -#define KEY_ALTF7 0x6E00 -#define KEY_ALTF8 0x6F00 -#define KEY_ALTF9 0x7000 -#define KEY_ALTF10 0x7100 - - -#endif /* #ifndef KEYBOARD_H */ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: keyboard.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: keyboard.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ +/****************************************************************************** + * + * FILE IDENTIFICATION + * + * File Name: KEYBOARD.H + * Author: Kevin Rosenberg + * Purpose: Header file for IBM-PC keyboard definitions + * Date Started: Jan 85 + * + * DESCRIPTION + * + * MODIFICATION LOG + * + *****************************************************************************/ + +#ifndef KEYBOARD_H +#define KEYBOARD_H + +#define KEY_BKSP 8 +#define KEY_TAB 9 +#define KEY_RETURN 13 +#define KEY_ESCAPE 27 + +#define KEY_HOME 0x4700 +#define KEY_UP 0x4800 +#define KEY_PGUP 0x4900 +#define KEY_LEFT 0x4B00 +#define KEY_CENTER 0x4C00 /* center of numeric keypad = 5 */ +#define KEY_RIGHT 0x4D00 +#define KEY_END 0x4F00 +#define KEY_DOWN 0x5000 +#define KEY_PGDOWN 0x5100 + +#define KEY_F1 0x3B00 +#define KEY_F2 0x3C00 +#define KEY_F3 0x3D00 +#define KEY_F4 0x3E00 +#define KEY_F5 0x3F00 +#define KEY_F6 0x4000 +#define KEY_F7 0x4100 +#define KEY_F8 0x4200 +#define KEY_F9 0x4300 +#define KEY_F10 0x4400 + +#define KEY_SHIFTF1 0x5400 +#define KEY_SHIFTF2 0x5500 +#define KEY_SHIFTF3 0x5600 +#define KEY_SHIFTF4 0x5700 +#define KEY_SHIFTF5 0x5800 +#define KEY_SHIFTF6 0x5900 +#define KEY_SHIFTF7 0x5A00 +#define KEY_SHIFTF8 0x5B00 +#define KEY_SHIFTF9 0x5C00 +#define KEY_SHIFTF10 0x5D00 + +#define KEY_CTRLF1 0x5E00 +#define KEY_CTRLF2 0x5F00 +#define KEY_CTRLF3 0x6000 +#define KEY_CTRLF4 0x6100 +#define KEY_CTRLF5 0x6200 +#define KEY_CTRLF6 0x6300 +#define KEY_CTRLF7 0x6400 +#define KEY_CTRLF8 0x6500 +#define KEY_CTRLF9 0x6600 +#define KEY_CTRLF10 0x6700 + +#define KEY_ALTF1 0x6800 +#define KEY_ALTF2 0x6900 +#define KEY_ALTF3 0x6A00 +#define KEY_ALTF4 0x6B00 +#define KEY_ALTF5 0x6C00 +#define KEY_ALTF6 0x6D00 +#define KEY_ALTF7 0x6E00 +#define KEY_ALTF8 0x6F00 +#define KEY_ALTF9 0x7000 +#define KEY_ALTF10 0x7100 + + +#endif /* #ifndef KEYBOARD_H */ diff --git a/include/kmath.h b/include/kmath.h index a95c3c3..b7cc5fe 100644 --- a/include/kmath.h +++ b/include/kmath.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: kmath.h,v 1.3 2000/04/28 14:14:16 kevin Exp $ +** $Log: kmath.h,v $ +** Revision 1.3 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /****************************************************************************** * * FILE IDENTIFICATION diff --git a/include/kstddef.h b/include/kstddef.h index 0d052f0..edb6509 100644 --- a/include/kstddef.h +++ b/include/kstddef.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: kstddef.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: kstddef.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /****************************************************************************** * * FILE IDENTIFICATION @@ -21,7 +44,6 @@ #include #include #include -#include "getargs.h" #undef SHELL diff --git a/include/pol.h b/include/pol.h index 42afdad..b7a484b 100644 --- a/include/pol.h +++ b/include/pol.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: pol.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: pol.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ #ifndef __H_POL #define __H_POL diff --git a/include/sdf.h b/include/sdf.h index e22efe3..be1c793 100644 --- a/include/sdf.h +++ b/include/sdf.h @@ -1,318 +1,341 @@ -/* FILE IDENTIFICATION - * - * Name: sdf.h Header file for Standard Data FIle system - * Programmer: Kevin Rosenberg - * Date Started: 9-18-84 - * Last Change: 12-24-84 - */ - -#ifndef __H_SDF -#define __H_SDF - -#include "kmath.h" - - -/*----------------*/ -/* SYSTEM ALIASES */ -/*----------------*/ - -#define SDF_VERSION 2 -#define SDF_ID_STR "SDF" - -/*------------------*/ -/* DEFINITION BLOCK */ -/*------------------*/ - -/* fixed system constants */ - -#define BLK_SIZE 256 /* Size of a header block */ -#define NUM_DIRBLK 1 /* number of directory blocks */ - -/* block types */ - -#define BT_EMPTY 0 /* Not being used */ -#define BT_DIRECTORY 1 /* First blocks in file */ -#define BT_LABEL 2 /* Label block */ - -/* label types */ - -#define LT_EMPTY 0 /* label record is available for use */ -#define LT_TITLE 1 /* descriptive label given by user */ -#define LT_HISTORY 2 /* history label generated by application */ - /* program */ -#define LT_NOTE 3 /* A note created with a label editor */ - -/* codes for open_sdf and create_sdf */ - -#define SDF_RDONLY 0 -#define SDF_WRONLY 1 -#define SDF_RDWR 2 - -/* function return codes */ - -#define SDF_ERROR ERROR -#define SDF_2D_ERROR SDF_ERROR -#define SDF_OK OK - -/* types of sdf file, this area is EXPANDABLE */ - -#define SDF_FTYPE_2D 10 /* Two-dimensional data file */ - - -/* BLOCK IDENTIFICATION - * - * Name: Directory Header Block - * Size: Multiple of BLK_SIZE - * - * DESCRIPTION - * This is the first block of a sdf file. It contains information on the - * size of the users' data plus the number and type of header blocks. - */ - -struct dir_blk_st { - int block_type; /* required at the beginning of every block */ - /* to identify type of block */ - - char id_str[4]; /* identification string == SDF_ID_STR */ - int sdf_version; /* which version of sdf system == SDF_VERSION */ - - int blk_size; /* size of a header block in bytes */ - - int df_type; /* type of data file, used as identification */ - /* by application programs */ - - unsigned int num_dirblk; /* number of directory header blocks */ - /* currently, only 1 block long */ - -/* label directory */ - - unsigned int start_label; /* starting position of label header blocks */ - unsigned int num_label; /* number of label header blocks */ - -/* data header info */ - - unsigned int start_dhead; /* block number of the start of the users' */ - /* data header blocks */ - unsigned int num_dhead; /* number of data header blocks */ - unsigned int dhead_len; /* length of data header in bytes */ - -/* data record info */ - - unsigned int start_drec; /* block number of start of data records */ - unsigned int num_drec; /* number of of user data records */ - unsigned int drec_size; /* size of users' record */ - int num_dval; /* number of values in each data record */ - int dval_size; /* size of data value in bytes */ - /* NOTE: drec_size = dval_size * num_dval */ -}; - - -/* BLOCK IDENTIFICATION - * - * Name: Label block - * Size: BLK_SIZE - * - * DESCRIPTION - * This block contains both user and history labels. Labels are alpha- - * numeric. History labels include time & date stamp plus calculation time. - */ - -#define LABEL_LEN 159 /* size of alphanumeric label */ -#define LABELS_PER_BLOCK 1 - /* number of labels in each block */ - -struct label_blk_st { - int block_type; /* required at the beginning of every block */ - int label_type; /* type of label */ - char label_str[LABEL_LEN+1];/* alpha numeric label */ - -/* history label time stamping */ - - TIMEDATE timedate; /* time and date of operation */ - float calc_time; /* calculation time in seconds */ -}; - - -/* BLOCK IDENTIFICATION - * - * Name: Data Header Block - * Size: Variable, but always integer multiple of BLK_SIZE - * - * DESCRIPTION - * This block hold information entirely specific to the data in the sdf - * file, such as the user coordinates of the extent of an image, or the - * the rotation increment of raysum data. When an application program - * reads or writes the data header, it passes the size in bytes of the - * data header to be read or written. If the length of a data header - * being read doesn't match the length of the data header in the file, - * the header is still read, but a WARNING message is given. - */ - - - -/* STRUCTURE IDENTIFICATION - * - * Name: Data File Structure Contains all information on open files - * - * DESCRIPTION - * This structure is generated by open_file() and create_file(), it is - * passed to all subroutines of the sdf system. - */ - -struct sdfile_st { - bool open; /* if file is open or not */ - int mode; /* read-write mode */ - int fd; /* file descriptor gotten from C library */ - bool error; /* TRUE if error occurred, all further */ - /* procesing is stopped */ - bool error_report; /* Error reporting flag */ - - unsigned int blk_size; /* size of a header block */ - unsigned int num_dirblk; /* number of directory header blocks */ - char fname[MAXFULLNAME+1]; /* operating system filename */ - - int df_type; /* identification type of data file */ - -/* variables that are used when writing to a file, they define what parts - * of the file have been written - */ - - struct wrt { - unsigned dir : 1; /* 1 if directory header has been written */ - unsigned label : 1; /* 1 if labels have been written */ - unsigned dhead : 1; /* 1 if data header has been written */ - unsigned drec : 1; /* 1 when data records have been written */ - } written; - -/* Directory information to have about the file */ - - unsigned int start_label; /* starting position of labels */ - unsigned int num_label; /* number of labels in file */ - - unsigned int dhead_len; /* length of data header in bytes */ - - unsigned int num_drec; /* number of data records */ - unsigned int drec_size; /* size of data records in bytes */ - int num_dval; /* number of values in each data record */ - int dval_size; /* size of data value in bytes */ - /* NOTE: drec_size = dval_size * num_dval */ - -/* ffset pointers into sdf file */ - - long int pos_dhead; /* starting position of data header */ - long int pos_drec; /* starting position of users' data */ -}; - - -union sdf_blk_un { - char buf[BLK_SIZE]; - struct dir_blk_st dir; - struct label_blk_st lab; -}; - -typedef struct dir_blk_st DIR_BLK; -typedef struct label_blk_st LABEL_BLK; -typedef struct sdfile_st SDFILE; -typedef union sdf_blk_un SDF_BLK; - - -/*----------------------------------------------------------------------*/ -/* 2-Dimensional Standard Data File Header */ -/*----------------------------------------------------------------------*/ - - -/* STRUCTURE IDENTIFICATION - * - * Name: sdf_2d_dhead_st Data header for 2d data files - * - * DESCRIPTION - * - * This structure holds the data that is stored in an image sdf file's - * data header. It contains all data needed to use 2d data records - */ - -struct sdf_2d_dhead_st { - int file_type; /* type of data making up this file */ - /* currenty, DFT_2D_IMAGE or DFT_2D_RAYSUM */ - int nx; /* number of rows */ - int ny; /* number of columns in row */ - int val_type; /* type of pixel value, eg, DT_FLOAT */ - int val_size; /* size of pixel value in bytes */ - - bool axis_ext_kwn; /* TRUE if picture extent is known */ - /* stored in xmin,xmax,ymin,ymax */ - double xmin, ymin; /* position of lower left corner of picture */ - double xmax, ymax; /* position of upper right corner of picture */ - - bool axis_incr_kwn; /* TRUE if increments are known */ - double xinc, yinc; - - bool val_ext_kwn; /* TRUE if pixel extent is known */ - double dvalmin, dvalmax;/* min & max data value for FLOAT & DOUBLE */ - long lvalmin, lvalmax; /* data extent for INT & LONG */ -}; - - -/* STRUCTURE IDENTIFICATION - * - * Name: sdf_2d_st Information about an sdf image - * - * DESCRIPTION - * - * This structure holds all the information need to access an sdf - * image. - */ - -struct sdf_2d_st { - struct sdf_2d_dhead_st dhead; /* image information that is stored in data header */ - SDFILE *dfp; /* pointer to image's standard data file */ - MTX *mtx; /* data values */ - int memory_only; /* TRUE if sdf_2d file is stored in memory only */ -}; - -typedef struct sdf_2d_dhead_st SDF_2D_DHEAD; -typedef struct sdf_2d_st SDF_2D; - -/* types of 2d data files */ - -#define SDF_2D_IMAGE 100 /* data file type is an image */ -#define SDF_2D_RAYSUM 101 /* raysum data file type */ - - -/* sdf.c */ -SDFILE *sdf_open(const char *filename, const int mode); -SDFILE *sdf_create(const char *filename, const int mode, const unsigned int num_drec, const unsigned int num_dval, const int dval_size, const int df_type); -int sdf_read_label(LABEL_BLK *lrec, const int nlab, SDFILE *dfp); -int sdf_write_label(LABEL_BLK *lrec, const int nlab, SDFILE *dfp); -int sdf_add_label(const int ltype, const char *lstr, const double calc_time, SDFILE *dfp); -int sdf_add_empty_label(SDFILE *dfp); -int sdf_copy_labels(SDFILE *dfp_to, SDFILE *dfp_from); -int sdf_read_dhead(void *dh_buf, const unsigned int dhead_len, SDFILE *dfp); -int sdf_write_dhead(const void *dh_buf, const unsigned int dhead_len, SDFILE *dfp); -int sdf_read_drec(void *drec, const int start_rec, const int num_rec, SDFILE *dfp); -int sdf_write_drec(const void *drec, const int start_rec, const int num_rec, SDFILE *dfp); -int sdf_read_dval(void *dval, const int rec, const int start_val, const int num_val, SDFILE *dfp); -int sdf_write_dval(const void *dval, const int rec, const int start_val, const int num_val, SDFILE *dfp); -int sdf_close(SDFILE *dfp); -void sdf_error_report(SDFILE *dfp, const int flag); -void sdf_error(const SDFILE *dfp, const char *str, ...); -bool sdf_check_dfp(const SDFILE *dfp, const int mode, const char *name); -void *sdf_alloc_blk(const int n, SDFILE *dfp, const char *name); -int sdf_free_blk(void *hb, SDFILE *dfp, const char *name); -/* sdf_2d.c */ -SDF_2D *sdf_2d_open(const char *fname, const int mode); -SDF_2D *sdf_2d_create(const char *fname, const int mode, const int nx, const int ny, const int val_type, const int df_type); -int sdf_2d_save(SDF_2D *imp); -int sdf_2d_restore(SDF_2D *imp); -int sdf_2d_alloc_mtx(SDF_2D *imp); -int sdf_2d_free_mtx(SDF_2D *sdf_2d); -int sdf_2d_read_row(char *row_buf, const unsigned int row, SDF_2D *imp); -int sdf_2d_write_row(const char *row_buf, const unsigned int row, SDF_2D *imp); -int sdf_2d_read_col(char *col_buf, const unsigned int col, SDF_2D *imp); -int sdf_2d_write_col(const char *col_buf, const unsigned int col, SDF_2D *imp); -int sdf_2d_close(SDF_2D *imp); -char *sdf_2d_alloc_row(const int nrow, SDF_2D *imp); -char *sdf_2d_alloc_col(const int ncol, SDF_2D *imp); -void sdf_2d_error(const SDF_2D *imp, const char *str, ...); - -#endif +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: sdf.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: sdf.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ +/* FILE IDENTIFICATION + * + * Name: sdf.h Header file for Standard Data FIle system + * Programmer: Kevin Rosenberg + * Date Started: 9-18-84 + * Last Change: 12-24-84 + */ + +#ifndef __H_SDF +#define __H_SDF + +#include "kmath.h" + + +/*----------------*/ +/* SYSTEM ALIASES */ +/*----------------*/ + +#define SDF_VERSION 2 +#define SDF_ID_STR "SDF" + +/*------------------*/ +/* DEFINITION BLOCK */ +/*------------------*/ + +/* fixed system constants */ + +#define BLK_SIZE 256 /* Size of a header block */ +#define NUM_DIRBLK 1 /* number of directory blocks */ + +/* block types */ + +#define BT_EMPTY 0 /* Not being used */ +#define BT_DIRECTORY 1 /* First blocks in file */ +#define BT_LABEL 2 /* Label block */ + +/* label types */ + +#define LT_EMPTY 0 /* label record is available for use */ +#define LT_TITLE 1 /* descriptive label given by user */ +#define LT_HISTORY 2 /* history label generated by application */ + /* program */ +#define LT_NOTE 3 /* A note created with a label editor */ + +/* codes for open_sdf and create_sdf */ + +#define SDF_RDONLY 0 +#define SDF_WRONLY 1 +#define SDF_RDWR 2 + +/* function return codes */ + +#define SDF_ERROR ERROR +#define SDF_2D_ERROR SDF_ERROR +#define SDF_OK OK + +/* types of sdf file, this area is EXPANDABLE */ + +#define SDF_FTYPE_2D 10 /* Two-dimensional data file */ + + +/* BLOCK IDENTIFICATION + * + * Name: Directory Header Block + * Size: Multiple of BLK_SIZE + * + * DESCRIPTION + * This is the first block of a sdf file. It contains information on the + * size of the users' data plus the number and type of header blocks. + */ + +struct dir_blk_st { + int block_type; /* required at the beginning of every block */ + /* to identify type of block */ + + char id_str[4]; /* identification string == SDF_ID_STR */ + int sdf_version; /* which version of sdf system == SDF_VERSION */ + + int blk_size; /* size of a header block in bytes */ + + int df_type; /* type of data file, used as identification */ + /* by application programs */ + + unsigned int num_dirblk; /* number of directory header blocks */ + /* currently, only 1 block long */ + +/* label directory */ + + unsigned int start_label; /* starting position of label header blocks */ + unsigned int num_label; /* number of label header blocks */ + +/* data header info */ + + unsigned int start_dhead; /* block number of the start of the users' */ + /* data header blocks */ + unsigned int num_dhead; /* number of data header blocks */ + unsigned int dhead_len; /* length of data header in bytes */ + +/* data record info */ + + unsigned int start_drec; /* block number of start of data records */ + unsigned int num_drec; /* number of of user data records */ + unsigned int drec_size; /* size of users' record */ + int num_dval; /* number of values in each data record */ + int dval_size; /* size of data value in bytes */ + /* NOTE: drec_size = dval_size * num_dval */ +}; + + +/* BLOCK IDENTIFICATION + * + * Name: Label block + * Size: BLK_SIZE + * + * DESCRIPTION + * This block contains both user and history labels. Labels are alpha- + * numeric. History labels include time & date stamp plus calculation time. + */ + +#define LABEL_LEN 159 /* size of alphanumeric label */ +#define LABELS_PER_BLOCK 1 + /* number of labels in each block */ + +struct label_blk_st { + int block_type; /* required at the beginning of every block */ + int label_type; /* type of label */ + char label_str[LABEL_LEN+1];/* alpha numeric label */ + +/* history label time stamping */ + + TIMEDATE timedate; /* time and date of operation */ + float calc_time; /* calculation time in seconds */ +}; + + +/* BLOCK IDENTIFICATION + * + * Name: Data Header Block + * Size: Variable, but always integer multiple of BLK_SIZE + * + * DESCRIPTION + * This block hold information entirely specific to the data in the sdf + * file, such as the user coordinates of the extent of an image, or the + * the rotation increment of raysum data. When an application program + * reads or writes the data header, it passes the size in bytes of the + * data header to be read or written. If the length of a data header + * being read doesn't match the length of the data header in the file, + * the header is still read, but a WARNING message is given. + */ + + + +/* STRUCTURE IDENTIFICATION + * + * Name: Data File Structure Contains all information on open files + * + * DESCRIPTION + * This structure is generated by open_file() and create_file(), it is + * passed to all subroutines of the sdf system. + */ + +struct sdfile_st { + bool open; /* if file is open or not */ + int mode; /* read-write mode */ + int fd; /* file descriptor gotten from C library */ + bool error; /* TRUE if error occurred, all further */ + /* procesing is stopped */ + bool error_report; /* Error reporting flag */ + + unsigned int blk_size; /* size of a header block */ + unsigned int num_dirblk; /* number of directory header blocks */ + char fname[MAXFULLNAME+1]; /* operating system filename */ + + int df_type; /* identification type of data file */ + +/* variables that are used when writing to a file, they define what parts + * of the file have been written + */ + + struct wrt { + unsigned dir : 1; /* 1 if directory header has been written */ + unsigned label : 1; /* 1 if labels have been written */ + unsigned dhead : 1; /* 1 if data header has been written */ + unsigned drec : 1; /* 1 when data records have been written */ + } written; + +/* Directory information to have about the file */ + + unsigned int start_label; /* starting position of labels */ + unsigned int num_label; /* number of labels in file */ + + unsigned int dhead_len; /* length of data header in bytes */ + + unsigned int num_drec; /* number of data records */ + unsigned int drec_size; /* size of data records in bytes */ + int num_dval; /* number of values in each data record */ + int dval_size; /* size of data value in bytes */ + /* NOTE: drec_size = dval_size * num_dval */ + +/* ffset pointers into sdf file */ + + long int pos_dhead; /* starting position of data header */ + long int pos_drec; /* starting position of users' data */ +}; + + +union sdf_blk_un { + char buf[BLK_SIZE]; + struct dir_blk_st dir; + struct label_blk_st lab; +}; + +typedef struct dir_blk_st DIR_BLK; +typedef struct label_blk_st LABEL_BLK; +typedef struct sdfile_st SDFILE; +typedef union sdf_blk_un SDF_BLK; + + +/*----------------------------------------------------------------------*/ +/* 2-Dimensional Standard Data File Header */ +/*----------------------------------------------------------------------*/ + + +/* STRUCTURE IDENTIFICATION + * + * Name: sdf_2d_dhead_st Data header for 2d data files + * + * DESCRIPTION + * + * This structure holds the data that is stored in an image sdf file's + * data header. It contains all data needed to use 2d data records + */ + +struct sdf_2d_dhead_st { + int file_type; /* type of data making up this file */ + /* currenty, DFT_2D_IMAGE or DFT_2D_RAYSUM */ + int nx; /* number of rows */ + int ny; /* number of columns in row */ + int val_type; /* type of pixel value, eg, DT_FLOAT */ + int val_size; /* size of pixel value in bytes */ + + bool axis_ext_kwn; /* TRUE if picture extent is known */ + /* stored in xmin,xmax,ymin,ymax */ + double xmin, ymin; /* position of lower left corner of picture */ + double xmax, ymax; /* position of upper right corner of picture */ + + bool axis_incr_kwn; /* TRUE if increments are known */ + double xinc, yinc; + + bool val_ext_kwn; /* TRUE if pixel extent is known */ + double dvalmin, dvalmax;/* min & max data value for FLOAT & DOUBLE */ + long lvalmin, lvalmax; /* data extent for INT & LONG */ +}; + + +/* STRUCTURE IDENTIFICATION + * + * Name: sdf_2d_st Information about an sdf image + * + * DESCRIPTION + * + * This structure holds all the information need to access an sdf + * image. + */ + +struct sdf_2d_st { + struct sdf_2d_dhead_st dhead; /* image information that is stored in data header */ + SDFILE *dfp; /* pointer to image's standard data file */ + MTX *mtx; /* data values */ + int memory_only; /* TRUE if sdf_2d file is stored in memory only */ +}; + +typedef struct sdf_2d_dhead_st SDF_2D_DHEAD; +typedef struct sdf_2d_st SDF_2D; + +/* types of 2d data files */ + +#define SDF_2D_IMAGE 100 /* data file type is an image */ +#define SDF_2D_RAYSUM 101 /* raysum data file type */ + + +/* sdf.c */ +SDFILE *sdf_open(const char *filename, const int mode); +SDFILE *sdf_create(const char *filename, const int mode, const unsigned int num_drec, const unsigned int num_dval, const int dval_size, const int df_type); +int sdf_read_label(LABEL_BLK *lrec, const int nlab, SDFILE *dfp); +int sdf_write_label(LABEL_BLK *lrec, const int nlab, SDFILE *dfp); +int sdf_add_label(const int ltype, const char *lstr, const double calc_time, SDFILE *dfp); +int sdf_add_empty_label(SDFILE *dfp); +int sdf_copy_labels(SDFILE *dfp_to, SDFILE *dfp_from); +int sdf_read_dhead(void *dh_buf, const unsigned int dhead_len, SDFILE *dfp); +int sdf_write_dhead(const void *dh_buf, const unsigned int dhead_len, SDFILE *dfp); +int sdf_read_drec(void *drec, const int start_rec, const int num_rec, SDFILE *dfp); +int sdf_write_drec(const void *drec, const int start_rec, const int num_rec, SDFILE *dfp); +int sdf_read_dval(void *dval, const int rec, const int start_val, const int num_val, SDFILE *dfp); +int sdf_write_dval(const void *dval, const int rec, const int start_val, const int num_val, SDFILE *dfp); +int sdf_close(SDFILE *dfp); +void sdf_error_report(SDFILE *dfp, const int flag); +void sdf_error(const SDFILE *dfp, const char *str, ...); +bool sdf_check_dfp(const SDFILE *dfp, const int mode, const char *name); +void *sdf_alloc_blk(const int n, SDFILE *dfp, const char *name); +int sdf_free_blk(void *hb, SDFILE *dfp, const char *name); +/* sdf_2d.c */ +SDF_2D *sdf_2d_open(const char *fname, const int mode); +SDF_2D *sdf_2d_create(const char *fname, const int mode, const int nx, const int ny, const int val_type, const int df_type); +int sdf_2d_save(SDF_2D *imp); +int sdf_2d_restore(SDF_2D *imp); +int sdf_2d_alloc_mtx(SDF_2D *imp); +int sdf_2d_free_mtx(SDF_2D *sdf_2d); +int sdf_2d_read_row(char *row_buf, const unsigned int row, SDF_2D *imp); +int sdf_2d_write_row(const char *row_buf, const unsigned int row, SDF_2D *imp); +int sdf_2d_read_col(char *col_buf, const unsigned int col, SDF_2D *imp); +int sdf_2d_write_col(const char *col_buf, const unsigned int col, SDF_2D *imp); +int sdf_2d_close(SDF_2D *imp); +char *sdf_2d_alloc_row(const int nrow, SDF_2D *imp); +char *sdf_2d_alloc_col(const int ncol, SDF_2D *imp); +void sdf_2d_error(const SDF_2D *imp, const char *str, ...); + +#endif diff --git a/include/sgp.h b/include/sgp.h index 32ac084..fe661bf 100644 --- a/include/sgp.h +++ b/include/sgp.h @@ -1,3 +1,26 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: sgp.h,v 1.2 2000/04/28 14:14:16 kevin Exp $ +** $Log: sgp.h,v $ +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /*----------------------------------------------------------------------*/ /* Standard Graphics Package Header File */ /*----------------------------------------------------------------------*/ @@ -7,13 +30,6 @@ #include "kstddef.h" -/* Write modes for CPIX_?????() routines */ - -#define CPIX_WRT 0 -#define CPIX_XOR 1 -#define CPIX_AND 2 -#define CPIX_OR 3 - /* device names */ #define CRTDEV 1 -- 2.34.1