dtinfo subtree tools

This commit is contained in:
Ulrich Wilkens
2012-10-14 17:24:56 +02:00
committed by Jon Trulson
parent 07e886ba7c
commit 5cdb889f7b
85 changed files with 41 additions and 19018 deletions

View File

@@ -3,6 +3,7 @@ XCOMM $XConsortium: Imakefile /main/7 1996/08/21 15:56:17 drk $
XCOMM These tools are used during "make includes".
includes:: all
NormalCplusplusObjectRule()
NormalLibraryObjectRule()
AllTarget(dfiles)
NormalProgramTarget(dfiles,dfiles.o,,,)
@@ -18,7 +19,7 @@ msgsets.o : msgsets.C
SimpleCPlusPlusProgram(msgsets,msgsets.o,)
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
SRCS = dfiles.c pmaker.c msgsets.C
DependTarget()

View File

@@ -22,6 +22,7 @@
*/
/* $XConsortium: dfiles.c /main/3 1996/06/11 17:40:25 cde-hal $ */
#include <stdio.h>
#include <stdlib.h>
main(argc, argv)
int argc ;

View File

@@ -42,7 +42,7 @@
#ifdef __cplusplus
#include <stdlib.h>
#if !defined(__DECCXX) && !defined(USL) && !defined(CSRG_BASED)
#if !defined(__DECCXX) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED)
#include <osfcn.h>
#else
#include <unistd.h>
@@ -195,12 +195,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
/* All Rights Reserved */
#include <string.h>
#include <strstream>
#include <sstream>
#include <iostream>
using namespace std;
#define BUFFER_INCR_UNIT 64
std::ostrstream **sets;
std::ostringstream **sets;
int sets_cnt = 0; /* number of sets slots occupied */
int sets_max = 0; /* total number of sets slots */
@@ -510,14 +511,14 @@ case 1:
sets_max += BUFFER_INCR_UNIT;
if (sets_cnt == 0) {
sets = (std::ostrstream **)
malloc(sizeof(std::ostrstream *) * sets_max);
sets = (std::ostringstream **)
malloc(sizeof(std::ostringstream *) * sets_max);
set_nums = (int *)
malloc(sizeof(int) * sets_max);
}
else {
sets = (std::ostrstream **)
realloc(sets, sizeof(std::ostrstream *) * sets_max);
sets = (std::ostringstream **)
realloc(sets, sizeof(std::ostringstream *) * sets_max);
set_nums = (int *)
realloc(set_nums, sizeof(int) * sets_max);
}
@@ -529,7 +530,7 @@ case 1:
}
if (cur_set >= 0)
*sets[cur_set] << '\0';
sets[cur_set = sets_cnt++] = new std::ostrstream;
sets[cur_set = sets_cnt++] = new std::ostringstream;
*sets[cur_set] << (char*)yytext;
@@ -1151,7 +1152,7 @@ main()
}
for (i = 0; i < sets_cnt; i++) {
const char* record = sets[sorted[i]]->str();
const char* record = sets[sorted[i]]->str().c_str();
std::cout << record << '\n' << std::flush;
}

View File

@@ -4,11 +4,12 @@
/* All Rights Reserved */
#include <string.h>
#include <strstream.h>
#include <sstream>
using namespace std;
#define BUFFER_INCR_UNIT 64
ostrstream **sets;
ostringstream **sets;
int sets_cnt = 0; /* number of sets slots occupied */
int sets_max = 0; /* total number of sets slots */
@@ -32,14 +33,14 @@ int* sorted;
sets_max += BUFFER_INCR_UNIT;
if (sets_cnt == 0) {
sets = (ostrstream **)
malloc(sizeof(ostrstream *) * sets_max);
sets = (ostringstream **)
malloc(sizeof(ostringstream *) * sets_max);
set_nums = (int *)
malloc(sizeof(int) * sets_max);
}
else {
sets = (ostrstream **)
realloc(sets, sizeof(ostrstream *) * sets_max);
sets = (ostringstream **)
realloc(sets, sizeof(ostringstream *) * sets_max);
set_nums = (int *)
realloc(set_nums, sizeof(int) * sets_max);
}
@@ -51,7 +52,7 @@ int* sorted;
}
if (cur_set >= 0)
*sets[cur_set] << '\0';
sets[cur_set = sets_cnt++] = new ostrstream;
sets[cur_set = sets_cnt++] = new ostringstream;
*sets[cur_set] << (char*)yytext;
@@ -136,7 +137,7 @@ main()
}
for (i = 0; i < sets_cnt; i++) {
const char* record = sets[sorted[i]]->str();
const char* record = sets[sorted[i]]->str().c_str();
cout << record << '\n' << flush;
}

View File

@@ -22,6 +22,7 @@
*/
/* $XConsortium: pmaker.c /main/3 1996/06/11 17:40:31 cde-hal $ */
#include <stdio.h>
#include <stdlib.h>
main(argc, argv)
int argc ;