1 /* -*-C-*- 2 ******************************************************************************** 3 * 4 * File: structures.c (Formerly structures.c) 5 * Description: Allocate all the different types of structures. 6 * Author: Mark Seaman, OCR Technology 7 * Created: Wed May 30 10:27:26 1990 8 * Modified: Mon Jul 15 10:39:18 1991 (Mark Seaman) marks@hpgrlt 9 * Language: C 10 * Package: N/A 11 * Status: Experimental (Do Not Distribute) 12 * 13 * (c) Copyright 1990, Hewlett-Packard Company. 14 ** Licensed under the Apache License, Version 2.0 (the "License"); 15 ** you may not use this file except in compliance with the License. 16 ** You may obtain a copy of the License at 17 ** http://www.apache.org/licenses/LICENSE-2.0 18 ** Unless required by applicable law or agreed to in writing, software 19 ** distributed under the License is distributed on an "AS IS" BASIS, 20 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 ** See the License for the specific language governing permissions and 22 ** limitations under the License. 23 * 24 *********************************************************************************/ 25 /*---------------------------------------------------------------------- 26 I n c l u d e s 27 ----------------------------------------------------------------------*/ 28 #include "structures.h" 29 #include "callcpp.h" 30 31 #include <stdio.h> 32 33 /*---------------------------------------------------------------------- 34 M a c r o s 35 ----------------------------------------------------------------------*/ 36 #define BLOBBLOCK 64 /*no allocated together */ 37 #define OUTLINEBLOCK 300 /*of each type */ 38 #define NODEBLOCK 36 /*blocks all about 1K bytes */ 39 #define EDGEPTBLOCK 50 40 #define WERDBLOCK 42 41 #define LISTBLOCK 300 42 43 /*---------------------------------------------------------------------- 44 V a r i a b l e s 45 ----------------------------------------------------------------------*/ 46 int structblockcount = 0; 47 void_void memory_print_functions[NUM_DATA_TYPES]; 48 int max_data_types = 0; 49 50 /*---------------------------------------------------------------------- 51 F u n c t i o n s 52 ----------------------------------------------------------------------*/ 53 makestructure (newword, oldword, printword, TWERD, 54 freeword, WERDBLOCK, "TWERD", wordcount) 55 makestructure (newoutline, oldoutline, printol, TESSLINE, 56 freeoutline, OUTLINEBLOCK, "TESSLINE", outlinecount); 57 58 makestructure (new_cell, free_cell, printcell, list_rec, 59 freelist, LISTBLOCK, "LIST", listcount); 60 61 newstructure (newblob, TBLOB, freeblob, BLOBBLOCK, "newblob", blobcount); 62 oldstructure (oldblob, TBLOB, freeblob, "BLOB", blobcount); 63 64 newstructure (newedgept, EDGEPT, freeedgept, EDGEPTBLOCK, "newedgept", 65 edgeptcount); 66 oldstructure (oldedgept, EDGEPT, freeedgept, "EDGEPT", edgeptcount); 67