Include zebrautl.h instead of alexutil.h.
[idzebra-moved-to-github.git] / recctrl / recctrl.c
1 /*
2  * Copyright (C) 1994-1996, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: recctrl.c,v $
7  * Revision 1.2  1996-10-29 14:03:16  adam
8  * Include zebrautl.h instead of alexutil.h.
9  *
10  * Revision 1.1  1996/10/11 10:57:24  adam
11  * New module recctrl. Used to manage records (extract/retrieval).
12  *
13  * Revision 1.5  1996/06/04 10:18:59  adam
14  * Minor changes - removed include of ctype.h.
15  *
16  * Revision 1.4  1995/12/04  17:59:24  adam
17  * More work on regular expression conversion.
18  *
19  * Revision 1.3  1995/12/04  14:22:30  adam
20  * Extra arg to recType_byName.
21  * Started work on new regular expression parsed input to
22  * structured records.
23  *
24  * Revision 1.2  1995/11/15  14:46:19  adam
25  * Started work on better record management system.
26  *
27  * Revision 1.1  1995/09/27  12:22:28  adam
28  * More work on extract in record control.
29  * Field name is not in isam keys but in prefix in dictionary words.
30  *
31  */
32 #include <stdio.h>
33 #include <assert.h>
34 #include <string.h>
35
36 #include <zebrautl.h>
37 #include "rectext.h"
38 #include "recgrs.h"
39
40 RecType recType_byName (const char *name, char *subType)
41 {
42     char *p;
43     char tmpname[256];
44
45     strcpy (tmpname, name);
46     if ((p = strchr (tmpname, '.')))
47     {
48         *p = '\0';
49         strcpy (subType, p+1);
50     }
51     else
52         *subType = '\0';
53     if (!strcmp (recTypeGrs->name, tmpname))
54         return recTypeGrs;
55     if (!strcmp (recTypeText->name, tmpname))
56         return recTypeText;
57     return NULL;
58 }
59