1 /* @source seealso application
2 **
3 ** Finds programs sharing group names
4 **
5 ** @author Copyright (C) Gary Williams (gwilliam@hgmp.mrc.ac.uk)
6 ** @@
7 **
8 ** This program is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License
10 ** as published by the Free Software Foundation; either version 2
11 ** of the License, or (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with this program; if not, write to the Free Software
20 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ******************************************************************************/
22
23 #include "emboss.h"
24
25
26
27
28 /* @prog seealso **************************************************************
29 **
30 ** Finds programs sharing group names
31 **
32 ******************************************************************************/
33
main(int argc,char ** argv,char ** env)34 int main(int argc, char **argv, char **env)
35 {
36
37 AjPList newlist = NULL;
38 AjPList glist;
39 AjPList alpha;
40 AjPList appglist;
41 AjPList applist;
42 AjPList appgroups = NULL;
43
44 AjPFile outfile = NULL;
45 AjPStr search = NULL;
46 AjBool html;
47 AjBool groups;
48 AjBool emboss;
49 AjBool embassy;
50 AjBool explode;
51 AjBool colon;
52 AjPStr showembassy = NULL;
53 AjPStr package = NULL;
54
55 embInit("seealso", argc, argv);
56
57 search = ajAcdGetString("search");
58 outfile = ajAcdGetOutfile("outfile");
59 html = ajAcdGetToggle("html");
60 groups = ajAcdGetBoolean("groups");
61 emboss = ajAcdGetBoolean("emboss");
62 embassy = ajAcdGetBoolean("embassy");
63 showembassy = ajAcdGetString("showembassy");
64 explode = ajAcdGetBoolean("explode");
65 colon = ajAcdGetBoolean("colon");
66
67
68 glist = ajListNew();
69 alpha = ajListNew();
70 appglist = ajListNew();
71 applist = ajListNew();
72
73
74
75 /* is a search string specified - should be tested in seealso.acd */
76
77 if(!ajStrGetLen(search))
78 ajFatal("No application specified.");
79
80
81 /*
82 ** get the groups and program information - don't want to ignore
83 ** applications that don't work well under GUIs
84 */
85
86 /* everything */
87 embGrpGetProgGroups(appglist, applist, env, ajTrue, ajTrue, NULL,
88 explode, colon, ajFalse);
89
90 /* what the user asked for */
91 embGrpGetProgGroups(glist, alpha, env, emboss, embassy, showembassy,
92 explode, colon, ajFalse);
93
94 newlist = ajListNew();
95 embGrpKeySearchSeeAlso(newlist, &appgroups, &package,
96 applist, glist, search);
97 if(appgroups == NULL)
98 {
99 ajErr("No applications match.");
100 ajExitBad();
101 }
102
103 if(groups)
104 embGrpOutputGroupsList(outfile, appgroups, ajFalse,
105 html, ajFalse, package);
106 else
107 embGrpOutputGroupsList(outfile, newlist, ajTrue,
108 html, ajFalse, package);
109
110 embGrpGroupsListDel(&newlist);
111
112 embGrpGroupsListDel(&glist);
113 embGrpGroupsListDel(&alpha);
114 embGrpGroupsListDel(&appglist);
115 embGrpGroupsListDel(&applist);
116
117 /* embGrpGroupsListDel(&appgroups); */ /* appgroup points to another list*/
118
119 ajFileClose(&outfile);
120 ajStrDel(&search);
121 ajStrDel(&showembassy);
122 ajStrDel(&package);
123
124 embExit();
125
126 return 0;
127 }
128