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