Chase after that moving target known lightly as the C++ "standard".

Fixes build. Also clean up insecure-temporary-files. PKGREVISION -> 1.
This commit is contained in:
dholland 2012-12-21 10:29:46 +00:00
parent 797714c7f7
commit 1996770c3c
83 changed files with 3883 additions and 20 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.14 2012/10/25 06:55:57 asau Exp $
# $NetBSD: Makefile,v 1.15 2012/12/21 10:29:46 dholland Exp $
DISTNAME= Isearch-1.47.01
PKGNAME= isearch-1.47.01
PKGREVISION= 1
CATEGORIES= textproc databases
MASTER_SITES= # http://www.etymon.com/pub/Isearch/
@ -9,9 +10,6 @@ MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.etymon.com/Isearch/
COMMENT= Advanced text indexing and searching system
# Pointer casts are errors in C++
NOT_FOR_PLATFORM+= ${LP64PLATFORMS}
MAKE_JOBS_SAFE= no
GNU_CONFIGURE= yes

View file

@ -1,10 +1,87 @@
$NetBSD: distinfo,v 1.7 2009/07/07 22:00:07 joerg Exp $
$NetBSD: distinfo,v 1.8 2012/12/21 10:29:46 dholland Exp $
SHA1 (Isearch-1.47.01.tar.gz) = 86761d6055fdd7b954b7ac9d9fd3d0084d758e3f
RMD160 (Isearch-1.47.01.tar.gz) = 2e7f4c21d8a2d3cb194823a881ee7315f88de66c
Size (Isearch-1.47.01.tar.gz) = 484760 bytes
SHA1 (patch-aa) = 028f38a707054d6bcf92f9855e333846fc841410
SHA1 (patch-ab) = 1bdf80b2a355ac17ff090c7ae25d231bea5ab017
SHA1 (patch-ac) = 232ef20b661a9e5fd32814da256a59c7146b7b69
SHA1 (patch-Isearch-cgi_cgi-util.cxx) = 194ba07550efd7fd556577b4c21b5f2dbf89d260
SHA1 (patch-Isearch-cgi_cgi-util.hxx) = 7d0d763a067ba52b8c5ce24e0ceab282f8868c2b
SHA1 (patch-Isearch-cgi_isrch__fetch.cxx) = 2b2c8b953a33c418d9e3f0fa439714d460531a46
SHA1 (patch-Isearch-cgi_isrch__html.cxx) = f6564d892a0807f32bd124973d6c5d08833b562f
SHA1 (patch-Isearch-cgi_isrch__srch.cxx) = 66a9374edda5a5c07b1784a8a643a02fd435b6bc
SHA1 (patch-Isearch-cgi_search__form.cxx) = 3a982ba916cb18519bcca9c2bcc32c0fdd56a1a0
SHA1 (patch-aa) = 256004c217dfa107583784f7f7f1ab75280db4e1
SHA1 (patch-ab) = 2c03c3a208021d9a935c568f4062615d485aa260
SHA1 (patch-ac) = 57451c09eda372d70fae7ad7f9db8b31926e369b
SHA1 (patch-ad) = 7f53e7dfb6c5e37d2c4f6cb12e087c678d07df25
SHA1 (patch-ae) = 26baf8bfba2bfce36db6be8b3a36829f54d17381
SHA1 (patch-ae) = c74006de168ef0a653ae6a407ee8ee99b0c9f236
SHA1 (patch-doctype_anzlic.cxx) = d9ee2469a5870245238f525794bd6b4ca0f7c166
SHA1 (patch-doctype_anzmeta.cxx) = 673e181aebdd8cb1f207c04cfdd89ea040f7b418
SHA1 (patch-doctype_bibtex.cxx) = d518e9e734fbf53a65777687c01ea9e461233911
SHA1 (patch-doctype_cipc.cxx) = 6198dc5d6217bd7f65946ee0b6d2e83a2c808039
SHA1 (patch-doctype_cipp.cxx) = 0d3c3ff1761b5c3cd42f2bb3003eaa6be192ec55
SHA1 (patch-doctype_colondoc.cxx) = df8c92684211954e9eae6e00ad38f5f560c9a2e8
SHA1 (patch-doctype_colondoc.hxx) = acae0a8f03cddc98c3d0cb97a0317d2cda7bdd2b
SHA1 (patch-doctype_dif.cxx) = 9635baa6aa6c28ebf25db91d2f15fe8f55586adc
SHA1 (patch-doctype_dif.hxx) = 3c43caeac80631b45255b6d67b7a3fe2e93146a5
SHA1 (patch-doctype_doctype.cxx) = cfe9bc2ec1a18bb44780cd990f3fbebbb76c0671
SHA1 (patch-doctype_emacsinfo.cxx) = af0f35a05402cf623dd9bb17775cd1335ad52db0
SHA1 (patch-doctype_eos__guide.cxx) = 454ff6413234084d9b8a183b1be538b326ea47a5
SHA1 (patch-doctype_eos__guide.hxx) = 3f48172159a6be8bd041907875610abe4cb7f139
SHA1 (patch-doctype_fgdc.cxx) = 6c960ba0bdd31e556005478c6d3fe3911722994a
SHA1 (patch-doctype_fgdcsite.cxx) = cc24afd40e91f084c4477b486c99284124a9c97b
SHA1 (patch-doctype_filename.cxx) = 62f262c1737842884a94ec4f54197c05cf16e13a
SHA1 (patch-doctype_filmline.cxx) = 102d74cafc9bfa52cd393bbcc15242e258807e10
SHA1 (patch-doctype_filmline.hxx) = ddb88823281d9d8ee4043aaaf214f379929b4a1a
SHA1 (patch-doctype_firstline.cxx) = ab6d40b6bbca9baf2196557a2b3d5446076318dc
SHA1 (patch-doctype_ftp.cxx) = 836b88e2c21131d37e0dece5655e2d222b426191
SHA1 (patch-doctype_gils.cxx) = dd81f05bdf6c3047147a41a8cd6cdcbf167bcee8
SHA1 (patch-doctype_gilsxml.cxx) = bd165c32b316e3f585ccbb57f3cbc4180a39f9bb
SHA1 (patch-doctype_html.cxx) = 8253bb6015a61b429c224e379c52fb980f08febb
SHA1 (patch-doctype_htmltag.cxx) = 6d6691ba1e7d74a077b09c7e5428c87d7763d38e
SHA1 (patch-doctype_htmltag.hxx) = f047b303dd9a6c7001009891b1179a4e6b467304
SHA1 (patch-doctype_iafadoc.cxx) = 8c88a5401a7bcef33ac3a72d85544434cb122b60
SHA1 (patch-doctype_irlist.cxx) = 22bba1e8e8142afa64b86e9ed241feba99b852e3
SHA1 (patch-doctype_listdigest.cxx) = 24578af64bc78c0fd38ff095757ce3b30dd5e993
SHA1 (patch-doctype_maildigest.cxx) = a10f74a5c48ea5a0d64147fbe330ec424acc78f0
SHA1 (patch-doctype_mailfolder.cxx) = cc3e93cf864218f299731305965fb62881f2f129
SHA1 (patch-doctype_marcdump.cxx) = 073af4a2e9884f176032979fad79da3268daf2f1
SHA1 (patch-doctype_marcdump.hxx) = 8ed992fabd9b225c7a66c162f7c8d7410a4bdb26
SHA1 (patch-doctype_medline.cxx) = 543c9fe94d5763fe72f080c3f4a3e10ffbf0e2ab
SHA1 (patch-doctype_medline.hxx) = 0d4dc4461c9162f308d477143a600961968502df
SHA1 (patch-doctype_memodoc.cxx) = 7b45c94e0021343d488b2f10db00d8b22c7cd121
SHA1 (patch-doctype_oneline.cxx) = ef8cd7255755e0e7fb81c3f538e6c47729be2d91
SHA1 (patch-doctype_para.cxx) = 0f8fb55c32d109d06742d6d94a6d5296610a107b
SHA1 (patch-doctype_referbib.cxx) = fde08028649aef97a918df8efe4550f88f5f12d5
SHA1 (patch-doctype_referbib.hxx) = 5ca3114d0713188f1f2903d9ca5586230792c077
SHA1 (patch-doctype_sgmlnorm.cxx) = 28ca3ac7b164edb79f2c9faae03bddfa9bbffece
SHA1 (patch-doctype_sgmlnorm.hxx) = 6adce7ea9d208cd9f8edb6e69b32d302129441e7
SHA1 (patch-doctype_sgmltag.cxx) = 498bc298c51718b893f1dc7926ebca05f41472de
SHA1 (patch-doctype_simple.cxx) = 54818905429342f42f4e83f140b3a4ebefd875fd
SHA1 (patch-doctype_soif.cxx) = c3c3ed124673d64e823624476e064342ac0cd8e8
SHA1 (patch-doctype_taglist.cxx) = 7bda894aabb6e5efd38d29f3de9ce2fe594439fc
SHA1 (patch-doctype_usmarc.cxx) = 2a37a9c27af3e5f1711a70c376f3989bb8310431
SHA1 (patch-doctype_usmarc.hxx) = 879bcdc79c3aa85d80df70df96ae767160fbece8
SHA1 (patch-src_Iindex.cxx) = 7ead09182f40bb9d1fe2e93382b22ba9a80f6001
SHA1 (patch-src_common.cxx) = b894597a2f0a2de248e2bbf91f8b860211cd30f0
SHA1 (patch-src_datesearch.cxx) = e428dfa1fb20ad5750af01d5760a4c91cacd353f
SHA1 (patch-src_fc.cxx) = aac6959c20d617ff8a80d38f2a5d731a5f461d68
SHA1 (patch-src_fc.hxx) = ce584a7ab4789e9746bbb16e840a90c367508d33
SHA1 (patch-src_fct.cxx) = 438bfda7759d46e5cb56c52f30535ebd3690a802
SHA1 (patch-src_fct.hxx) = 75d867280e23ded50d1e3628aa50275fdf257769
SHA1 (patch-src_gdt.h) = aa3018b6d5abb6056e89aaba91a2fce36c590bcb
SHA1 (patch-src_infix2rpn.cxx) = 5205e3a7e3c2c6d49a55dce34d9dad8b96f3825c
SHA1 (patch-src_infix2rpn.hxx) = 2236144be22e3afe1a86d97c815a4021e9f0843c
SHA1 (patch-src_intlist.cxx) = 8e83c4484adbfa76b4637e80a9d72f55dad1d1db
SHA1 (patch-src_intlist.hxx) = 101c288c5454fca4a8b33298c339e49eec8f1588
SHA1 (patch-src_irset.cxx) = 819f0487aa64775642631bda15f5e9b9685bca98
SHA1 (patch-src_marc.cxx) = ef2205b3dcbdf260fd30f4ef3e5ef973c69a523f
SHA1 (patch-src_marclib.cxx) = e31a2badf8a6a312d545bccc51fda147ffe0095f
SHA1 (patch-src_marclib.hxx) = 1892ae63295eef6f6218e53f168065b840cca282
SHA1 (patch-src_merge.cxx) = 9179913f57ea3da89d80b27fe61c4a0c0285c0ad
SHA1 (patch-src_multiterm.cxx) = 6498561a4c9e6ece4bc914c3798f47889ab65287
SHA1 (patch-src_nlist.cxx) = af5ca93215f22ca5ad5fc42f3009020721dca421
SHA1 (patch-src_registry.hxx) = 62777151312f11075ac4623250a4eefbf070b66c
SHA1 (patch-src_string.hxx) = 4872ab8372289bce4ed198e1f16b87c67f5fb3c7
SHA1 (patch-src_sw.hxx) = cc059fa62a6ad0b68ce027326641cfc0838b51f6
SHA1 (patch-src_zpresent.cxx) = 5dc2ced31cc8ee1763fe1e40bcedeca440230f70
SHA1 (patch-src_zsearch.cxx) = 7f83160213aae55c84bcb2d752ae34ad202a9e5b

View file

@ -0,0 +1,49 @@
$NetBSD: patch-Isearch-cgi_cgi-util.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- Isearch-cgi/cgi-util.cxx~ 1998-05-12 16:48:05.000000000 +0000
+++ Isearch-cgi/cgi-util.cxx
@@ -61,7 +61,7 @@ void CGIAPP::GetInput() {
CHR *meth, *p, *query=(CHR*)NULL;
if ((meth = (char *)getenv("REQUEST_METHOD"))==NULL) {
- cout << "Unable to get request_method" << endl;
+ std::cout << "Unable to get request_method" << std::endl;
exit(1);
}
if (!strcmp(meth,"POST")) {
@@ -73,10 +73,10 @@ void CGIAPP::GetInput() {
query = (char *)getenv("QUERY_STRING");
Method=GET;
} else {
- cout << "This program is to be referenced with a METHOD of POST or GET.\n";
- cout << "If you don't understand this, see this ";
- cout << "<A HREF=\"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/";
- cout << "Docs/fill-out-forms/overview.html\">forms overview</A>" << endl;
+ std::cout << "This program is to be referenced with a METHOD of POST or GET.\n";
+ std::cout << "If you don't understand this, see this ";
+ std::cout << "<A HREF=\"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/";
+ std::cout << "Docs/fill-out-forms/overview.html\">forms overview</A>" << std::endl;
exit (1);
}
}
@@ -84,7 +84,7 @@ void CGIAPP::GetInput() {
if (Method==POST) {
entry_count=0;
for (x = 0; ContentLen>0; x++) {
- cin.getline(temp1,ContentLen+1,'&');
+ std::cin.getline(temp1,ContentLen+1,'&');
entry_count++;
len=strlen(temp1);
ContentLen=ContentLen-(len+1);
@@ -184,7 +184,7 @@ CGIAPP::CGIAPP() {
void CGIAPP::Display() {
INT x;
for (x=0;x<entry_count;x++) {
- cout << name[x] << " = " << value[x] << "<br>\n";
+ std::cout << name[x] << " = " << value[x] << "<br>\n";
}
}

View file

@ -0,0 +1,20 @@
$NetBSD: patch-Isearch-cgi_cgi-util.hxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- Isearch-cgi/cgi-util.hxx~ 1998-05-12 16:48:06.000000000 +0000
+++ Isearch-cgi/cgi-util.hxx
@@ -47,9 +47,9 @@ Authors: Kevin Gamiel, kgamiel@cn
#define _CGIUTIL_HXX
#include "gdt.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdio>
+#include <cstdlib>
+#include <iostream>
#define CGI_MAXENTRIES 100
#define POST 0

View file

@ -0,0 +1,34 @@
$NetBSD: patch-Isearch-cgi_isrch__fetch.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- Isearch-cgi/isrch_fetch.cxx~ 2000-02-04 22:52:25.000000000 +0000
+++ Isearch-cgi/isrch_fetch.cxx
@@ -43,12 +43,12 @@ Description: CGI app that searches ag
Author: Kevin Gamiel, kgamiel@cnidr.org
@@@*/
-#include <iostream.h>
-#include <stdio.h>
+#include <iostream>
+#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
-#include <string.h>
-#include <locale.h>
+#include <cstring>
+#include <clocale>
#include "gdt.h"
#include "isearch.hxx"
@@ -66,6 +66,8 @@ Author: Kevin Gamiel, kgamiel@cn
//#include "infix2rpn.hxx"
#include "config.hxx"
+using namespace std;
+
int main(int argc, char **argv)
{
STRING DBPathName, DBRootName, Record;

View file

@ -0,0 +1,50 @@
$NetBSD: patch-Isearch-cgi_isrch__html.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
--- Isearch-cgi/isrch_html.cxx~ 1998-05-18 19:22:06.000000000 +0000
+++ Isearch-cgi/isrch_html.cxx
@@ -50,18 +50,18 @@ History:
Archie Warnock, warnock@clark.net
@@@*/
-#include <iostream.h>
-#include <stdio.h>
+#include <iostream>
+#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
-#include <string.h>
+#include <cstring>
#ifdef UNIX
#include <sys/time.h>
#else
#include <time.h>
#endif
-#include <locale.h>
+#include <clocale>
#include "gdt.h"
#include "isearch.hxx"
@@ -80,6 +80,8 @@ History:
#include "config.hxx"
#include "cgi-util.hxx"
+using namespace std;
+
#define SEARCH_TYPE(n) ((n) & SEARCH_TYPE_MASK)
#define SEARCH_CLASS(n) ((n) & SEARCH_CLASS_MASK)
@@ -337,7 +339,7 @@ gettok(PCHR input)
}
PCHR
-get_field(PCHR f, INT n)
+get_field(PKCHR f, INT n)
{
PCHR bp;
PCHR field;

View file

@ -0,0 +1,50 @@
$NetBSD: patch-Isearch-cgi_isrch__srch.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
--- Isearch-cgi/isrch_srch.cxx~ 1998-05-18 19:22:06.000000000 +0000
+++ Isearch-cgi/isrch_srch.cxx
@@ -46,18 +46,18 @@ Authors: Kevin Gamiel, kgamiel@cn
Archie Warnock, warnock@clark.net
@@@*/
-#include <iostream.h>
-#include <stdio.h>
+#include <iostream>
+#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
-#include <string.h>
+#include <cstring>
#ifdef UNIX
#include <sys/time.h>
#else
#include <time.h>
#endif
-#include <locale.h>
+#include <clocale>
#include "gdt.h"
#include "isearch.hxx"
@@ -76,6 +76,8 @@ Authors: Kevin Gamiel, kgamiel@cn
#include "config.hxx"
#include "cgi-util.hxx"
+using namespace std;
+
#define SEARCH_TYPE(n) ((n) & SEARCH_TYPE_MASK)
#define SEARCH_CLASS(n) ((n) & SEARCH_CLASS_MASK)
@@ -335,7 +337,7 @@ gettok(PCHR input)
}
PCHR
-get_field(PCHR f, INT n)
+get_field(PKCHR f, INT n)
{
PCHR bp;
PCHR field;

View file

@ -0,0 +1,36 @@
$NetBSD: patch-Isearch-cgi_search__form.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- Isearch-cgi/search_form.cxx~ 2000-02-04 22:52:25.000000000 +0000
+++ Isearch-cgi/search_form.cxx
@@ -43,13 +43,13 @@ Description: CGI app that builds a se
Author: Kevin Gamiel, kgamiel@cnidr.org
@@@*/
-#include <iostream.h>
-#include <stdio.h>
+#include <iostream>
+#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
-#include <string.h>
-#include <time.h>
-#include <locale.h>
+#include <cstring>
+#include <ctime>
+#include <clocale>
#include "gdt.h"
#include "isearch.hxx"
@@ -66,6 +66,8 @@ Author: Kevin Gamiel, kgamiel@cn
//#include "infix2rpn.hxx"
#include "config.hxx"
+using namespace std;
+
#define SIMPLE 1
#define BOOLEAN 2
#define ADVANCED 3

View file

@ -1,4 +1,7 @@
$NetBSD: patch-aa,v 1.3 2009/07/07 22:00:07 joerg Exp $
$NetBSD: patch-aa,v 1.4 2012/12/21 10:29:46 dholland Exp $
Configure for pkgsrc.
DESTDIR support.
--- Makefile.orig Mon Apr 29 11:36:52 2002
+++ Makefile Mon Apr 29 11:42:53 2002

View file

@ -1,13 +1,97 @@
$NetBSD: patch-ab,v 1.1 2004/05/23 22:33:17 kristerw Exp $
$NetBSD: patch-ab,v 1.2 2012/12/21 10:29:46 dholland Exp $
--- src/string.cxx.orig 2004-05-24 00:25:54.000000000 +0200
+++ src/string.cxx 2004-05-24 00:26:37.000000000 +0200
@@ -574,7 +574,7 @@
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
Use 0, not (char)NULL.
--- src/string.cxx.orig 2000-10-31 06:22:09.000000000 +0000
+++ src/string.cxx
@@ -42,17 +42,17 @@ Description: Class STRING
Author: Nassib Nassar, nrn@cnidr.org
@@@*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fstream.h>
-#include <ctype.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <cctype>
#include <sys/stat.h>
#ifdef UNIX
#include <unistd.h>
#include <sys/types.h>
-#include <time.h>
+#include <ctime>
#endif
#include "common.hxx"
@@ -573,13 +573,13 @@ STRING::Print(PFILE FilePointer) const {
// can this be const STRING& ?
ostream& operator<<(ostream& os, const STRING& str) {
-ostream& operator<<(ostream& os, const STRING& str) {
- os.write(str.Buffer, str.Length);
+std::ostream& operator<<(std::ostream& os, const STRING& str) {
+ os.write((const char*)str.Buffer, str.Length);
return os;
}
-istream& operator>>(istream& is, STRING& str) {
+std::istream& operator>>(std::istream& is, STRING& str) {
CHR buf[256];
// is >> buf;
is.getline(buf,255);
@@ -1145,7 +1145,7 @@ STRING::XmlCleanup() {
}
*/
-char *translate[] = {
+const char *translate[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -1179,7 +1179,7 @@ STRING::XmlCleanup() {
Replace("&apos;","\'");
newstr=transcode((CHR*)Buffer, translate);
- Length = BufferSize = 0;
+ Length= BufferSize = 0;
Copy((UCHR*)newstr, strlen(newstr));
delete [] newstr;
@@ -1195,7 +1195,7 @@ STRING::XmlCleanup() {
* the buffer is 6 times the original string length
* By John HLB Tyler (Credit please?)
*/
-char *transcode (char *buffer, char **transarray)
+char *transcode (char *buffer, const char **transarray)
{
char *obuf=buffer; /* Beginning of old buffer */
char *obufscan=obuf; /* Scanning point of old buffer */
@@ -1203,7 +1203,7 @@ char *transcode (char *buffer, char **tr
char *nbuf; /* Pointer to start of new string buffer */
char *ipnt; /* Insertion point into new buffer */
char *maxipnt; /* End of new buffer */
- char *rscan; /* Pointer to a character in the replacement */
+ const char *rscan; /* Pointer to a character in the replacement */
nbuf = new char [lennbuf]; /* Pointer to start of new string buffer */
ipnt=nbuf;
@@ -1215,7 +1215,7 @@ char *transcode (char *buffer, char **tr
if (transarray[*obufscan]) {
//Yes
for (rscan=transarray[*obufscan];
- *rscan!=(char)NULL && ipnt<maxipnt;
+ *rscan!=0 && ipnt<maxipnt;
rscan++,ipnt++) {
// copy the replacement to the insertion point
*ipnt=*rscan;

View file

@ -1,8 +1,31 @@
$NetBSD: patch-ac,v 1.1 2004/05/23 22:33:17 kristerw Exp $
$NetBSD: patch-ac,v 1.2 2012/12/21 10:29:46 dholland Exp $
--- src/registry.cxx.orig 2004-05-24 00:24:41.000000000 +0200
+++ src/registry.cxx 2004-05-24 00:25:10.000000000 +0200
@@ -333,7 +333,7 @@
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
(don't know what the deal with REGISTRY::fprint is, XXX)
--- src/registry.cxx.orig 2000-08-21 12:55:02.000000000 +0000
+++ src/registry.cxx
@@ -40,11 +40,14 @@ Description: Class REGISTRY - Structured
Author: Nassib Nassar, nrn@cnidr.org
@@@*/
-#include <fstream.h>
-#include <stdlib.h>
+#include <fstream>
+#include <ostream>
+#include <cstdlib>
#include "registry.hxx"
+using namespace std;
+
REGISTRY::REGISTRY(const STRING& Title) {
Data = Title;
@@ -333,7 +336,7 @@ void
REGISTRY::fprint(FILE* fp, const INT level) const
#else
void

View file

@ -1,4 +1,6 @@
$NetBSD: patch-ae,v 1.1 2007/12/01 16:42:27 rillig Exp $
$NetBSD: patch-ae,v 1.2 2012/12/21 10:29:46 dholland Exp $
Remove illegal qualification.
--- src/opstack.hxx.orig 1996-12-21 00:41:10.000000000 +0000
+++ src/opstack.hxx 2007-12-01 16:38:59.000000000 +0000

View file

@ -0,0 +1,171 @@
$NetBSD: patch-doctype_anzlic.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/anzlic.cxx~ 2000-02-04 22:49:32.000000000 +0000
+++ doctype/anzlic.cxx
@@ -116,12 +116,12 @@ Original: Edward C. Zimmermann, edz@bsn.
Copyright: A/WWW Enterprises, MCNC/CNIDR and USGS/ANZLIC
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
#include "sgmlnorm.hxx"
@@ -136,11 +136,11 @@ void ANZLIC::LoadFieldTable() {
StrList.GetValue("FIELDTYPE", &FieldTypeFilename);
if (FieldTypeFilename.GetLength() == 0) {
- cout << "No fieldtype file specified. Assuming all fields are text.";
- cout << endl;
- cout << "Make sure you use the correct doctype option:" << endl;
- cout << endl;
- cout << " -o fieldtype=<filename>" << endl;
+ std::cout << "No fieldtype file specified. Assuming all fields are text.";
+ std::cout << std::endl;
+ std::cout << "Make sure you use the correct doctype option:" << std::endl;
+ std::cout << std::endl;
+ std::cout << " -o fieldtype=<filename>" << std::endl;
return;
}
@@ -151,11 +151,11 @@ void ANZLIC::LoadFieldTable() {
// Let's bring the entire file into memory
if (!fp) {
- cout << "Specified fieldtype file not found. Assuming all fields are text.";
- cout << endl;
- cout << "Make sure you use the correct doctype option:" << endl;
- cout << endl;
- cout << " -o fieldtype=<filename>" << endl;
+ std::cout << "Specified fieldtype file not found. Assuming all fields are text.";
+ std::cout << std::endl;
+ std::cout << "Make sure you use the correct doctype option:" << std::endl;
+ std::cout << std::endl;
+ std::cout << " -o fieldtype=<filename>" << std::endl;
return;
}
fseek(fp, 0L, SEEK_END);
@@ -246,7 +246,7 @@ DOUBLE ANZLIC::ParseDateSingle(const PCH
else if (Hold.IsNumber())
fVal = Hold.GetFloat();
else {
- cout << "Bad date, value=" << Buffer << endl;
+ std::cout << "Bad date, value=" << Buffer << std::endl;
fVal = -1.0;
}
return fVal;
@@ -276,7 +276,7 @@ void ANZLIC::ParseDateRange(const PCHR B
} else if (Hold.IsNumber()) {
*fStart = Hold.GetFloat();
} else {
- cout << "Bad Start date, value=" << Buffer << endl;
+ std::cout << "Bad Start date, value=" << Buffer << std::endl;
*fStart = -1.0;
}
@@ -294,7 +294,7 @@ void ANZLIC::ParseDateRange(const PCHR B
} else if (Hold.IsNumber()) {
*fEnd = Hold.GetFloat();
} else {
- cout << "Bad End Date, value=" << Buffer << endl;
+ std::cout << "Bad End Date, value=" << Buffer << std::endl;
*fEnd = 99999999;
}
@@ -344,7 +344,7 @@ void ANZLIC::ParseFields (PRECORD NewRec
PCHR *tags = parse_tags (RecBuffer, ActualLength);
if (tags == NULL) {
- cout << "Unable to parse `" << doctype << "' tags in file " << fn << "\n";
+ std::cout << "Unable to parse `" << doctype << "' tags in file " << fn << "\n";
// Clean up
delete [] RecBuffer;
return;
@@ -382,14 +382,14 @@ void ANZLIC::ParseFields (PRECORD NewRec
pTmp = (PAMD_Element)Nested.Top();
if (Tag == pTmp->get_tag()) {
pTmp = (PAMD_Element)Nested.Pop();
-// cout << "Popped " << pTmp->get_tag() << " off the stack. ";
+// std::cout << "Popped " << pTmp->get_tag() << " off the stack. ";
delete pTmp;
if (Nested.GetSize() != 0) {
pTmp = (PAMD_Element)Nested.Top();
-// cout << "Still inside " << pTmp->get_tag() << ".\n";
+// std::cout << "Still inside " << pTmp->get_tag() << ".\n";
x = FullFieldname.SearchReverse('_');
FullFieldname.EraseAfter(x-1);
-// cout << "Full fieldname is now " << FullFieldname << ".\n";
+// std::cout << "Full fieldname is now " << FullFieldname << ".\n";
}
}
} else
@@ -429,14 +429,14 @@ void ANZLIC::ParseFields (PRECORD NewRec
}
}
- PCHR unified_name = UnifiedName(*tags_ptr);
+ PKCHR unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL)
continue; // ignore these
FieldName = unified_name;
if (!(FieldName.IsPrint())) {
FieldName.MakePrintable();
- cout << "Non-ascii characters found in " << FieldName << endl;
+ std::cout << "Non-ascii characters found in " << FieldName << std::endl;
}
if (FieldName == "custom")
@@ -464,7 +464,7 @@ void ANZLIC::ParseFields (PRECORD NewRec
FullFieldname.Cat(FieldName);
if (!(FullFieldname.IsPrint())) {
FullFieldname.MakePrintable();
- cout << "Non-ascii characters found in " << FullFieldname << endl;
+ std::cout << "Non-ascii characters found in " << FullFieldname << std::endl;
}
STRING FieldType;
@@ -500,8 +500,8 @@ void ANZLIC::ParseFields (PRECORD NewRec
dfd_full.SetFieldName (FullFieldname);
dfd_full.SetFieldType (FieldType);
-// cout << "Found " << FullFieldname << " of type " << FieldType
-// << endl;
+// std::cout << "Found " << FullFieldname << " of type " << FieldType
+// << std::endl;
Db->DfdtAddEntry (dfd_full);
fc_full.SetFieldStart (val_start);
fc_full.SetFieldEnd (val_end);
@@ -522,7 +522,7 @@ void ANZLIC::ParseFields (PRECORD NewRec
} else if (p == NULL) {
#if 1
// Give some information
- cout << doctype << " Warning: \""
+ std::cout << doctype << " Warning: \""
<< fn << "\" offset " << (*tags_ptr - RecBuffer) << ": "
<< "No end tag for <" << *tags_ptr << "> found, skipping field.\n";
#endif
@@ -840,7 +840,7 @@ ANZLIC::Present (const RESULT& ResultRec
b.ReadFile(FullFilename);
} else {
- cout << "Error: presentation file not found." << endl;
+ std::cout << "Error: presentation file not found." << std::endl;
}
}
}

View file

@ -0,0 +1,73 @@
$NetBSD: patch-doctype_anzmeta.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
Fix insecure use of tempnam().
--- doctype/anzmeta.cxx~ 2000-10-11 14:02:15.000000000 +0000
+++ doctype/anzmeta.cxx
@@ -124,19 +124,21 @@ Original: Edward C. Zimmermann, edz@bsn.
Copyright: A/WWW Enterprises, MCNC/CNIDR and USGS/FGDC
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
+#include <cmath>
#include "isearch.hxx"
#include "date.hxx"
#include "sgmlnorm.hxx"
#include "anzmeta.hxx"
+using namespace std;
+
// IG 19980205 - replaced all MD_Element with ZMD_Element
//
// Record Syntaxes are now defined in Isearch/src/defs.cxx
@@ -944,7 +946,7 @@ ANZMETA::ParseFields (RECORD *NewRecord)
}
}
- CHR *unified_name = UnifiedName(*tags_ptr);
+ const CHR *unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL)
continue; // ignore these
@@ -1446,9 +1448,21 @@ ANZMETA::Present (const RESULT& ResultRe
} else {
STRING s_cmd;
//CHR* c_cmd;
- CHR *TmpName;
+ CHR TmpName[64];
+ int fd;
- TmpName = tempnam("/tmp", "mpout");
+ strcpy(TmpName, "/tmp/mpoutXXXXXX");
+ fd = mkstemp(TmpName);
+ if (fd < 0) {
+ /*
+ * Apparently failure is not an option here, so
+ * proceed in a way that at least won't be insecure.
+ */
+ strcpy(TmpName, "/dev/null");
+ }
+ else {
+ close(fd);
+ }
cout << "[ANZMETA::Present] no docs found, so build Fly cmd" << endl;

View file

@ -0,0 +1,187 @@
$NetBSD: patch-doctype_bibtex.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/bibtex.cxx~ 1998-05-12 16:48:27.000000000 +0000
+++ doctype/bibtex.cxx
@@ -8,8 +8,8 @@ Description: class BIBTEX - index docume
Author: Erik Scott, Scott Technologies, Inc.
*/
-#include <iostream.h>
-#include <ctype.h>
+#include <iostream>
+#include <cctype>
#include "isearch.hxx"
#include "bibtex.hxx"
@@ -30,7 +30,7 @@ void BIBTEX::ParseRecords(const RECORD&
PFILE fp = fopen (fn, "rb");
if (!fp)
{
- cout << "Could not access '" << fn << "'\n";
+ std::cout << "Could not access '" << fn << "'\n";
return; // File not accessed
}
@@ -51,8 +51,8 @@ void BIBTEX::ParseRecords(const RECORD&
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "BIBTEX::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
@@ -60,15 +60,15 @@ void BIBTEX::ParseRecords(const RECORD&
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "BIBTEX::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "BIBTEX::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "BIBTEX::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -77,24 +77,24 @@ void BIBTEX::ParseRecords(const RECORD&
RecBuffer = new CHR[RecLength + 2];
if(!RecBuffer) {
- cout << "BIBTEX::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "BIBTEX::ParseRecords(): Failed to fread\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to fread\n";
delete [] RecBuffer;
fclose(fp);
return;
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "BIBTEX::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -145,7 +145,7 @@ void BIBTEX::ParseFields(PRECORD NewReco
file = fn.NewCString();
fp = fopen(fn, "rb");
if (!fp) {
- cout << "BIBTEX::ParseRecords(): Failed to open file\n\t";
+ std::cout << "BIBTEX::ParseRecords(): Failed to open file\n\t";
perror(file);
return;
}
@@ -156,16 +156,16 @@ void BIBTEX::ParseFields(PRECORD NewReco
if (RecEnd == 0) {
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "BIBTEX::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "BIBTEX::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "BIBTEX::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
@@ -174,7 +174,7 @@ void BIBTEX::ParseFields(PRECORD NewReco
// Make two copies of the record in memory
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "BIBTEX::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -182,15 +182,15 @@ void BIBTEX::ParseFields(PRECORD NewReco
RecBuffer = new CHR[RecLength + 1];
if(!RecBuffer) {
- cout << "BIBTEX::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "BIBTEX::ParseRecords(): Failed to fread\n\t";
+ std::cout << "BIBTEX::ParseRecords(): Failed to fread\n\t";
perror(file);
delete [] RecBuffer;
fclose(fp);
@@ -198,9 +198,9 @@ void BIBTEX::ParseFields(PRECORD NewReco
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "BIBTEX::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -222,8 +222,8 @@ void BIBTEX::ParseFields(PRECORD NewReco
pdft = new DFT();
if(!pdft) {
- cout << "BIBTEX::ParseRecords(): Failed to allocate DFT - ";
- cout << fn << "\n";
+ std::cout << "BIBTEX::ParseRecords(): Failed to allocate DFT - ";
+ std::cout << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -261,12 +261,12 @@ void BIBTEX::ParseFields(PRECORD NewReco
}
}
if (i==ActualLength) {
- cout << "Cannot find quote mark after title.\n";
+ std::cout << "Cannot find quote mark after title.\n";
return;
}
for (i=val_start+1; (RecBuffer[i]!='"') && (i<ActualLength); i++);
if (i==ActualLength) {
- cout << "couldn't find ending quote.\n";
+ std::cout << "couldn't find ending quote.\n";
return;
}
else {

View file

@ -0,0 +1,47 @@
$NetBSD: patch-doctype_cipc.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
--- doctype/cipc.cxx~ 2000-06-16 00:53:06.000000000 +0000
+++ doctype/cipc.cxx
@@ -118,19 +118,21 @@ Original: Edward C. Zimmermann, edz@bsn.
Copyright: A/WWW Enterprises, MCNC/CNIDR and NASA
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
+#include <cmath>
#include "isearch.hxx"
#include "date.hxx"
#include "sgmlnorm.hxx"
#include "cipc.hxx"
+using namespace std;
+
extern DOUBLE GetNumericValue(const CHR* Buffer, const CHR* Tag, const CHR* eTag);
/* ------- CIPC Support --------------------------------------------- */
@@ -970,7 +972,7 @@ CIPC::ParseFields (RECORD *NewRecord)
}
}
- CHR *unified_name = UnifiedName(*tags_ptr);
+ const CHR *unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL)
continue; // ignore these

View file

@ -0,0 +1,47 @@
$NetBSD: patch-doctype_cipp.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
--- doctype/cipp.cxx~ 2000-04-01 23:37:34.000000000 +0000
+++ doctype/cipp.cxx
@@ -118,19 +118,21 @@ Original: Edward C. Zimmermann, edz@bsn.
Copyright: A/WWW Enterprises, MCNC/CNIDR and NASA
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
+#include <cmath>
#include "isearch.hxx"
#include "date.hxx"
#include "sgmlnorm.hxx"
#include "cipp.hxx"
+using namespace std;
+
extern DOUBLE GetNumericValue(const CHR* Buffer, const CHR* Tag, const CHR* eTag);
/* ------- CIPP Support --------------------------------------------- */
@@ -903,7 +905,7 @@ CIPP::ParseFields (RECORD *NewRecord)
}
}
- CHR *unified_name = UnifiedName(*tags_ptr);
+ const CHR *unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL)
continue; // ignore these

View file

@ -0,0 +1,60 @@
$NetBSD: patch-doctype_colondoc.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/colondoc.cxx~ 1998-05-12 16:48:28.000000000 +0000
+++ doctype/colondoc.cxx
@@ -116,12 +116,12 @@ Author: Edward C. Zimmermann, edz@bsn.c
Distribution: Isite modifications by A. Warnock (warnock@clark.net)
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "colondoc.hxx"
@@ -147,7 +147,7 @@ void COLONDOC::ParseRecords (const RECOR
}
-PCHR COLONDOC::UnifiedName (PCHR tag) const
+PKCHR COLONDOC::UnifiedName (PKCHR tag) const
{
return tag; // Identity
}
@@ -185,11 +185,11 @@ void COLONDOC::ParseFields (PRECORD NewR
if (tags)
{
delete tags;
- cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\"\n";
+ std::cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\"\n";
}
else
{
- cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\"\n";
+ std::cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\"\n";
}
delete [] RecBuffer;
return;
@@ -221,7 +221,7 @@ void COLONDOC::ParseFields (PRECORD NewR
if (val_len < 0) continue; // Don't bother with empty fields (J. Mandel)
// if (val_len <= 0) continue; // Don't bother with empty fields
- PCHR unified_name = UnifiedName(*tags_ptr);
+ PKCHR unified_name = UnifiedName(*tags_ptr);
#if WANT_MISC
// Throw "unclassified" into Misc
FieldName = unified_name ? unified_name: "Misc";

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_colondoc.hxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/colondoc.hxx~ 1996-07-10 18:54:08.000000000 +0000
+++ doctype/colondoc.hxx
@@ -24,7 +24,7 @@ public:
PSTRING StringBuffer);
~COLONDOC();
// hooks into the guts of the field parser
- virtual PCHR UnifiedName (PCHR tag) const; // for children to play with
+ virtual PKCHR UnifiedName (PKCHR tag) const; // for children to play with
};
typedef COLONDOC* PCOLONDOC;

View file

@ -0,0 +1,122 @@
$NetBSD: patch-doctype_dif.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/dif.cxx~ 2000-10-12 20:55:25.000000000 +0000
+++ doctype/dif.cxx
@@ -9,13 +9,13 @@ Author: Archie Warnock, warnock@clark.n
Enhancements by Ken Lambert Hughes STX 3/97
Enhancements by Chris Gokey Hughes STX 3/98
@@@*/
-#include <iostream.h>
-#include <fstream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <fstream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "glist.hxx"
#include "gstack.hxx"
@@ -76,7 +76,7 @@ char multilineGroup[NO_MULTILINE_GROUPS]
"Project_Text",
"Source_Text",
"Sensor_Text" };
-void dbg(char *s) {
+void dbg(const char *s) {
// printf("%s\n",s);
}
/* ========================= FROM FGDC doctype ========================*/
@@ -101,11 +101,11 @@ void DIF::LoadFieldTable() {
Db->GetDocTypeOptions(&StrList);
StrList.GetValue("FIELDTYPE", &FieldTypeFilename);
if (FieldTypeFilename.GetLength() == 0) {
- cout << "No fieldtype file specified. Assuming all fields are text.";
- cout << endl;
- cout << "Make sure you use the correct doctype option:" << endl;
- cout << endl;
- cout << " -o fieldtype=<filename>" << endl;
+ std::cout << "No fieldtype file specified. Assuming all fields are text.";
+ std::cout << std::endl;
+ std::cout << "Make sure you use the correct doctype option:" << std::endl;
+ std::cout << std::endl;
+ std::cout << " -o fieldtype=<filename>" << std::endl;
return;
}
STRING Field_and_Type;
@@ -114,11 +114,11 @@ void DIF::LoadFieldTable() {
PFILE fp = fopen(FieldTypeFilename, "r");
// Let's bring the entire file into memory
if (!fp) {
- cout << "Specified fieldtype file not found. Assuming all fields are text.";
- cout << endl;
- cout << "Make sure you use the correct doctype option:" << endl;
- cout << endl;
- cout << " -o fieldtype=<filename>" << endl;
+ std::cout << "Specified fieldtype file not found. Assuming all fields are text.";
+ std::cout << std::endl;
+ std::cout << "Make sure you use the correct doctype option:" << std::endl;
+ std::cout << std::endl;
+ std::cout << " -o fieldtype=<filename>" << std::endl;
return;
}
fseek(fp, 0, 2);
@@ -192,9 +192,9 @@ void DIF::ParseDate(const CHR *Buffer, D
DOUBLE DIF::ParseDateSingle(const CHR *Buffer) {
DOUBLE fVal;
STRING Hold;
- cout << "Parse Single Date:" << fVal << endl;
+ std::cout << "Parse Single Date:" << fVal << std::endl;
#ifdef DEBUG
- cout << "Parse Single Date." << endl;
+ std::cout << "Parse Single Date." << std::endl;
#endif
Hold = Buffer;
//cout << "Hold = " << Hold << "." << endl;
@@ -207,7 +207,7 @@ DOUBLE DIF::ParseDateSingle(const CHR *B
else if (Hold.IsNumber())
fVal = Hold.GetFloat();
else {
- cout << "Bad date, value=" << Buffer << endl;
+ std::cout << "Bad date, value=" << Buffer << std::endl;
fVal = -1.0;
}
if (fVal == 0) fVal = 99999999;
@@ -243,14 +243,14 @@ DIF::ParseDateRange(const CHR *Buffer, D
}
*fStart = dStart.GetValue();
} else {
- cerr << "[DIF::ParseDateRange] Didn't parse START_DATE, value="
- << Hold << endl;
+ std::cerr << "[DIF::ParseDateRange] Didn't parse START_DATE, value="
+ << Hold << std::endl;
*fStart = DATE_ERROR;
}
}
else {
- cerr << "[DIF::ParseDateRange] Didn't parse START_DATE, value="
- << Hold << endl;
+ std::cerr << "[DIF::ParseDateRange] Didn't parse START_DATE, value="
+ << Hold << std::endl;
*fStart = DATE_ERROR;
*fEnd = *fStart;
return;
@@ -795,7 +795,7 @@ void DIF::textML() {
parserError("Error: expected text or end_group");
dbg("</textML>");
}
-void DIF::parserError(char *s) { /* Parser error. */
+void DIF::parserError(const char *s) { /* Parser error. */
fprintf(stdout,"***** %s ***** \n", s);
}
/*

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_dif.hxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/dif.hxx.orig 2000-10-12 20:55:25.000000000 +0000
+++ doctype/dif.hxx
@@ -98,7 +98,7 @@ public:
void group();
void groupbody();
void textML();
- void parserError(char *);
+ void parserError(const char *);
void writeField(char *fld, long start, long stop);
/*

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_doctype.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- doctype/doctype.cxx~ 2000-02-04 22:50:08.000000000 +0000
+++ doctype/doctype.cxx
@@ -102,7 +102,7 @@ DOCTYPE::ParseWords(
(!(Db->IsStopWord(DataBuffer + Position,
DataLength - Position))) ) {
if (GpListSize >= GpLength) {
- cout << "GpListSize >= GpLength" << endl;
+ std::cout << "GpListSize >= GpLength" << std::endl;
exit(1);
}
GpBuffer[GpListSize++] = DataOffset + Position;

View file

@ -0,0 +1,180 @@
$NetBSD: patch-doctype_emacsinfo.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/emacsinfo.cxx~ 1998-02-26 01:50:23.000000000 +0000
+++ doctype/emacsinfo.cxx
@@ -6,8 +6,8 @@ Description: class EMACSINFO - index fil
Author: Erik Scott, Scott Technologies, Inc.
*/
-#include <ctype.h>
-#include <string.h> /* For strstr() in ParseRecords */
+#include <cctype>
+#include <cstring> /* For strstr() in ParseRecords */
#include "isearch.hxx"
#include "emacsinfo.hxx"
@@ -30,7 +30,7 @@ void EMACSINFO::ParseRecords(const RECOR
PFILE fp = fopen (fn, "rb");
if (!fp)
{
- cout << "Could not access '" << fn << "'\n";
+ std::cout << "Could not access '" << fn << "'\n";
return; // File not accessed
}
@@ -47,8 +47,8 @@ void EMACSINFO::ParseRecords(const RECOR
Record.SetDocumentType ( s );
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "EMACSINFO::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
@@ -56,15 +56,15 @@ void EMACSINFO::ParseRecords(const RECOR
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "EMACSINFO::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "EMACSINFO::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "EMACSINFO::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -73,24 +73,24 @@ void EMACSINFO::ParseRecords(const RECOR
RecBuffer = new CHR[RecLength + 2];
if(!RecBuffer) {
- cout << "EMACSINFO::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "EMACSINFO::ParseRecords(): Failed to fread\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to fread\n";
delete [] RecBuffer;
fclose(fp);
return;
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "EMACSINFO::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -143,7 +143,7 @@ void EMACSINFO::ParseFields(PRECORD NewR
file = fn.NewCString();
fp = fopen(fn, "rb");
if (!fp) {
- cout << "EMACSINFO::ParseRecords(): Failed to open file\n\t";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to open file\n\t";
perror(file);
return;
}
@@ -154,16 +154,16 @@ void EMACSINFO::ParseFields(PRECORD NewR
if (RecEnd == 0) {
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "EMACSINFO::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "EMACSINFO::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "EMACSINFO::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
@@ -172,7 +172,7 @@ void EMACSINFO::ParseFields(PRECORD NewR
// Make two copies of the record in memory
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "EMACSINFO::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -180,15 +180,15 @@ void EMACSINFO::ParseFields(PRECORD NewR
RecBuffer = new CHR[RecLength + 1];
if(!RecBuffer) {
- cout << "EMACSINFO::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "EMACSINFO::ParseRecords(): Failed to fread\n\t";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to fread\n\t";
perror(file);
delete [] RecBuffer;
fclose(fp);
@@ -196,9 +196,9 @@ void EMACSINFO::ParseFields(PRECORD NewR
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "EMACSINFO::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -220,8 +220,8 @@ void EMACSINFO::ParseFields(PRECORD NewR
pdft = new DFT();
if(!pdft) {
- cout << "EMACSINFO::ParseRecords(): Failed to allocate DFT - ";
- cout << fn << "\n";
+ std::cout << "EMACSINFO::ParseRecords(): Failed to allocate DFT - ";
+ std::cout << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -284,7 +284,7 @@ STRING myBuff;
ResultRecord.GetRecordData(&myBuff);
STRINGINDEX firstNL = myBuff.Search('\n');
if (firstNL == 0) {
- cout << "FTP::Present() -- Can't find first Newline in file to present.\n";
+ std::cout << "FTP::Present() -- Can't find first Newline in file to present.\n";
return;
}

View file

@ -0,0 +1,42 @@
$NetBSD: patch-doctype_eos__guide.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/eos_guide.cxx~ 2000-11-02 05:37:08.000000000 +0000
+++ doctype/eos_guide.cxx
@@ -7,10 +7,10 @@ Author: Nassib Nassar <nassar@et
#define EOS_GUIDE_MAX_TOKEN_LENGTH 4096
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <iostream.h>
+#include <cstdio>
+#include <cctype>
+#include <cstring>
+#include <iostream>
#include "isearch.hxx"
#include "eos_guide.hxx"
@@ -31,7 +31,7 @@ EOS_GUIDE::ParseFields(PRECORD NewRecord
CHR* fn = filename.NewCString();
FILE* fp = fopen(fn, "rb");
if (!fp) {
- cout << "EOS_GUIDE::ParseFields(): Failed to open file\n\t";
+ std::cout << "EOS_GUIDE::ParseFields(): Failed to open file\n\t";
perror(fn);
delete [] fn;
return;
@@ -357,7 +357,7 @@ EOS_GUIDE::~EOS_GUIDE() {
// and tagType[] == "META"
// then TagMatch will return 1
INT
-EOS_GUIDE::TagMatch(char* tag, char* tagType) const {
+EOS_GUIDE::TagMatch(const char* tag, const char* tagType) const {
// check first character
if (*tag != '<') {
return 0;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_eos__guide.hxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/eos_guide.hxx~ 2000-09-06 18:20:30.000000000 +0000
+++ doctype/eos_guide.hxx
@@ -22,7 +22,7 @@ public:
~EOS_GUIDE();
private:
- INT TagMatch(char* tag, char* tagType) const;
+ INT TagMatch(const char* tag, const char* tagType) const;
STRING DocSource;
};

View file

@ -0,0 +1,75 @@
$NetBSD: patch-doctype_fgdc.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
Fix insecure use of tempnam().
--- doctype/fgdc.cxx~ 2000-09-06 18:20:30.000000000 +0000
+++ doctype/fgdc.cxx
@@ -120,19 +120,21 @@ Original: Edward C. Zimmermann, edz@bsn.
Copyright: A/WWW Enterprises, MCNC/CNIDR and USGS/FGDC
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <math.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
+#include <cmath>
#include "isearch.hxx"
#include "date.hxx"
#include "sgmlnorm.hxx"
#include "fgdc.hxx"
+using namespace std;
+
#define PRESENT_PROGRAM "/home/cnidr/bin/mp -c /home/cnidr/bin/deluxe.cfg"
void BuildCommandLine(const STRING& Command, const STRING& FullFilename,
@@ -966,7 +968,7 @@ FGDC::ParseFields (RECORD *NewRecord)
}
}
- CHR *unified_name = UnifiedName(*tags_ptr);
+ const CHR *unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL)
continue; // ignore these
@@ -1824,10 +1826,22 @@ FGDC::Present (const RESULT& ResultRecor
return;
} else {
STRING s_cmd;
- CHR *TmpName;
-
- TmpName = tempnam("/tmp", "mpout");
+ CHR TmpName[64];
+ int fd;
+ strcpy(TmpName, "/tmp/mpoutXXXXXX");
+ fd = mkstemp(TmpName);
+ if (fd < 0) {
+ /*
+ * Apparently failure is not an option here, so
+ * proceed in a way that at least won't be insecure.
+ */
+ strcpy(TmpName, "/dev/null");
+ }
+ else {
+ close(fd);
+ }
+
BuildCommandLine(mpCommand, HoldFilename, RecordSyntax,
TmpName, &s_cmd);
system(s_cmd);

View file

@ -0,0 +1,31 @@
$NetBSD: patch-doctype_fgdcsite.cxx,v 1.1 2012/12/21 10:29:46 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- doctype/fgdcsite.cxx~ 1998-11-04 04:50:53.000000000 +0000
+++ doctype/fgdcsite.cxx
@@ -42,15 +42,17 @@ Description: Class FGDCSITE - for FGDC N
Author: Kevin Gamiel, Kevin.Gamiel@cnidr.org
@@@*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
#include "sgmltag.hxx"
#include "fgdcsite.hxx"
+using namespace std;
+
FGDCSITE::FGDCSITE(PIDBOBJ DbParent)
: SGMLTAG(DbParent)
{

View file

@ -0,0 +1,96 @@
$NetBSD: patch-doctype_filename.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/filename.cxx~ 1998-02-26 01:50:24.000000000 +0000
+++ doctype/filename.cxx
@@ -6,7 +6,7 @@ Description: class FILENAME - index file
Author: Erik Scott, Scott Technologies, Inc.
*/
-#include <ctype.h>
+#include <cctype>
#include "isearch.hxx"
#include "filename.hxx"
@@ -46,7 +46,7 @@ void FILENAME::ParseRecords(const RECORD
FILE *fnfp = fopen(newfilename,"wb");
if (fnfp == NULL) {
- cout << "Cannot write file " << newfilename << ", bailing out.\n";
+ std::cout << "Cannot write file " << newfilename << ", bailing out.\n";
return; // leaking all the way...
}
@@ -122,7 +122,7 @@ void FILENAME::Present(const RESULT& Res
PFILE fp = fopen (hackedFN, "rb");
if (!fp)
{
- cout << "Could not access '" << hackedFN << "'\n";
+ std::cout << "Could not access '" << hackedFN << "'\n";
return; // File not accessed
}
@@ -130,8 +130,8 @@ void FILENAME::Present(const RESULT& Res
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "FILENAME::Present(): Seek failed (I) - ";
- cout << hackedFN << "\n";
+ std::cout << "FILENAME::Present(): Seek failed (I) - ";
+ std::cout << hackedFN << "\n";
fclose(fp);
return;
}
@@ -139,15 +139,15 @@ void FILENAME::Present(const RESULT& Res
GPTYPE RecStart = 0;
GPTYPE RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "FILENAME::Present(): Skipping ";
- cout << " zero-length record -" << hackedFN << "...\n";
+ std::cout << "FILENAME::Present(): Skipping ";
+ std::cout << " zero-length record -" << hackedFN << "...\n";
fclose(fp);
return;
}
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "FILENAME::Present(): Seek failed (II) - " << hackedFN << "\n";
+ std::cout << "FILENAME::Present(): Seek failed (II) - " << hackedFN << "\n";
fclose(fp);
return;
}
@@ -156,24 +156,24 @@ void FILENAME::Present(const RESULT& Res
PCHR RecBuffer = new CHR[RecLength + 2];
if(!RecBuffer) {
- cout << "FILENAME::Present(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << hackedFN << "\n";
+ std::cout << "FILENAME::Present(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << hackedFN << "\n";
fclose(fp);
return;
}
GPTYPE ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "FILENAME::Present(): Failed to fread\n";
+ std::cout << "FILENAME::Present(): Failed to fread\n";
delete [] RecBuffer;
fclose(fp);
return;
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "FILENAME::Present(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << hackedFN << "\n";
+ std::cout << "FILENAME::Present(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << hackedFN << "\n";
delete [] RecBuffer;
return;
}

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_filmline.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/filmline.cxx~ 1996-12-21 00:40:37.000000000 +0000
+++ doctype/filmline.cxx
@@ -136,7 +136,7 @@ FILMLINE::FILMLINE (PIDBOBJ DbParent): M
// Hooks into the Field parser from Medline
-PCHR FILMLINE::UnifiedName (PCHR tag) const
+PKCHR FILMLINE::UnifiedName (PKCHR tag) const
{
#if USE_UNIFIED_NAMES
static struct {

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_filmline.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/filmline.hxx~ 1996-07-10 18:54:08.000000000 +0000
+++ doctype/filmline.hxx
@@ -23,7 +23,7 @@ public:
PSTRING StringBuffer);
~FILMLINE();
// hooks into the guts of the Medline field parser
- PCHR UnifiedName (PCHR tag) const;
+ PKCHR UnifiedName (PKCHR tag) const;
};
typedef FILMLINE* PFILMLINE;

View file

@ -0,0 +1,26 @@
$NetBSD: patch-doctype_firstline.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- doctype/firstline.cxx~ 1997-02-16 23:02:49.000000000 +0000
+++ doctype/firstline.cxx
@@ -112,12 +112,12 @@ Description: Class FIRSTLINE - TEXT with
Author: Edward C. Zimmermann, edz@bsn.com
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "firstline.hxx"

View file

@ -0,0 +1,26 @@
$NetBSD: patch-doctype_ftp.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/ftp.cxx~ 1996-12-21 00:40:37.000000000 +0000
+++ doctype/ftp.cxx
@@ -6,7 +6,7 @@ Description: class FTP - index files bas
Author: Erik Scott, Scott Technologies, Inc.
*/
-#include <ctype.h>
+#include <cctype>
#include "isearch.hxx"
#include "ftp.hxx"
@@ -27,7 +27,7 @@ STRING myBuff;
ResultRecord.GetRecordData(&myBuff);
STRINGINDEX firstNL = myBuff.Search('\n');
if (firstNL == 0) {
- cout << "FTP::Present() -- Can't find first Newline in file to present.\n";
+ std::cout << "FTP::Present() -- Can't find first Newline in file to present.\n";
return;
}

View file

@ -0,0 +1,24 @@
$NetBSD: patch-doctype_gils.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- doctype/gils.cxx~ 1998-11-04 04:50:53.000000000 +0000
+++ doctype/gils.cxx
@@ -40,11 +40,11 @@ Description: Class GILS - SGML-like Text
Author: Archie Warnock, warnock@clark.net
@@@*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
#include "gils.hxx"

View file

@ -0,0 +1,24 @@
$NetBSD: patch-doctype_gilsxml.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- doctype/gilsxml.cxx~ 2000-02-04 22:47:49.000000000 +0000
+++ doctype/gilsxml.cxx
@@ -43,11 +43,11 @@ Author: Archie Warnock (awww@home.com),
Originally by: Kevin Gamiel, Kevin.Gamiel@cnidr.org
@@@*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
#include "sgmltag.hxx"
#include "gilsxml.hxx"

View file

@ -0,0 +1,113 @@
$NetBSD: patch-doctype_html.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/html.cxx~ 2000-02-04 22:46:35.000000000 +0000
+++ doctype/html.cxx
@@ -115,12 +115,12 @@ Author: Edward C. Zimmermann, edz@bsn
Copyright: Basis Systeme netzwerk, Munich
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
//#include "common.hxx"
#include "html.hxx"
@@ -183,7 +183,7 @@ static int IsHTMLAttributeTag (const cha
{
// HTML Attributes where we are also interested in values
static struct {
- char *tag;
+ const char *tag;
unsigned char len;
} Tags[] = {
/*- UNSORTED LIST (lowercase names) -*/
@@ -357,7 +357,7 @@ static int IgnoreHTMLTag (const char *ta
#endif
// Search for the next occurance of an element of tags in tag_list
-static const char *find_next_tag (char *const *tag_list, char *const *tags)
+static const char *find_next_tag (char *const *tag_list, const char *const *tags)
{
if (*tag_list == NULL)
return NULL;
@@ -393,7 +393,7 @@ void HTML::ParseFields (PRECORD NewRecor
if (fp == NULL)
{
error:
- cout << "Unable to parse HTML file \"" << fn << "\"\n";
+ std::cout << "Unable to parse HTML file \"" << fn << "\"\n";
return;
}
@@ -451,17 +451,17 @@ void HTML::ParseFields (PRECORD NewRecor
if (StrCaseCmp (*tags_ptr, "dd") == 0)
{
// Look for nearest <DT> or </DL>
- static char *tags[] = {"dt", "/dl", NULL};
+ static const char *tags[] = {"dt", "/dl", NULL};
p = find_next_tag (tags_ptr, tags);
if (p == NULL)
{
// Some bogus uses
- static char *tags[] = {"dd", "/ul", "/ol", NULL};
+ static const char *tags[] = {"dd", "/ul", "/ol", NULL};
p = find_next_tag (tags_ptr, tags);
if (p)
{
// Give some information
- cout << "HTML Warning: \""
+ std::cout << "HTML Warning: \""
<< fn << "\" offset " << (size_t) (*tags_ptr - RecBuffer) << ": "
<< "Bogus use of <" << *tags_ptr << ">, using <" << p << "> as end tag.\n";
}
@@ -470,17 +470,17 @@ void HTML::ParseFields (PRECORD NewRecor
else if (StrCaseCmp (*tags_ptr, "dt") == 0)
{
// look for next <DD> or </DL>
- static char *tags[] = {"DD", "/DL", NULL};
+ static const char *tags[] = {"DD", "/DL", NULL};
p = find_next_tag (tags_ptr, tags);
if (p == NULL)
{
// Some bogus uses
- static char *tags[] = {"dt", "/ul", "/ol", NULL};
+ static const char *tags[] = {"dt", "/ul", "/ol", NULL};
p = find_next_tag (tags_ptr, tags);
if (p)
{
// Give some information
- cout << "HTML Warning: \""
+ std::cout << "HTML Warning: \""
<< fn << "\" offset " << (*tags_ptr - RecBuffer) << ": "
<< "Bogus use of <" << *tags_ptr << ">, using <" << p << "> as end tag.\n";
}
@@ -489,13 +489,13 @@ void HTML::ParseFields (PRECORD NewRecor
else if (StrCaseCmp (*tags_ptr, "li") == 0)
{
// look for next <LI>, </OL> or </UL>
- static char *tags[] = {"li", "/ol", "/ul", NULL};
+ static const char *tags[] = {"li", "/ol", "/ul", NULL};
p = find_next_tag (tags_ptr, tags);
}
else if (StrCaseCmp (*tags_ptr, "tl") == 0)
{
// look for nearest <TL> or </TLI>
- static char *tags[] = {"tl", "/tli", NULL};
+ static const char *tags[] = {"tl", "/tli", NULL};
p = find_next_tag (tags_ptr, tags);
}
} // end code to handle some HTML minimized tags

View file

@ -0,0 +1,42 @@
$NetBSD: patch-doctype_htmltag.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/htmltag.cxx~ 2000-02-24 20:51:21.000000000 +0000
+++ doctype/htmltag.cxx
@@ -7,10 +7,10 @@ Author: Nassib Nassar <nassar@et
#define HTMLTAG_MAX_TOKEN_LENGTH 4096
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <iostream.h>
+#include <cstdio>
+#include <cctype>
+#include <cstring>
+#include <iostream>
#include "isearch.hxx"
#include "htmltag.hxx"
@@ -27,7 +27,7 @@ HTMLTAG::ParseFields(PRECORD NewRecord)
CHR* fn = filename.NewCString();
FILE* fp = fopen(fn, "rb");
if (!fp) {
- cout << "HTMLTAG::ParseFields(): Failed to open file\n\t";
+ std::cout << "HTMLTAG::ParseFields(): Failed to open file\n\t";
perror(fn);
delete [] fn;
return;
@@ -201,7 +201,7 @@ HTMLTAG::~HTMLTAG() {
// e.g. if tag[] == "<META NAME=\"AUTHOR\" CONTENT=\"Nassar\">"
// and tagType[] == "META"
// then TagMatch will return 1
-int HTMLTAG::TagMatch(char* tag, char* tagType) const {
+int HTMLTAG::TagMatch(const char* tag, const char* tagType) const {
// check first character
if (*tag != '<') {
return 0;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_htmltag.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/htmltag.hxx~ 1998-11-11 21:31:12.000000000 +0000
+++ doctype/htmltag.hxx
@@ -22,7 +22,7 @@ public:
~HTMLTAG();
private:
- int TagMatch(char* tag, char* tagType) const;
+ int TagMatch(const char* tag, const char* tagType) const;
};
typedef HTMLTAG* PHTMLTAG;

View file

@ -0,0 +1,26 @@
$NetBSD: patch-doctype_iafadoc.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- doctype/iafadoc.cxx~ 1996-12-21 00:40:38.000000000 +0000
+++ doctype/iafadoc.cxx
@@ -113,12 +113,12 @@ Description: Class IAFADOC - IAFA docume
Author: Edward C. Zimmermann, edz@bsn.com
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "iafadoc.hxx"

View file

@ -0,0 +1,36 @@
$NetBSD: patch-doctype_irlist.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/irlist.cxx~ 1996-12-21 00:40:39.000000000 +0000
+++ doctype/irlist.cxx
@@ -113,12 +113,12 @@ Author: Edward C. Zimmermann, edz@bsn.c
Copyright: Basis Systeme netzwerk, Munich
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "irlist.hxx"
@@ -141,7 +141,7 @@ void IRLIST::ParseRecords (const RECORD&
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access '" << Fn << "'\n";
+ std::cout << "Could not access '" << Fn << "'\n";
return; // File not accessed
}

View file

@ -0,0 +1,36 @@
$NetBSD: patch-doctype_listdigest.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/listdigest.cxx~ 1996-12-21 00:40:39.000000000 +0000
+++ doctype/listdigest.cxx
@@ -114,12 +114,12 @@ Author: Edward C. Zimmermann, edz@bsn.c
Copyright: Basis Systeme netzwerk, Munich
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "listdigest.hxx"
@@ -142,7 +142,7 @@ void LISTDIGEST::ParseRecords (const REC
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access '" << Fn << "'\n";
+ std::cout << "Could not access '" << Fn << "'\n";
return; // File not accessed
}

View file

@ -0,0 +1,36 @@
$NetBSD: patch-doctype_maildigest.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/maildigest.cxx~ 1996-12-21 00:40:39.000000000 +0000
+++ doctype/maildigest.cxx
@@ -113,12 +113,12 @@ Description: Class MAILDIGEST - Internet
Author: Edward C. Zimmermann, edz@bsn.com
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "maildigest.hxx"
@@ -141,7 +141,7 @@ void MAILDIGEST::ParseRecords (const REC
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access '" << Fn << "'\n";
+ std::cout << "Could not access '" << Fn << "'\n";
return; // File not accessed
}

View file

@ -0,0 +1,87 @@
$NetBSD: patch-doctype_mailfolder.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/mailfolder.cxx~ 1998-05-12 16:48:33.000000000 +0000
+++ doctype/mailfolder.cxx
@@ -115,12 +115,12 @@ Author: Edward C. Zimmermann, edz@bsn.c
Distribution: Isite modifications by A. Warnock (warnock@clark.net)
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "mailfolder.hxx"
#include "doc_conf.hxx"
@@ -182,7 +182,7 @@ GDT_BOOLEAN MAILFOLDER::accept_tag(const
#if RESTRICT_MAIL_FIELDS
// Mail tags that we want, if it is not
// here then we igonre it.
- static char * Keywords[] = {
+ static const char * Keywords[] = {
/* Must be sorted! */
"Bcc",
"Cc",
@@ -252,7 +252,7 @@ void MAILFOLDER::ParseRecords (const REC
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access '" << Fn << "'\n";
+ std::cout << "Could not access '" << Fn << "'\n";
return; // File not accessed
}
@@ -362,11 +362,11 @@ void MAILFOLDER::ParseFields (PRECORD Ne
if (tags)
{
delete tags;
- cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
+ std::cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
}
else
{
- cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
+ std::cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
}
delete [] RecBuffer;
return;
@@ -394,11 +394,11 @@ void MAILFOLDER::ParseFields (PRECORD Ne
if (strncmp(*tags_ptr, "Content-Type", 12) == 0)
{
if (strstr(*tags_ptr, "X-sun-attachment"))
- cout << "MAILFOLDER: record in \"" << fn << "\" is " << *tags_ptr << "\n";
+ std::cout << "MAILFOLDER: record in \"" << fn << "\" is " << *tags_ptr << "\n";
}
else if (strncmp(*tags_ptr, "Content-Transfer-Encoding", 12) == 0)
{
- cout << "MAILFOLDER: record in \"" << fn << "\" is " << *tags_ptr << "\n";
+ std::cout << "MAILFOLDER: record in \"" << fn << "\" is " << *tags_ptr << "\n";
}
#endif
PCHR p = tags_ptr[1];
@@ -550,10 +550,10 @@ GDT_BOOLEAN MAILFOLDER::IsMailFromLine (
static char magic[] = "From "; // Mail magic
#define MAX_FIELDS 10
- char *fields[MAX_FIELDS];
+ const char *fields[MAX_FIELDS];
const char *sender_tail;
register const char *lp;
- register char **fp;
+ register const char **fp;
register int n, i;
// Email (RFC822) has English language dates from 1 Jan 1970 on
static char legal_day[] = "SunMonTueWedThuFriSat";

View file

@ -0,0 +1,57 @@
$NetBSD: patch-doctype_marcdump.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
- string constants are const char *
--- doctype/marcdump.cxx~ 1998-12-01 14:59:04.000000000 +0000
+++ doctype/marcdump.cxx
@@ -7,12 +7,12 @@ Author: Archibald Warnock (warnock@clar
Copyright: A/WWW Enterprises, Columbia, MD
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "opobj.hxx"
#include "operand.hxx"
@@ -27,6 +27,8 @@ Copyright: A/WWW Enterprises, Columbia,
#include "marcdump.hxx"
+using namespace std;
+
// Local prototypes
static CHR **parse_tags (CHR *b, GPTYPE len);
int usefulMarcDumpField(char *fieldStr);
@@ -243,7 +245,7 @@ MARCDUMP::ParseFields (RECORD *NewRecord
val_len--;
if (val_len <= 0) continue; // Don't bother with empty fields (J. Mandel)
- CHR* unified_name = UnifiedName(tag);
+ const CHR* unified_name = UnifiedName(tag);
// Ignore "unclassified" fields
if (unified_name == NULL)
@@ -288,8 +290,8 @@ MARCDUMP::ParseFields (RECORD *NewRecord
}
-CHR*
-MARCDUMP::UnifiedName (CHR *tag)
+const CHR*
+MARCDUMP::UnifiedName (const CHR *tag)
{
return tag; // Identity
}

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_marcdump.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/marcdump.hxx~ 1998-05-19 21:01:18.000000000 +0000
+++ doctype/marcdump.hxx
@@ -19,7 +19,7 @@ class MARCDUMP
public:
MARCDUMP(PIDBOBJ DbParent);
void AddFieldDefs();
- CHR* UnifiedName (CHR *tag);
+ const CHR* UnifiedName (const CHR *tag);
void ParseRecords(const RECORD& FileRecord);
void ParseFields(RECORD *NewRecord);

View file

@ -0,0 +1,69 @@
$NetBSD: patch-doctype_medline.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/medline.cxx~ 1998-05-12 16:48:34.000000000 +0000
+++ doctype/medline.cxx
@@ -117,12 +117,12 @@ Copyright: Basis Systeme netzwerk, Munic
// TODO: Clean-up Record parser and fix to leave off junk between records
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "medline.hxx"
@@ -162,7 +162,7 @@ void MEDLINE::ParseRecords (const RECORD
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access " << Fn << "\n";
+ std::cout << "Could not access " << Fn << "\n";
return; // File not accessed
}
@@ -269,7 +269,7 @@ void MEDLINE::ParseRecords (const RECORD
flavours.
*/
-PCHR MEDLINE::UnifiedName (PCHR tag) const
+PKCHR MEDLINE::UnifiedName (PKCHR tag) const
{
printf("Medline:UnifiedName called\n");
#if USE_UNIFIED_NAMES
@@ -314,11 +314,11 @@ void MEDLINE::ParseFields (PRECORD NewRe
if (tags)
{
delete tags;
- cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
+ std::cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
}
else
{
- cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
+ std::cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
}
delete [] RecBuffer;
return;
@@ -352,7 +352,7 @@ void MEDLINE::ParseFields (PRECORD NewRe
// if (val_len <= 0) continue; // Skip blank fields
if (val_len < 0) continue; // Skip blank fields
- PCHR unified_name = UnifiedName(*tags_ptr);
+ PKCHR unified_name = UnifiedName(*tags_ptr);
#if WANT_MISC
// Throw "unclassified" into Misc
FieldName = unified_name ? unified_name: "Misc";

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_medline.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/medline.hxx~ 1996-07-10 18:54:09.000000000 +0000
+++ doctype/medline.hxx
@@ -25,7 +25,7 @@ public:
PSTRING StringBuffer);
~MEDLINE();
// hooks into the guts of the field parser
- virtual PCHR UnifiedName (PCHR tag) const; // for children to play with
+ virtual PKCHR UnifiedName (PKCHR tag) const; // for children to play with
};
typedef MEDLINE* PMEDLINE;

View file

@ -0,0 +1,41 @@
$NetBSD: patch-doctype_memodoc.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/memodoc.cxx~ 1998-05-12 16:48:34.000000000 +0000
+++ doctype/memodoc.cxx
@@ -113,12 +113,12 @@ Description: Class MEMODOC - Colon-like
Author: Edward C. Zimmermann, edz@bsn.com
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "memodoc.hxx"
@@ -174,11 +174,11 @@ void MEMODOC::ParseFields (PRECORD NewRe
if (tags)
{
delete tags;
- cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
+ std::cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
}
else
{
- cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
+ std::cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
}
delete [] RecBuffer;
return;

View file

@ -0,0 +1,26 @@
$NetBSD: patch-doctype_oneline.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/oneline.cxx~ 1996-12-21 00:40:40.000000000 +0000
+++ doctype/oneline.cxx
@@ -6,7 +6,7 @@ Description: class ONELINE - index docum
Author: Erik Scott, Scott Technologies, Inc.
*/
-#include <ctype.h>
+#include <cctype>
#include "isearch.hxx"
#include "oneline.hxx"
@@ -24,7 +24,7 @@ void ONELINE::ParseRecords(const RECORD&
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access '" << Fn << "'\n";
+ std::cout << "Could not access '" << Fn << "'\n";
return; // File not accessed
}

View file

@ -0,0 +1,77 @@
$NetBSD: patch-doctype_para.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- doctype/para.cxx~ 1997-03-11 14:40:22.000000000 +0000
+++ doctype/para.cxx
@@ -27,7 +27,7 @@ void PARA::ParseRecords(const RECORD& Fi
PFILE fp = fopen (fn, "rb");
if (!fp)
{
- cout << "Could not access '" << fn << "'\n";
+ std::cout << "Could not access '" << fn << "'\n";
return; // File not accessed
}
@@ -48,8 +48,8 @@ void PARA::ParseRecords(const RECORD& Fi
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "PARA::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "PARA::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
@@ -57,15 +57,15 @@ void PARA::ParseRecords(const RECORD& Fi
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "PARA::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "PARA::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "PARA::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "PARA::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -74,24 +74,24 @@ void PARA::ParseRecords(const RECORD& Fi
RecBuffer = new CHR[RecLength + 2];
if(!RecBuffer) {
- cout << "PARA::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "PARA::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "PARA::ParseRecords(): Failed to fread\n";
+ std::cout << "PARA::ParseRecords(): Failed to fread\n";
delete [] RecBuffer;
fclose(fp);
return;
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "PARA::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "PARA::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}

View file

@ -0,0 +1,78 @@
$NetBSD: patch-doctype_referbib.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/referbib.cxx~ 1998-05-12 16:48:34.000000000 +0000
+++ doctype/referbib.cxx
@@ -113,12 +113,12 @@ Description: Class REFERBIB - Refer bibl
Author: Edward C. Zimmermann, edz@bsn.com
@@@-*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "referbib.hxx"
@@ -168,7 +168,7 @@ void REFERBIB::ParseRecords (const RECOR
PFILE Fp = fopen (Fn, "rb");
if (!Fp)
{
- cout << "Could not access " << Fn << "\n";
+ std::cout << "Could not access " << Fn << "\n";
return; // File not accessed
}
@@ -262,7 +262,7 @@ NOTE:
formats that might be added to Isearch, eg. BibTeX
*/
-PCHR REFERBIB::UnifiedName(PCHR tag) const
+PKCHR REFERBIB::UnifiedName(PKCHR tag) const
{
#if USE_UNIFIED_NAMES
const char *Table[] = {
@@ -299,7 +299,7 @@ PCHR REFERBIB::UnifiedName(PCHR tag) con
// Ignore lower case tags
if (tag[1] < 'A' || tag[1] > 'Z') return NULL;
// Return unified field name
- return (PCHR)Table[(unsigned)tag[1] - (unsigned)'A'];
+ return Table[(unsigned)tag[1] - (unsigned)'A'];
#else
return tag; // Identity
#endif
@@ -341,11 +341,11 @@ void REFERBIB::ParseFields (PRECORD NewR
if (tags)
{
delete tags;
- cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
+ std::cout << "Warning: No `" << doctype << "' fields/tags in \"" << fn << "\" record.\n";
}
else
{
- cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
+ std::cout << "Unable to parse `" << doctype << "' record in \"" << fn << "\".\n";
}
delete [] RecBuffer;
return;
@@ -384,7 +384,7 @@ void REFERBIB::ParseFields (PRECORD NewR
}
#endif
- PCHR unified_name = UnifiedName(*tags_ptr);
+ PKCHR unified_name = UnifiedName(*tags_ptr);
#if WANT_MISC
// Throw "unclassified" into Misc
FieldName = unified_name ? unified_name: "Misc";

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_referbib.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/referbib.hxx~ 1996-07-10 18:54:09.000000000 +0000
+++ doctype/referbib.hxx
@@ -24,7 +24,7 @@ public:
PSTRING StringBuffer);
~REFERBIB();
// hooks into the guts of the field parser
- virtual PCHR UnifiedName (PCHR tag) const; // for children to play with
+ virtual PKCHR UnifiedName (PKCHR tag) const; // for children to play with
};
typedef REFERBIB* PREFERBIB;

View file

@ -0,0 +1,58 @@
$NetBSD: patch-doctype_sgmlnorm.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/sgmlnorm.cxx~ 2000-02-04 22:48:27.000000000 +0000
+++ doctype/sgmlnorm.cxx
@@ -156,9 +156,9 @@ Authors: Kevin Gamiel, Kevin.Gamiel@c
Copyright: BSn/CNIDR
@@@-*/
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
+#include <cstdlib>
+#include <cctype>
+#include <cstring>
#include "isearch.hxx"
//#include "common.hxx"
//#include "doctype.hxx"
@@ -178,7 +178,7 @@ void SGMLNORM::ParseRecords (const RECOR
-PCHR SGMLNORM::UnifiedName (PCHR tag) const
+PKCHR SGMLNORM::UnifiedName (PKCHR tag) const
{
return tag;
}
@@ -225,7 +225,7 @@ void SGMLNORM::ParseFields (PRECORD NewR
PCHR *tags = parse_tags (RecBuffer, ActualLength);
if (tags == NULL)
{
- cout << "Unable to parse `" << doctype << "' tags in file " << fn << "\n";
+ std::cout << "Unable to parse `" << doctype << "' tags in file " << fn << "\n";
// Clean up
delete[]RecBuffer;
return;
@@ -284,7 +284,7 @@ void SGMLNORM::ParseFields (PRECORD NewR
else
{
#endif
- PCHR unified_name = UnifiedName(*tags_ptr);
+ PKCHR unified_name = UnifiedName(*tags_ptr);
// Ignore "unclassified" fields
if (unified_name == NULL) continue; // ignore these
FieldName = unified_name;
@@ -315,7 +315,7 @@ void SGMLNORM::ParseFields (PRECORD NewR
{
#if 1
// Give some information
- cout << doctype << " Warning: \""
+ std::cout << doctype << " Warning: \""
<< fn << "\" offset " << (*tags_ptr - RecBuffer) << ": "
<< "No end tag for <" << *tags_ptr << "> found, skipping field.\n";
#endif

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_sgmlnorm.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/sgmlnorm.hxx~ 1997-06-28 20:57:20.000000000 +0000
+++ doctype/sgmlnorm.hxx
@@ -27,7 +27,7 @@ public:
~SGMLNORM ();
// hooks into the guts of the field parser
- virtual CHR* UnifiedName (CHR *tag) const; // for children to play with
+ virtual const CHR* UnifiedName (const CHR *tag) const; // for children to play with
/* SGML helper functions */
PCHR *parse_tags (CHR *b, GPTYPE len) const;

View file

@ -0,0 +1,135 @@
$NetBSD: patch-doctype_sgmltag.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- doctype/sgmltag.cxx~ 2000-02-04 22:50:50.000000000 +0000
+++ doctype/sgmltag.cxx
@@ -51,11 +51,11 @@ Changes: 1.02
- Misc Error checking
@@@*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
#include "isearch.hxx"
#include "sgmltag.hxx"
@@ -101,7 +101,7 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
file = fn.NewCString();
fp = fopen(fn, "rb");
if (!fp) {
- cout << "SGMLTAG::ParseRecords(): Failed to open file\n\t";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to open file\n\t";
perror(file);
return;
}
@@ -111,16 +111,16 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
RecEnd = NewRecord->GetRecordEnd();
if (RecEnd == 0) {
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "SGMLTAG::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "SGMLTAG::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "SGMLTAG::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
@@ -129,7 +129,7 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
// Make two copies of the record in memory
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "SGMLTAG::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -137,15 +137,15 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
RecBuffer = new CHR[RecLength + 1];
if(!RecBuffer) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
OrigRecBuffer = new CHR[RecLength + 1];
if(!OrigRecBuffer) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
delete [] RecBuffer;
fclose(fp);
return;
@@ -153,7 +153,7 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "SGMLTAG::ParseRecords(): Failed to fread\n\t";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to fread\n\t";
perror(file);
delete [] RecBuffer;
delete [] OrigRecBuffer;
@@ -162,9 +162,9 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "SGMLTAG::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
delete [] OrigRecBuffer;
return;
@@ -189,8 +189,8 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
pdft = new DFT();
if(!pdft) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate DFT - ";
- cout << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate DFT - ";
+ std::cout << fn << "\n";
delete [] RecBuffer;
delete [] OrigRecBuffer;
return;
@@ -198,7 +198,7 @@ SGMLTAG::ParseFields(PRECORD NewRecord)
// tags = sgml_parse_tags(RecBuffer, RecLength);
tags = sgml_parse_tags(RecBuffer, RecLength, &numtags);
if(tags == NULL) {
- cout << "Unable to parse SGML file " << fn << "\n";
+ std::cout << "Unable to parse SGML file " << fn << "\n";
delete pdft;
delete [] RecBuffer;
delete [] OrigRecBuffer;
@@ -272,7 +272,7 @@ SGMLTAG::sgml_parse_tags(char *b, int le
t = new CHR*[128];
if(!t) {
- cout << "SGMLTAG::sgml_parse_tags(): Out of memory\n";
+ std::cout << "SGMLTAG::sgml_parse_tags(): Out of memory\n";
return NULL;
}
max_num_tags = TAG_GROW_SIZE;

View file

@ -0,0 +1,25 @@
$NetBSD: patch-doctype_simple.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- doctype/simple.cxx~ 1998-06-03 03:30:13.000000000 +0000
+++ doctype/simple.cxx
@@ -57,7 +57,7 @@ SIMPLE::SIMPLE(PIDBOBJ DbParent) : DOCTY
}
void SIMPLE::BeforeRset(const STRING& RecordSyntax) {
if (RecordSyntax.Equals(HtmlRecordSyntax))
- cout << "<pre>" << endl;
+ std::cout << "<pre>" << std::endl;
}
void SIMPLE::Present(const RESULT& ResultRecord, const STRING& ElementSet,
@@ -90,7 +90,7 @@ void SIMPLE::Present(const RESULT& Resul
void SIMPLE::AfterRset(const STRING& RecordSyntax) {
if (RecordSyntax.Equals(HtmlRecordSyntax))
- cout << "</pre>" << endl;
+ std::cout << "</pre>" << std::endl;
}
SIMPLE::~SIMPLE() {

View file

@ -0,0 +1,23 @@
$NetBSD: patch-doctype_soif.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- doctype/soif.cxx~ 2000-09-06 21:33:31.000000000 +0000
+++ doctype/soif.cxx
@@ -7,11 +7,12 @@ Description: Harvest SOIF records (deriv
Author: Peter Valkenburg
*/
-#include <iostream.h>
-#include <ctype.h>
+#include <iostream>
+#include <cctype>
#include "isearch.hxx"
#include "soif.hxx"
+using namespace std;
SOIF::SOIF(PIDBOBJ DbParent) : DOCTYPE(DbParent) {
}

View file

@ -0,0 +1,146 @@
$NetBSD: patch-doctype_taglist.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/taglist.cxx~ 2000-10-12 20:55:25.000000000 +0000
+++ doctype/taglist.cxx
@@ -52,12 +52,12 @@ TODO:
based indexes.
@@@*/
-#include <iostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
+#include <iostream>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <cctype>
#include "isearch.hxx"
#include "taglist.hxx"
@@ -103,7 +103,7 @@ TAGLIST::ReplaceWithSpace(PCHR data, INT
*p = '\0'; // Add a NULL to terminate the record
}
-char *ValidTags[] = {"TITLE",
+const char *ValidTags[] = {"TITLE",
"H1",
"H2",
"H3",
@@ -162,7 +162,7 @@ TAGLIST::ParseFields(PRECORD NewRecord)
file = fn.NewCString();
fp = fopen(fn, "rb");
if (!fp) {
- cout << "SGMLTAG::ParseRecords(): Failed to open file\n\t";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to open file\n\t";
perror(file);
return;
}
@@ -172,16 +172,16 @@ TAGLIST::ParseFields(PRECORD NewRecord)
RecEnd = NewRecord->GetRecordEnd();
if (RecEnd == 0) {
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "SGMLTAG::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "SGMLTAG::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "SGMLTAG::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
@@ -190,7 +190,7 @@ TAGLIST::ParseFields(PRECORD NewRecord)
// Make two copies of the record in memory
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "SGMLTAG::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -198,15 +198,15 @@ TAGLIST::ParseFields(PRECORD NewRecord)
RecBuffer = new CHR[RecLength + 1];
if(!RecBuffer) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
OrigRecBuffer = new CHR[RecLength + 1];
if(!OrigRecBuffer) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
delete [] RecBuffer;
fclose(fp);
return;
@@ -214,7 +214,7 @@ TAGLIST::ParseFields(PRECORD NewRecord)
ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "SGMLTAG::ParseRecords(): Failed to fread\n\t";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to fread\n\t";
perror(file);
delete [] RecBuffer;
delete [] OrigRecBuffer;
@@ -223,9 +223,9 @@ TAGLIST::ParseFields(PRECORD NewRecord)
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "SGMLTAG::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
delete [] OrigRecBuffer;
return;
@@ -249,15 +249,15 @@ TAGLIST::ParseFields(PRECORD NewRecord)
pdft = new DFT();
if(!pdft) {
- cout << "SGMLTAG::ParseRecords(): Failed to allocate DFT - ";
- cout << fn << "\n";
+ std::cout << "SGMLTAG::ParseRecords(): Failed to allocate DFT - ";
+ std::cout << fn << "\n";
delete [] RecBuffer;
delete [] OrigRecBuffer;
return;
}
tags = sgml_parse_tags(RecBuffer, RecLength, &numtags);
if(tags == NULL) {
- cout << "Unable to parse SGML file " << fn << "\n";
+ std::cout << "Unable to parse SGML file " << fn << "\n";
delete pdft;
delete [] RecBuffer;
delete [] OrigRecBuffer;
@@ -348,7 +348,7 @@ TAGLIST::ParseWords(
{
if (GpListSize >= GpLength)
{
- cout << "GpListSize >= GpLength" << endl;
+ std::cout << "GpListSize >= GpLength" << std::endl;
exit(1);
}
GpBuffer[GpListSize++] = DataOffset + Position;

View file

@ -0,0 +1,174 @@
$NetBSD: patch-doctype_usmarc.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- doctype/usmarc.cxx~ 1999-06-05 00:54:00.000000000 +0000
+++ doctype/usmarc.cxx
@@ -9,7 +9,7 @@ Modified by Bjorn L. Thordarson
*/
-#include <ctype.h>
+#include <cctype>
#include "isearch.hxx"
#include "marc.hxx"
#include "usmarc.hxx"
@@ -35,10 +35,10 @@ USMARC::USMARC(PIDBOBJ DbParent)
struct ParseEntry
{
- char *field;
- char *subfield;
- char *tag;
- char *name;
+ const char *field;
+ const char *subfield;
+ const char *tag;
+ const char *name;
};
// Maps a character string representation of a marc field
@@ -126,7 +126,7 @@ USMARC::ParseRecords(const RECORD& FileR
FileRecord.GetFullFileName (&fn);
PFILE fp = fopen (fn, "rb");
if (!fp) {
- cout << "Could not access '" << fn << "'" << EOL;
+ std::cout << "Could not access '" << fn << "'" << EOL;
return; // File not accessed
}
@@ -145,7 +145,7 @@ USMARC::ParseRecords(const RECORD& FileR
int RS = 0; // we also know the first record will begin @ 0.
if(fseek(fp, 0, SEEK_SET) == -1) {
- cout << "USMARC::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "USMARC::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -158,14 +158,14 @@ USMARC::ParseRecords(const RECORD& FileR
marcLength = atoi(LenBuff);
if (marcLength <= 0) {
- cout << "Something went awry trying to read MARC record Length in "
+ std::cout << "Something went awry trying to read MARC record Length in "
<< fn << " \n";
return;
}
// else we must have a valid marcLength now, so lets burn some characters
if (fseek(fp, marcLength - 5, SEEK_CUR) < 0) {
- cout << "Something went awry trying to read MARC record"
+ std::cout << "Something went awry trying to read MARC record"
<< fn << " \n";
return;
}
@@ -189,7 +189,7 @@ USMARC::readFileContents(PRECORD NewReco
file = fn.NewCString();
fp = fopen(fn, "rb");
if (!fp) {
- cout << "USMARC::ParseRecords(): Failed to open file\n\t";
+ std::cout << "USMARC::ParseRecords(): Failed to open file\n\t";
perror(file);
return;
}
@@ -200,23 +200,23 @@ USMARC::readFileContents(PRECORD NewReco
if (RecEnd == 0) {
if(fseek(fp, 0L, SEEK_END) == -1) {
- cout << "USMARC::ParseRecords(): Seek failed - ";
- cout << fn << "\n";
+ std::cout << "USMARC::ParseRecords(): Seek failed - ";
+ std::cout << fn << "\n";
fclose(fp);
return;
}
RecStart = 0;
RecEnd = ftell(fp);
if(RecEnd == 0) {
- cout << "USMARC::ParseRecords(): Skipping ";
- cout << " zero-length record -" << fn << "...\n";
+ std::cout << "USMARC::ParseRecords(): Skipping ";
+ std::cout << " zero-length record -" << fn << "...\n";
fclose(fp);
return;
}
//RecEnd -= 1;
}
if(fseek(fp, (long)RecStart, SEEK_SET) == -1) {
- cout << "USMARC::ParseRecords(): Seek failed - " << fn << "\n";
+ std::cout << "USMARC::ParseRecords(): Seek failed - " << fn << "\n";
fclose(fp);
return;
}
@@ -224,16 +224,16 @@ USMARC::readFileContents(PRECORD NewReco
RecBuffer = new CHR[RecLength + 1];
if(!RecBuffer) {
- cout << "USMARC::ParseRecords(): Failed to allocate ";
- cout << RecLength + 1 << " bytes - " << fn << "\n";
+ std::cout << "USMARC::ParseRecords(): Failed to allocate ";
+ std::cout << RecLength + 1 << " bytes - " << fn << "\n";
fclose(fp);
return;
}
GPTYPE ActualLength = (GPTYPE)fread(RecBuffer, 1, RecLength, fp);
if(ActualLength == 0) {
- cout << "USMARC::ParseRecords(): Failed to fread\n\t";
- cout << "RecLength is: " << RecLength << endl;
+ std::cout << "USMARC::ParseRecords(): Failed to fread\n\t";
+ std::cout << "RecLength is: " << RecLength << std::endl;
perror(file);
delete [] RecBuffer;
fclose(fp);
@@ -241,9 +241,9 @@ USMARC::readFileContents(PRECORD NewReco
}
fclose(fp);
if(ActualLength != RecLength) {
- cout << "USMARC::ParseRecords(): Failed to fread ";
- cout << RecLength << " bytes. Actually read " << ActualLength;
- cout << " bytes - " << fn << "\n";
+ std::cout << "USMARC::ParseRecords(): Failed to fread ";
+ std::cout << RecLength << " bytes. Actually read " << ActualLength;
+ std::cout << " bytes - " << fn << "\n";
delete [] RecBuffer;
return;
}
@@ -331,7 +331,7 @@ USMARC::usefulMarcField(char *fieldStr)
}
int
-USMARC::compareReg(char *s1 , char *s2) {
+USMARC::compareReg(const char *s1 , const char *s2) {
if (s1 == NULL || s2 == NULL) { // FIXME: Think out behavior if this happens
}
@@ -423,7 +423,7 @@ USMARC::ParseFields(PRECORD NewRecord)
// if so, then add it again using the name we give it.
PDFT pdft = new DFT();
if(!pdft) {
- cout << "USMARC::ParseRecords(): Failed to allocate DFT \n";
+ std::cout << "USMARC::ParseRecords(): Failed to allocate DFT \n";
delete [] RecBuffer;
delete [] marcDir;
return;
@@ -510,13 +510,13 @@ USMARC::ParseWords(CHR* DataBuffer, INT
char *tmp = new char[e - s + 1];
strncpy(tmp, DataBuffer + s, e - s);
tmp[e - s] = 0x00;
- cerr << "DataBuffer: " << tmp << endl;
+ cerr << "DataBuffer: " << tmp << std::endl;
delete []tmp;
tmp = new char[e - s + 1];
strncpy(tmp, RecBuffer + s, e - s);
tmp[e - s] = 0x00;
- cerr << "RecBuffer: " << tmp << endl;
+ cerr << "RecBuffer: " << tmp << std::endl;
delete []tmp;*/
} // end of while loop;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-doctype_usmarc.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- doctype/usmarc.hxx~ 1999-06-05 00:54:00.000000000 +0000
+++ doctype/usmarc.hxx
@@ -50,7 +50,7 @@ private:
int readBaseAddr(void);
void readMarcStructure(PRECORD NewRecord);
int usefulMarcField(char *fieldStr);
- int compareReg(char *s1, char *s2);
+ int compareReg(const char *s1, const char *s2);
char findNextTag(char *RecBuffer, int &pos, int &tagPos, int &tagLength);
};

View file

@ -0,0 +1,36 @@
$NetBSD: patch-src_Iindex.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
Use the correct type to convert pointers to integers.
--- src/Iindex.cxx~ 2000-10-26 00:56:35.000000000 +0000
+++ src/Iindex.cxx
@@ -42,11 +42,12 @@ Description: Command-line indexer
Author: Nassib Nassar, nrn@cnidr.org
@@@*/
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <locale.h>
-#include <time.h>
+#include <cstdlib>
+#include <cerrno>
+#include <cstring>
+#include <clocale>
+#include <ctime>
+#include <stdint.h>
#if defined(_MSDOS) || defined(_WIN32)
#include <direct.h>
@@ -170,7 +171,7 @@ AddFile(PIDB IdbPtr, STRING& PathName, S
}
}
if (Found) {
- Offset = (GPTYPE)((UINT4)Found - (UINT4)Buffer);
+ Offset = (GPTYPE)((uintptr_t)Found - (uintptr_t)Buffer);
/* the separator marks the beginning of the next
record. (offset - 1), then marks the end of
the current record. we must make sure that the

View file

@ -0,0 +1,22 @@
$NetBSD: patch-src_common.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/common.cxx~ 2000-09-06 21:14:26.000000000 +0000
+++ src/common.cxx
@@ -68,12 +68,12 @@ void
panic(const char *filename, long line)
#endif
{
- cerr << endl << "?Panic in line " << line
+ std::cerr << std::endl << "?Panic in line " << line
<< " of file " << filename
#ifdef HAS__FUNC__
<< "[" << func << "()]"
#endif
- << endl;
+ << std::endl;
(void)perror("Unexpected error condition");
abort();
}

View file

@ -0,0 +1,46 @@
$NetBSD: patch-src_datesearch.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/datesearch.cxx~ 2000-10-15 03:46:31.000000000 +0000
+++ src/datesearch.cxx
@@ -271,30 +271,30 @@ INDEX::DateRangeSearch(const STRING& Que
DURING);
INT nhits;
nhits = pirset->GetTotalEntries();
- cerr << "Got " << nhits << " with start dates after "
- << QueryStartDate.GetValue() << endl;
+ std::cerr << "Got " << nhits << " with start dates after "
+ << QueryStartDate.GetValue() << std::endl;
/*
other_pirset =
SingleDateSearchBefore(QueryEndDate, FieldName, SEARCH_START,
DURING);
nhits = other_pirset->GetTotalEntries();
- cerr << "Got " << nhits << " with start dates before "
- << QueryEndDate.GetValue() << endl;
+ std::cerr << "Got " << nhits << " with start dates before "
+ << QueryEndDate.GetValue() << std::endl;
//pirset->And(*other_pirset);
other_pirset =
SingleDateSearchAfter(QueryStartDate, FieldName, SEARCH_END,
DURING);
nhits = other_pirset->GetTotalEntries();
- cerr << "Got " << nhits << " with end dates after "
- << QueryStartDate.GetValue() << endl;
+ std::cerr << "Got " << nhits << " with end dates after "
+ << QueryStartDate.GetValue() << std::endl;
another_pirset =
SingleDateSearchBefore(QueryEndDate, FieldName, SEARCH_END,
DURING);
nhits = another_pirset->GetTotalEntries();
- cerr << "Got " << nhits << " with end dates before "
- << QueryEndDate.GetValue() << endl;
+ std::cerr << "Got " << nhits << " with end dates before "
+ << QueryEndDate.GetValue() << std::endl;
// other_pirset->And(*another_pirset);
// pirset->Or(*other_pirset);
*/

View file

@ -0,0 +1,18 @@
$NetBSD: patch-src_fc.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/fc.cxx~ 1996-12-21 00:40:54.000000000 +0000
+++ src/fc.cxx
@@ -46,8 +46,8 @@ void FC::FlipBytes() {
GpSwab(&FieldEnd);
}
-ostream& operator<<(ostream& Os, const FC& Fc) {
- Os << Fc.FieldStart << ' ' << Fc.FieldEnd << endl;
+std::ostream& operator<<(std::ostream& Os, const FC& Fc) {
+ Os << Fc.FieldStart << ' ' << Fc.FieldEnd << std::endl;
return Os;
}

View file

@ -0,0 +1,26 @@
$NetBSD: patch-src_fc.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- src/fc.hxx~ 1996-12-21 00:40:55.000000000 +0000
+++ src/fc.hxx
@@ -8,7 +8,7 @@ Author: Nassib Nassar, nrn@cnidr.org
#ifndef FC_HXX
#define FC_HXX
-#include <iostream.h>
+#include <iostream>
/*
#include "defs.hxx"
*/
@@ -22,7 +22,7 @@ public:
void Write(PFILE fp) const;
void Read(PFILE fp);
void FlipBytes();
- friend ostream& operator<<(ostream& os, const FC& Fc);
+ friend std::ostream& operator<<(std::ostream& os, const FC& Fc);
~FC();
private:
GPTYPE FieldStart;

View file

@ -0,0 +1,37 @@
$NetBSD: patch-src_fct.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
--- src/fct.cxx~ 2001-11-21 07:02:03.000000000 +0000
+++ src/fct.cxx
@@ -5,8 +5,8 @@ Description: Class FCT - Field Coordinat
Author: Nassib Nassar, nrn@cnidr.org
@@@*/
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <iostream>
#include "defs.hxx"
#include "string.hxx"
@@ -103,7 +103,7 @@ void FCT::Read(PFILE fp) {
}
}
-void FCT::Print(ostream& Os) const {
+void FCT::Print(std::ostream& Os) const {
FCTNODE* p = (FCTNODE*)(GetNodePtr(1));
while (p) {
Os << p->Fc;
@@ -120,7 +120,7 @@ void FCT::SubtractOffset(const GPTYPE Gp
}
}
-ostream& operator<<(ostream& Os, const FCT& Fct) {
+std::ostream& operator<<(std::ostream& Os, const FCT& Fct) {
Fct.Print(Os);
return Os;
}

View file

@ -0,0 +1,19 @@
$NetBSD: patch-src_fct.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/fct.hxx~ 2001-11-21 07:01:57.000000000 +0000
+++ src/fct.hxx
@@ -31,9 +31,9 @@ public:
void SortByFc();
void Write(PFILE fp) const;
void Read(PFILE fp);
- void Print(ostream& Os) const;
+ void Print(std::ostream& Os) const;
void SubtractOffset(const GPTYPE GpOffset);
- friend ostream& operator<<(ostream& os, const FCT& Fct);
+ friend std::ostream& operator<<(std::ostream& os, const FCT& Fct);
};
typedef FCT* PFCT;

View file

@ -0,0 +1,15 @@
$NetBSD: patch-src_gdt.h,v 1.1 2012/12/21 10:29:47 dholland Exp $
Add a name for const char * to go with the other pointless typedef
names in here.
--- src/gdt.h~ 2000-02-04 23:10:40.000000000 +0000
+++ src/gdt.h
@@ -62,6 +62,7 @@ typedef FLOAT* PFLOAT;
typedef double DOUBLE;
typedef char CHR;
typedef CHR* PCHR;
+typedef const CHR* PKCHR;
typedef CHR** PPCHR;
typedef unsigned char UCHR;
typedef UCHR* PUCHR;

View file

@ -0,0 +1,33 @@
$NetBSD: patch-src_infix2rpn.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
- string constants are const char *
--- src/infix2rpn.cxx~ 1998-05-12 16:49:08.000000000 +0000
+++ src/infix2rpn.cxx
@@ -241,7 +241,7 @@ INFIX2RPN::ProcessOp(const operators op,
//standardizes the various possible representations of
//the various operators.
-CHR *
+const CHR *
INFIX2RPN::StandardizeOpName(const STRING op) {
if ( (op ^= "AND") || (op == "&&") )
return "AND";
@@ -261,13 +261,13 @@ INFIX2RPN::StandardizeOpName(const STRIN
//converts the internal operator token name to a standard string
-CHR *
+const CHR *
INFIX2RPN::op2string(const operators op) {
switch(op) {
case LeftParen:
case NOP:
//shouldn't happen, but makes gcc -WALL happy.
- cerr << "LeftParen || NOP?" << endl;
+ std::cerr << "LeftParen || NOP?" << std::endl;
break;
case BoolOR:
return "OR";

View file

@ -0,0 +1,18 @@
$NetBSD: patch-src_infix2rpn.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- src/infix2rpn.hxx~ 1998-05-12 16:49:08.000000000 +0000
+++ src/infix2rpn.hxx
@@ -70,8 +70,8 @@ private:
void ProcessOp(const operators op, STRSTACK *TheStack,
STRING *result);
void RegisterError(const STRING &Error);
- CHR *op2string(const operators op);
- CHR *StandardizeOpName(const STRING op);
+ const CHR *op2string(const operators op);
+ const CHR *StandardizeOpName(const STRING op);
INT TermsWithNoOps;
STRING ErrorMessage;
CHR DefaultOp[MAX_OP_LEN];

View file

@ -0,0 +1,26 @@
$NetBSD: patch-src_intlist.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- src/intlist.cxx~ 2000-10-15 03:46:31.000000000 +0000
+++ src/intlist.cxx
@@ -45,12 +45,14 @@ Author: Archie Warnock (warnock@clark.n
Derived from class NLIST by J. Fullton
@@@*/
-#include <stdlib.h>
-#include <time.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <ctime>
+#include <iostream>
#include "intlist.hxx"
+using namespace std;
+
// Prototypes
static INT
SortStartCmp(const void* x, const void* y);

View file

@ -0,0 +1,20 @@
$NetBSD: patch-src_intlist.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
--- src/intlist.hxx~ 2000-02-04 23:39:22.000000000 +0000
+++ src/intlist.hxx
@@ -48,9 +48,9 @@ Author: Archie Warnock (warnock@clark.n
#ifndef INTERVALLIST_HXX
#define INTERVALLIST_HXX
-#include <stdlib.h>
-#include <time.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <ctime>
+#include <iostream>
#include "gdt.h"
#include "defs.hxx"

View file

@ -0,0 +1,15 @@
$NetBSD: patch-src_irset.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- open the std namespace instead of using explicit "std" qualification
--- src/irset.cxx~ 2000-10-24 18:42:20.000000000 +0000
+++ src/irset.cxx
@@ -70,6 +70,7 @@ Author: Nassib Nassar, nrn@cnidr.org
#include "squery.hxx"
#include "dtreg.hxx"
+using namespace std;
int
IrsetIndexCompare(const void* x, const void* y)

View file

@ -0,0 +1,66 @@
$NetBSD: patch-src_marc.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
- string constants are const char *
Avoid insecure use of tempnam().
--- src/marc.cxx.orig 1998-05-12 16:49:10.000000000 +0000
+++ src/marc.cxx
@@ -61,7 +61,7 @@ MARC::MARC(STRING & Data)
c_data = Data.NewCString();
c_len = Data.GetLength();
if((c_rec = GetMARC(c_data,c_len,0)) == NULL) {
- cerr << "Error parsing MARC record" << endl;
+ std::cerr << "Error parsing MARC record" << std::endl;
return;
}
c_format = 0;
@@ -102,12 +102,12 @@ char fieldbuffer[FIELDBUFSIZE];
char linebuffer[FIELDBUFSIZE];
typedef struct {
- char *label;
- char *tags;
- char *subfields;
- char *beginpunct;
- char *subfsep;
- char *endpunct;
+ const char *label;
+ const char *tags;
+ const char *subfields;
+ const char *beginpunct;
+ const char *subfsep;
+ const char *endpunct;
int newfield;
int print_all;
int print_indicators;
@@ -194,9 +194,15 @@ MARC::GetPrettyBuffer(STRING *Buffer)
{
/*
// Cheese, cheese, cheese;-)
- char *tempfile = tempnam("/tmp", "marc");
+ char tempfile[32];
+ strcpy(tempfile, "/tmp/marcXXXXXX");
+ int tempfd = mkstemp(tempfile);
+ if (tempfd < 0) {
+ *Buffer = "MARC::GetPrettyBuffer() failed to open temp file";
+ return;
+ }
FILE *fp;
- if((fp = fopen(tempfile, "w")) == NULL) {
+ if((fp = fdopen(tempfd, "w")) == NULL) {
*Buffer = "MARC::GetPrettyBuffer() failed to open temp file";
return;
}
@@ -381,7 +387,8 @@ char *
format_field(MARC_FIELD *mf, DISP_FORMAT *format, CHR *buff, INT repeat)
{
MARC_SUBFIELD *subf;
- register char *linend, *c;
+ register char *linend;
+ const register char *c;
INT pos, count, ok=0;
linend = buff;

View file

@ -0,0 +1,34 @@
$NetBSD: patch-src_marclib.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
Also, use isdigit() correctly.
--- src/marclib.cxx~ 1998-05-12 16:49:11.000000000 +0000
+++ src/marclib.cxx
@@ -458,13 +458,13 @@ int subfcopy(char *To, char *From,int fl
/* returns -1 for no match and 0 for match */
/********************************************************************/
-int tagcmp(char *pattag, char *comptag)
+int tagcmp(const char *pattag, const char *comptag)
{
int i;
for (i = 0; i < 3; i++) {
if (pattag[i] == 'x' || pattag[i] == 'X')
continue;
- if (isdigit(pattag[i]) && pattag[i] == comptag[i])
+ if (isdigit((unsigned char)pattag[i]) && pattag[i] == comptag[i])
continue;
else
return(-1);
@@ -482,7 +482,7 @@ int tagcmp(char *pattag, char *comptag)
/* field. Startf lets it start from later in a field list.*/
/* Permits "wildcard" comparisons using tagcmp */
/*********************************************************************/
-MARC_FIELD *GetField(MARC_REC *rec,MARC_FIELD *startf,char *buffer,char *tag)
+MARC_FIELD *GetField(MARC_REC *rec,MARC_FIELD *startf,char *buffer,const char *tag)
{
MARC_FIELD *f;

View file

@ -0,0 +1,19 @@
$NetBSD: patch-src_marclib.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- src/marclib.hxx~ 1998-12-10 05:33:52.000000000 +0000
+++ src/marclib.hxx
@@ -59,9 +59,9 @@ extern "C" {
void codeconvert(char *string);
char charconvert(char c);
int subfcopy(char *To, char *From,int flag);
- int tagcmp(char *pattag, char *comptag);
+ int tagcmp(const char *pattag, const char *comptag);
MARC_FIELD *GetField(MARC_REC *rec,MARC_FIELD *startf,
- char *buffer,char *tag);
+ char *buffer,const char *tag);
MARC_SUBFIELD *GetSubf(MARC_FIELD *f, char *buffer, char code);
char *normalize(char *in, char *out);
/*

View file

@ -0,0 +1,32 @@
$NetBSD: patch-src_merge.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
In C++, deleting void pointers is undefined.
--- src/merge.cxx~ 1998-11-04 05:12:25.000000000 +0000
+++ src/merge.cxx
@@ -125,7 +125,7 @@ void buildHeap(void *data, size_t heapsi
if (cmpstatus > 0) {
memcpy( ((char *)data + (position * width) ), value, width);
// free(value);
- delete [] value;
+ delete [] (CHR *)value;
return;
} //child is bigger or same size, back through the loop
//again to find a place for value
@@ -140,7 +140,7 @@ void buildHeap(void *data, size_t heapsi
else {
memcpy(((char *)data+ (position * width) ), value, width);
// free(value);
- delete [] value;
+ delete [] (CHR *)value;
return;
}
}
@@ -188,6 +188,6 @@ void hsort(void *data, size_t nel, size_
buildHeap(data, i, width, compar, 0, 0);
}
// free(tmp);
- delete [] tmp;
+ delete [] (CHR *)tmp;
}

View file

@ -0,0 +1,18 @@
$NetBSD: patch-src_multiterm.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/multiterm.cxx~ 1999-03-26 00:27:22.000000000 +0000
+++ src/multiterm.cxx
@@ -394,8 +394,8 @@ PIRSET INDEX::MultiTermSearch(const STRI
Disk=0;
} else {
// field file not found - return an empty irset
- cerr << "Field " << FieldName << " not present in this index."
- << endl;
+ std::cerr << "Field " << FieldName << " not present in this index."
+ << std::endl;
return pirset;
}
}

View file

@ -0,0 +1,24 @@
$NetBSD: patch-src_nlist.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- open the std namespace instead of using explicit "std" qualification
--- src/nlist.cxx~ 2000-02-04 23:39:56.000000000 +0000
+++ src/nlist.cxx
@@ -44,11 +44,13 @@ Description: Class NUMERICLIST
Author: Jim Fullton, Jim.Fullton@cnidr.org
@@@*/
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <iostream>
#include "nlist.hxx"
+using namespace std;
+
static INT
SortCmp(const void* x, const void* y);

View file

@ -0,0 +1,25 @@
$NetBSD: patch-src_registry.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/registry.hxx~ 2000-02-04 23:40:35.000000000 +0000
+++ src/registry.hxx
@@ -79,7 +79,7 @@ public:
// a comma-delimited list (e.g., tag=val1,val2,val3) into multiple nodes.
void ProfileLoadFromFile(const STRING& FileName, const STRLIST& Position);
void ProfileAddFromFile(const STRING& FileName, const STRLIST& Position);
- void ProfileWrite(ostream& os, const STRING& FileName, const STRLIST& Position);
+ void ProfileWrite(std::ostream& os, const STRING& FileName, const STRLIST& Position);
// friend ostream & operator<<(ostream& os, const REGISTRY& Registry);
~REGISTRY();
@@ -90,7 +90,7 @@ private:
void AddFromFile(const STRING& FileName);
// void Print(ostream& os, const INT Level) const;
void fprint(FILE* fp, const INT level = 0) const;
- void ProfilePrint(ostream& os, const INT Level) const;
+ void ProfilePrint(std::ostream& os, const INT Level) const;
void GetData(STRLIST *StrlistBuffer);
void DeleteChildren();
REGISTRY* FindNode(const STRING& Position);

View file

@ -0,0 +1,41 @@
$NetBSD: patch-src_string.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use the newfangled names for C++ headers
- use "std" qualification
- string constants are const char *
--- src/string.hxx.orig 2000-10-31 06:22:09.000000000 +0000
+++ src/string.hxx
@@ -43,8 +43,9 @@ Author: Nassib Nassar, nrn@cnidr.org
#ifndef STRING_HXX
#define STRING_HXX
-#include <string.h>
-#include <iostream.h>
+#include <cstring>
+#include <iostream>
+#include <iomanip>
#include "gdt.h"
#include "defs.hxx"
@@ -53,7 +54,7 @@ Author: Nassib Nassar, nrn@cnidr.org
#include <time.h>
#endif
-extern CHR *transcode (CHR *buffer, char **transarray);
+extern CHR *transcode (CHR *buffer, const char **transarray);
typedef size_t STRINGINDEX;
typedef STRINGINDEX* PSTRINGINDEX;
@@ -92,8 +93,8 @@ public:
INT CaseEquals(const CHR* CString) const;
void Print() const;
void Print(PFILE FilePointer) const;
- friend ostream& operator<<(ostream& os, const STRING& str);
- friend istream& operator>>(istream& os, STRING& str);
+ friend std::ostream& operator<<(std::ostream& os, const STRING& str);
+ friend std::istream& operator>>(std::istream& os, STRING& str);
INT GetInt() const;
LONG GetLong() const;
DOUBLE GetFloat() const;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-src_sw.hxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- string constants are const char *
--- src/sw.hxx~ 1998-12-10 05:35:06.000000000 +0000
+++ src/sw.hxx
@@ -2,7 +2,7 @@
#define SW_HXX
// 400 words
-char *stoplist[] = {
+const char *stoplist[] = {
"0",
"1",
"2",

View file

@ -0,0 +1,44 @@
$NetBSD: patch-src_zpresent.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
XXX: I strongly suspect the "exit;" below is an error.
--- src/zpresent.cxx~ 2000-10-24 18:40:36.000000000 +0000
+++ src/zpresent.cxx
@@ -62,13 +62,13 @@ Author: A. Warnock (warnock@awcubed.com
void
XmlBail(const STRING& DBName, const STRING& error_message) {
- cout << "\t<isearch:present status=\"Error\" dbname=\"" << DBName
- << "\">" << endl;
- cout << "\t\t<isearch:error_block>" << endl;
- cout << error_message;
- cout << "\t\t</isearch:error_block>" << endl;
- cout << "\t</isearch:present>" << endl;
- cout << "</zpresent>" << endl;
+ std::cout << "\t<isearch:present status=\"Error\" dbname=\"" << DBName
+ << "\">" << std::endl;
+ std::cout << "\t\t<isearch:error_block>" << std::endl;
+ std::cout << error_message;
+ std::cout << "\t\t</isearch:error_block>" << std::endl;
+ std::cout << "\t</isearch:present>" << std::endl;
+ std::cout << "</zpresent>" << std::endl;
exit;
}
@@ -289,10 +289,10 @@ main(int argc, char** argv) {
} else {
error_message.Cat("\t\t\t\t<isearch:error_text>Record ");
error_message.Cat("not found.</isearch:error_text>\n");
- cout << "\t\t\t<isearch:result docid=\"" << RecordKey <<
+ std::cout << "\t\t\t<isearch:result docid=\"" << RecordKey <<
"\" status=\"Error\">\n";
- cout << error_message;
- cout << "\t\t\t</isearch:result>" << endl;
+ std::cout << error_message;
+ std::cout << "\t\t\t</isearch:result>" << std::endl;
}
}

View file

@ -0,0 +1,79 @@
$NetBSD: patch-src_zsearch.cxx,v 1.1 2012/12/21 10:29:47 dholland Exp $
Chase after the C++ standard:
- use "std" qualification
--- src/zsearch.cxx~ 2000-10-24 18:40:36.000000000 +0000
+++ src/zsearch.cxx
@@ -91,7 +91,7 @@ int main(int argc, char** argv) {
fprintf(stderr," # [fieldname/]searchterm[*][:n]\n");
fprintf(stderr," # Prefix with fieldname/ for fielded searching.\n");
fprintf(stderr," # Append * for right truncation.\n");
- // cout << " // Append ~ for soundex search." << endl;
+ // cout << " // Append ~ for soundex search." << std::endl;
fprintf(stderr," # Append :n for term weighting (default=1).\n");
fprintf(stderr," # (Use negative values to lower rank.)\n");
fprintf(stderr,"Examples: zsearch -d POETRY truth \"beaut*\" urn:2\n");
@@ -286,13 +286,13 @@ int main(int argc, char** argv) {
}
if (Error) {
- cout << "\t<isearch:search status=\"Error\" dbname=\"" << DBName
- << "\">" << endl;
- cout << "\t\t<isearch:error_block>" << endl;
- cout << error_message;
- cout << "\t\t</isearch:error_block>" << endl;
- cout << "\t</search>" << endl;
- cout << "</zsearch>" << endl;
+ std::cout << "\t<isearch:search status=\"Error\" dbname=\"" << DBName
+ << "\">" << std::endl;
+ std::cout << "\t\t<isearch:error_block>" << std::endl;
+ std::cout << error_message;
+ std::cout << "\t\t</isearch:error_block>" << std::endl;
+ std::cout << "\t</search>" << std::endl;
+ std::cout << "</zsearch>" << std::endl;
EXIT_ERROR;
}
@@ -357,23 +357,23 @@ int main(int argc, char** argv) {
}
if (Error) {
- cout << "\t<isearch:search status=\"Error\" dbname=\"" << DBName
- << "\">" << endl;
- cout << "\t\t<isearch:error_block>" << endl;
- cout << error_message;
- cout << "\t\t</isearch:error_block>" << endl;
- cout << "\t</isearch:search>" << endl;
- cout << "</zsearch>" << endl;
+ std::cout << "\t<isearch:search status=\"Error\" dbname=\"" << DBName
+ << "\">" << std::endl;
+ std::cout << "\t\t<isearch:error_block>" << std::endl;
+ std::cout << error_message;
+ std::cout << "\t\t</isearch:error_block>" << std::endl;
+ std::cout << "\t</isearch:search>" << std::endl;
+ std::cout << "</zsearch>" << std::endl;
EXIT_ERROR;
}
- cout << "\t<isearch:query>" << QueryString << "</isearch:query>" << endl;
+ std::cout << "\t<isearch:query>" << QueryString << "</isearch:query>" << std::endl;
if (Synonyms) {
STRING S;
squery.ExpandQuery();
squery.GetTerm(&S);
- cout << "\t<isearch:query type=\"expanded\">" << S << "</isearch:query>" << endl;
+ std::cout << "\t<isearch:query type=\"expanded\">" << S << "</isearch:query>" << std::endl;
}
if (BooleanAnd) {
@@ -424,7 +424,7 @@ int main(int argc, char** argv) {
result.GetVKey(&ResultKey);
printf("\t\t\t<isearch:result rank=\"%i\"",t);
- cout << " docid=\"" << ResultKey << "\" ";
+ std::cout << " docid=\"" << ResultKey << "\" ";
printf(" score=\"%i\"/>\n",
prset->GetScaledScore(result.GetScore(), 100));