ctn (3.0.6-13) 10_all_patches.patch

Summary

 apps/dcm_modify_object/gram.h   |   71 ++++++++++++++++++++++++++++++++++------
 facilities/dicom/Makefile       |    8 ++--
 facilities/dicom/dicom.h        |    5 +-
 facilities/objects/dcmprivate.h |    4 --
 facilities/utility/utility.c    |    4 +-
 facilities/xutl/xutl.c          |    4 +-
 libsrc/Makefile                 |    7 ++-
 libsrc/Makefile.psql            |    2 -
 8 files changed, 80 insertions(+), 25 deletions(-)

    
download this patch

Patch contents

Misc patches inherited from the monolithic .diff.gz. This includes:
- changes to the bison parser;
- detection of intsizes by Steinar Gundersson
- various changes to make it build or work with Debian 
could be split out into separate patches.

--- ctn-3.0.6.orig/apps/dcm_modify_object/gram.h
+++ ctn-3.0.6/apps/dcm_modify_object/gram.h
@@ -1,22 +1,73 @@
-#ifndef BISON_Y_TAB_H
-# define BISON_Y_TAB_H
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-#ifndef YYSTYPE
-typedef union{
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   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., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NUMBER = 258,
+     VALUE = 259
+   };
+#endif
+/* Tokens.  */
+#define NUMBER 258
+#define VALUE 259
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 25 "gram.y"
+{
 	unsigned long	num;
 	char		str[DICOM_LO_LENGTH+1];
 	char		*s;
 	DCM_ELEMENT	*e;
 	LST_HEAD	*l;
 	void		*v;
-} yystype;
-# define YYSTYPE yystype
+}
+/* Line 1489 of yacc.c.  */
+#line 66 "y.tab.h"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
 #endif
-# define	NUMBER	257
-# define	VALUE	258
-
 
 extern YYSTYPE yylval;
 
-#endif /* not BISON_Y_TAB_H */
--- ctn-3.0.6.orig/facilities/objects/dcmprivate.h
+++ ctn-3.0.6/facilities/objects/dcmprivate.h
@@ -117,11 +117,7 @@
 }   SHORT_WORD;
 
 typedef union {
-#ifdef __alpha
     unsigned int l;
-#else
-    unsigned long l;
-#endif
     unsigned char u[4];
 }   LONG_WORD;
 
--- ctn-3.0.6.orig/facilities/utility/utility.c
+++ ctn-3.0.6/facilities/utility/utility.c
@@ -912,7 +912,9 @@
   if (configFile == 0 || configFile[0] == '\0') {
     char* p = getenv("CTN_TARGET");
     if (p == NULL) {
-      return UTL_NO_CTN_TARGET;
+       /* Debian patch: Can not make operation dependent on Env var */
+       /* return UTL_NO_CTN_TARGET; */
+       p = "/etc/ctn";
     }
     UTL_configFile = (char*) malloc(strlen(p) + strlen("/runtime/ctn_cfg.txt") + 1);
     strcpy(UTL_configFile, p);
--- ctn-3.0.6.orig/facilities/xutl/xutl.c
+++ ctn-3.0.6/facilities/xutl/xutl.c
@@ -31,7 +31,9 @@
 
   c = getenv("CTN_TARGET");
   if (c == NULL)
-    c = "/opt/ctn";
+     /* Debian patch: conform to debian directory policy */
+     /* c = "/opt/ctn"; */
+     c = "/etc/ctn";
 
   sprintf(s->runtime, "%s/runtime/fontmap", c);
 }
--- ctn-3.0.6.orig/facilities/dicom/dicom.h
+++ ctn-3.0.6/facilities/dicom/dicom.h
@@ -57,6 +57,8 @@
 
 #ifdef _MSC_VER
 #include "dicom_platform.h"
+#else
+#include "intsizes.h"
 #endif
 
 #ifdef  __cplusplus
@@ -85,14 +87,13 @@
     typedef unsigned short U16;	/* unsigned, 16 bit */
     typedef short S16;		/* signed, 16 bit */
 
-#if LONGSIZE == 64 && INTSIZE == 32	/* Such as an Alpha */
+#if LONGSIZE == 64 && INTSIZE == 32    /* Such as an Alpha */
     typedef unsigned int U32;
     typedef int S32;
 
 #elif LONGSIZE == 32		/* Most 32 bit workstations */
     typedef unsigned long U32;
     typedef long S32;
-
 #else				/* Something we do not support */
 
 /* The writers of this code assume that we can find a 32 bit integer
--- ctn-3.0.6.orig/facilities/dicom/Makefile
+++ ctn-3.0.6/facilities/dicom/Makefile
@@ -8,6 +8,7 @@
 install:
 	$(INSTALLINCLUDE) ctn_os.h $(DICOM_INCLUDE)
 	$(INSTALLINCLUDE) dicom.h $(DICOM_INCLUDE)
+	$(INSTALLINCLUDE) intsizes.h $(DICOM_INCLUDE)
 	$(INSTALLINCLUDE) dicom_platform.h $(DICOM_INCLUDE)
 
 export:
@@ -19,9 +20,10 @@
 	$(INSTALLINCLUDE) dicom_platform.h $(DICOM_INCLUDE)
 links:
 	rm -f $(DICOM_LIBSRC)/dicom.h $(DICOM_LIBSRC)/dicom_platform.h $(DICOM_LIBSRC)/ctn_os.h
-	ln -s ../facilities/dicom/ctn_os.h $(DICOM_LIBSRC)
-	ln -s ../facilities/dicom/dicom.h $(DICOM_LIBSRC)
-	ln -s ../facilities/dicom/dicom_platform.h $(DICOM_LIBSRC)
+	ln -sf ../facilities/dicom/ctn_os.h $(DICOM_LIBSRC)
+	ln -sf ../facilities/dicom/dicom.h $(DICOM_LIBSRC)
+	ln -sf ../facilities/dicom/intsizes.h $(DICOM_LIBSRC)
+	ln -sf ../facilities/dicom/dicom_platform.h $(DICOM_LIBSRC)
 
 clean:
 	rm -f *.a *.o *.BAK *% core
--- ctn-3.0.6/libsrc/Makefile	2002-04-17 19:22:22.000000000 +0200
+++ ctn-3.0.6/libsrc/Makefile	2008-07-25 17:10:01.000000000 +0200
@@ -25,7 +25,7 @@
 OBJS = $(BASE_OBJS) $(TBL_DB) tblcond.o idb.o idbcond.o
 OBJS_MBCTN = $(BASE_OBJS) dicom_chr.o $(TBLMB_DB) tblmbcond.o idbmb.o idbmbcond.o xutl_mb.o
 
-BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h \
+BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h intsizes.h \
 dicom_ddr.h dicom_ie.h dicom_irs.h dicom_messages.h \
 dicom_objects.h dicom_platform.h dicom_print.h dicom_services.h \
 dicom_sq.h dicom_uids.h dulfsm.h dulprotocol.h dulsnoop.h \
@@ -34,8 +34,9 @@
 tbl_msql.h tbl_psql.h tbl_sqlserver.h tbl_sybase.h tbl_ufs.h \
 utility.h xutl.h
 
-HEADER_FILES = $(BASE_HEADER_FILES) tbl.h tbl_msql.h tbl_psql.h tbl_sqlserver.h\
-tbl_sybase.h tbl_ufs.h
+HEADER_FILES = $(BASE_HEADER_FILES) 
+# KMR -- removed these files since BASE_HEADER_FILES has them in their
+# tbl.h tbl_msql.h tbl_psql.h tbl_sqlserver.h tbl_sybase.h tbl_ufs.h
 
 HEADER_FILES_MBCTN = $(BASE_HEADER_FILES) dicom_chr.h idbmb.h tblmb.h tblmb_psql.h
 
--- ctn-3.0.6/libsrc/Makefile.psql	2002-04-17 19:22:22.000000000 +0200
+++ ctn-3.0.6/libsrc/Makefile.psql	2008-07-25 17:10:01.000000000 +0200
@@ -24,7 +24,7 @@
 OBJS = $(BASE_OBJS) tbl_psql.o tblcond.o idb.o idbcond.o
 OBJS_MBCTN = $(BASE_OBJS) dicom_chr.o tblmb_psql.o tblmbcond.o idbmb.o idbmbcond.o xutl_mb.o
 
-BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h \
+BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h intsizes.h \
 dicom_ddr.h dicom_ie.h dicom_irs.h dicom_messages.h \
 dicom_objects.h dicom_platform.h dicom_print.h dicom_services.h \
 dicom_sq.h dicom_uids.h dulfsm.h dulprotocol.h dulsnoop.h \