00001 /* 00002 * soi_names.h ~soi/(version)/include/soi_names.h 00003 * 00004 * The programs referenced here provide naming services that act as 00005 * intermediaries between keys provided by catalog database queries 00006 * or other information and pointers to actual files. 00007 * C++ programs should include the corresponding file "soi_names.hxx". 00008 * 00009 * The functions provided implement the SOI dataset naming scheme, 00010 * described in SOI Technical Notes TN-93-104. 00011 * 00012 * Additional information is in the following man pages: 00013 * names (3) 00014 * 00015 * Responsible: Kay Leibrand KLeibrand@solar.Stanford.EDU 00016 * 00017 * Bugs: 00018 * soi_names.hxx does not exist 00019 * fitsname_noseries should become the default; naming conventions 00020 * need to be formalized 00021 * 00022 * Revision history is at the end of the file. 00023 */ 00024 00025 #ifndef SOI_NAMES_INCL 00026 /****************************************************************************/ 00027 /************************** INCLUDE STATEMENTS ****************************/ 00028 /****************************************************************************/ 00029 00030 #ifndef SOI_VERSION_INCL 00031 #include <soi_version.h> 00032 #endif 00033 00034 #include <soi_key.h> 00035 00036 /****************************************************************************/ 00037 /**************************** DEFINE STATEMENTS ***************************/ 00038 /****************************************************************************/ 00039 00040 #define SOI_NAMES_VERSION_NUM (5.0) 00041 00042 #define MAX_STRLEN 16384 00043 /* 00044 * The length of this constant controls the maximum number of dataset 00045 * numbers that can be parsed by creating a string of the form 00046 * "n0,n1,n2,..,nn". The maximum number of parseable numbers is: 00047 * 4096 8192 16384 00048 * <4 digit: 1041 00049 * 4 digit: 819 1638 3276 00050 * 5 digit: 682 1365 2730 00051 * 6 digit: 585 1170 2340 00052 */ 00053 #define DEFAULT_SN_FMT "%04d" 00054 #define DEFAULT_RECORD_RANGE "0" 00055 00056 #define SOI_NAMES_INCL 1 00057 00058 /****************************************************************************/ 00059 /******************************* TYPEDEFS *********************************/ 00060 /****************************************************************************/ 00061 00062 /****************************************************************************/ 00063 /********************* GLOBAL & EXTERN DECLARATIONS ***********************/ 00064 /****************************************************************************/ 00065 00066 /****************************************************************************/ 00067 /**************************** MACRO DEFINITIONS ***************************/ 00068 /****************************************************************************/ 00069 00070 /****************************************************************************/ 00071 /*************************** FUNCTION PROTOTYPES **************************/ 00072 /****************************************************************************/ 00073 00074 /* source file: ~CM/src/libast.d/names.c */ 00075 extern int parse_list (KEY **params, char * root); 00076 extern char *fitsname (KEY *params, char *root, int sn); 00077 extern char *fitsname_nopath (KEY *params, char *root, int sn); 00078 extern char *fitsname_noseries (KEY *params, char *root, int sn); 00079 extern char *logname (KEY *params, char *root); 00080 extern char *tlmname (KEY *params, char *root); 00081 extern char *datasetname (KEY *params, char *root); 00082 extern void str_compress (char *s); 00083 extern void str_collapse (char *s, char c); 00084 extern void int2numstr (char *numstr, char *fmt, int num); 00085 extern char *fill_template (char *template, KEY *fromlist, char *root); 00086 /* source file: ~CM/src/libast.d/parse_arg.c */ 00087 extern int parse_array (KEY **params, char *root, int type); 00088 extern int parse_numerated (char *klist, char ***names); 00089 00090 #endif 00091 00092 /* 00093 * Revision History 00094 * V 0.0 93.02.25 R Bogart created this file 00095 * V 0.1 93.04.27 K Leibrand created original function set 00096 * V 0.2 93.08 K Leibrand deleted form_basepath, 00097 * form_name, and form_fitsname; added fitsname and logname 00098 * V 0.7 93.09.10 R Bogart defined version number 00099 * 93.12.10 R Bogart added datasetname() 00100 * 94.01.25 R Bogart added declaration for 00101 * fitsname_noseries, changed all declarations (except last) 00102 * to extern 00103 * 94.02.08 Katie Scott added tlmname 00104 * V 0.8 94.02.08 K Leibrand changed VERSION_NUM 00105 * 94.08.01 K Leibrand added functions to parse data 00106 * collections 00107 * 94.08.03 K Leibrand added replicate_name function so that 00108 * non-dataname parts can be used in forming working directories 00109 * for multiple datasets, e.g. dbase; added function add_paths 00110 * to simplify directory & basename handling 00111 * 94.08.24 K Leibrand added function add_env_template 00112 * v 0.9 94.11.14 R Bogart changed VERSION_NUM 00113 * v 4.5 99.11.16 R Bogart added declaration from parse_arg 00114 * 99.12.14 R Bogart added declaration for fitsname_nopath 00115 * 00.06.17 R Bogart added declaration of parse_numerated 00116 * 01.11.13 R Bogart removed decalaration of obsolete 00117 * function parse_list_force; quadrupled value of MAX_STRLEN to 00118 * 16384; removed several declarations of functions internal 00119 * to names.c 00120 * v 5.0 04.08.05 R Bogart modified declaration of parse_numerated() 00121 */ 00122 00123 /* 00124 $Id: soi_names.h,v 1.1 2009/02/23 22:49:03 production Exp $ 00125 $Source: /home/cvsuser/cvsroot/JSOC/proj/jpe/apps/soi_names.h,v $ 00126 $Author: production $ 00127 * $Log: soi_names.h,v $ 00128 * Revision 1.1 2009/02/23 22:49:03 production 00129 * initial 00130 * 00131 * Revision 1.21 2004/08/16 16:59:35 rick 00132 * *** empty log message *** 00133 * 00134 * Revision 1.20 2004/08/16 16:59:06 rick 00135 * see above 00136 * 00137 * Revision 1.19 2001/11/13 22:41:38 rick 00138 * see above 00139 * 00140 * Revision 1.18 2001/11/13 17:31:48 rick 00141 * see above 00142 * 00143 * Revision 1.17 2001/04/11 19:07:44 rick 00144 * see above 00145 * 00146 * Revision 1.16 1999/12/14 19:36:50 rick 00147 * see above 00148 * 00149 * Revision 1.15 1999/11/18 01:00:45 rick 00150 * see above 00151 * 00152 * Revision 1.14 1999/02/12 20:34:56 kay 00153 * change collapse to str_collapse and compress to str_compress 00154 * in response to SSTR 39 00155 * 00156 * Revision 1.13 1998/07/29 22:27:27 jim 00157 * noop 00158 * 00159 * Revision 1.12 1997/04/16 21:54:27 kehcheng 00160 * added #include <soi_version.h> 00161 * 00162 * Revision 1.11 1996/07/02 22:02:57 kay 00163 * added prototype for collapse 00164 * 00165 * Revision 1.10 1996/04/01 22:44:37 kay 00166 * added externs for previously static functions in names.c 00167 * 00168 * Revision 1.9 1995/07/17 20:12:58 kay 00169 * set MAX_STRLEN to 4096 00170 * 00171 * Revision 1.8 1995/06/29 21:10:55 kay 00172 * increased MAX_STRLEN to 512 00173 * 00174 * Revision 1.7 1994/11/14 23:05:40 rick 00175 * V 0.9 00176 * 00177 * Revision 1.6 1994/08/24 20:36:10 kay 00178 * added function add_env_template 00179 * 00180 * Revision 1.5 1994/08/08 19:03:15 kay 00181 * added function add_paths to simplify directory & basename handling 00182 * 00183 * Revision 1.4 1994/08/03 20:30:26 kay 00184 * added replicate_name function so that non-dataname parts can be used in 00185 * forming working directories for multiple datasets, e.g. dbase 00186 * 00187 * Revision 1.3 1994/08/03 20:28:26 kay 00188 * added template error codes 00189 * 00190 * Revision 1.2 1994/08/01 22:32:22 kay 00191 * added functions to parse data collections 00192 * 00193 * Revision 1.1 1994/02/16 23:21:14 CM 00194 * Initial revision 00195 * 00196 */