-
Notifications
You must be signed in to change notification settings - Fork 0
/
dim_addr.c
81 lines (72 loc) · 2.29 KB
/
dim_addr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**************************************************************************
* dim_addr.c:
*
* returns a pointer to a DIMEN struct which contains the given name
* returns NULL if name not found
*
* $Id: dim_addr.c 3058 2007-01-25 22:25:59Z rsregan $
*
$Revision: 3058 $
$Log: dim_addr.c,v $
Revision 1.7 1996/04/29 16:23:00 markstro
Unknown
* Revision 1.6 1996/02/19 19:59:52 markstro
* Now lints pretty clean
*
Revision 1.5 1994/11/22 17:19:28 markstro
(1) Cleaned up dimensions and parameters.
(2) Some changes due to use of malloc_dbg.
* Revision 1.4 1994/09/30 14:54:11 markstro
* Initial work on function prototypes.
*
* Revision 1.3 1994/09/09 14:56:24 markstro
* (1) Fixed up main edit menu.
* (2) Added a "notes" field to dimension indicies
* (3) A little more Rosenbrock work.
* (4) Fixed the list selector -- changed button names & first item
* selected by default.
* (5) Modified spread sheet help to be able to display dimension notes
* (6) Ran some source through "cb"
*
* Revision 1.2 1994/01/31 20:16:13 markstro
* Make sure that all source files have CVS log.
*
**************************************************************************/
#define DIM_ADDR_C
#include <stdio.h>
#include <string.h>
#include "mms.h"
/*--------------------------------------------------------------------*\
| FUNCTION : dim_addr
| COMMENT :
| PARAMETERS :
| RETURN VALUE :
| RESTRICTIONS :
\*--------------------------------------------------------------------*/
DIMEN *dim_addr (char *name) {
long i;
if (!dim_db->count)
return (NULL);
for (i = 0; i < dim_db->count; i++)
if (!strcmp (((DIMEN *)(dim_db->itm[i]))->name, name))
return ((DIMEN *)(dim_db->itm[i]));
return (NULL);
}
/*--------------------------------------------------------------------*\
| FUNCTION : dim_notes
| COMMENT :
| PARAMETERS :
| RETURN VALUE :
| RESTRICTIONS :
\*--------------------------------------------------------------------*/
char *dim_notes (char *ch_ptr) {
int i, j;
DIMEN *dim;
for (i = 0; i < dim_db->count; i++) {
dim = (DIMEN *)(dim_db->itm[i]);
for (j = 0; j < dim->value; j++)
if (dim->names && dim->names[j] && (!strcmp (dim->names[j],ch_ptr)))
return (dim->notes[j]);
}
return (NULL);
}