1 |
/* |
2 |
* Utility functions for Ascend |
3 |
* Version: $Revision: 1.2 $ |
4 |
* Version control file: $RCSfile: old_utils.h,v $ |
5 |
* Date last modified: $Date: 1998/01/29 01:04:09 $ |
6 |
* Last modified by: $Author: ballan $ |
7 |
* Part of Ascend |
8 |
* |
9 |
* This file is part of the Ascend Programming System. |
10 |
* |
11 |
* Copyright (C) 1990 Karl Michael Westerberg |
12 |
* Copyright (C) 1993 Joseph James Zaher |
13 |
* Copyright (C) 1993, 1994 Benjamin Andrew Allan, Joseph James Zaher |
14 |
* |
15 |
* The Ascend Programming System is free software; you can redistribute |
16 |
* it and/or modify it under the terms of the GNU General Public License as |
17 |
* published by the Free Software Foundation; either version 2 of the |
18 |
* License, or (at your option) any later version. |
19 |
* |
20 |
* Ascend is distributed in hope that it will be |
21 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
23 |
* General Public License for more details. |
24 |
* |
25 |
* You should have received a copy of the GNU General Public License |
26 |
* along with the program; if not, write to the Free Software Foundation, |
27 |
* Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named |
28 |
* COPYING. |
29 |
* |
30 |
* This module defines the dimensionality checking and some other |
31 |
* auxillaries for Ascend. |
32 |
* |
33 |
* |
34 |
* This file is called old_utils because these utilities are outdated and |
35 |
* ^^^ |
36 |
* need to go away. DO NOT MAKE ANY MORE REFERENCES TO THESE FUNCTIONS! |
37 |
*/ |
38 |
|
39 |
/* |
40 |
* Contents: ASCEND Utilities module |
41 |
* |
42 |
* Authors: Karl Westerberg |
43 |
* Joseph Zaher |
44 |
* |
45 |
* Dates: 06/90 - original version |
46 |
* 03/94 - Re-wrote name making functions which no longer |
47 |
* need pre-allocated string space as an argument |
48 |
* to write to. Added an additional function which |
49 |
* creates instance names utilizing the shortest |
50 |
* path. The dimension string output function also |
51 |
* no longer requires pre-allocation of a string. |
52 |
* 04/94 - Provided a relation dimension checker. |
53 |
* |
54 |
* Description: This module provides supplementary functions which may |
55 |
* prove useful by any client of the ASCEND system. |
56 |
* |
57 |
*/ |
58 |
#ifndef _OLD_UTILS_H |
59 |
#define _OLD_UTILS_H |
60 |
|
61 |
/* requires |
62 |
* #include "instance_enum.h" |
63 |
* #include "fractions.h" |
64 |
* #include "dimen.h" |
65 |
*/ |
66 |
|
67 |
/* |
68 |
* functions that are soon to go away are surrounded with |
69 |
* #if (NOLONGERSUPPORTED == 0). These functions should not be used. |
70 |
*/ |
71 |
#define NOLONGERSUPPORTED 1 |
72 |
|
73 |
extern char *asc_make_dimensions(); |
74 |
/* |
75 |
* dimens = asc_make_dimensions(dim) |
76 |
* char *dimens; |
77 |
* dim_type *dim; |
78 |
* |
79 |
* Prints the dimensions to a sufficiently long string which |
80 |
* is created and returned. The string should be destroyed when |
81 |
* no longer in use. |
82 |
*/ |
83 |
|
84 |
extern int g_check_dimensions_noisy; |
85 |
/* |
86 |
* if 0, warnings are suppressed. if 1, warnings are given |
87 |
* from asc_check_dimensions(); |
88 |
*/ |
89 |
|
90 |
extern int asc_check_dimensions(); |
91 |
/* |
92 |
* valid = asc_check_dimensions(rel,dimens); |
93 |
* int valid; |
94 |
* struct relation *rel; |
95 |
* dim_type *dimens; |
96 |
* |
97 |
* THIS ONLY WORKS ON e_token relations and later for e_opcode |
98 |
* relations. rel is assumed to be valid when called. !!! |
99 |
* |
100 |
* Scans a relation in postfix and collects all dimensional |
101 |
* information by applying each token. It returns a value of TRUE |
102 |
* only if no real instances or real atom instances with wild |
103 |
* dimensionality and no dimensional inconsistencies were encountered. |
104 |
* If the return value is 2 rather than 1, then the dimensionality |
105 |
* has been determined before. |
106 |
* The address of an allocated dimension type is passed in so that |
107 |
* the dimensions of the relation (or at least what the function |
108 |
* thinks the dimensions ought to be) can be also obtained. |
109 |
*/ |
110 |
#endif /* _OLD_UTILS_H */ |