1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2000-2006, 2008, 2012 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or (at
8 // your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18
19 #include <libaegis/attrlistveri.h>
20 #include <libaegis/cattr.fmtgen.h>
21 #include <libaegis/change/attributes.h>
22 #include <libaegis/sub.h>
23
24
25 void
change_attributes_verify(string_ty * fn,cattr_ty * d)26 change_attributes_verify(string_ty *fn, cattr_ty *d)
27 {
28 if (!d->brief_description)
29 {
30 sub_context_ty *scp;
31
32 scp = sub_context_new();
33 sub_var_set_string(scp, "File_Name", d->errpos ? d->errpos : fn);
34 sub_var_set_charstar(scp, "FieLD_Name", "brief_description");
35 fatal_intl(scp, i18n("$filename: contains no \"$field_name\" field"));
36 // NOTREACHED
37 sub_context_delete(scp);
38 }
39 if (!(d->mask & cattr_cause_mask))
40 {
41 sub_context_ty *scp;
42
43 scp = sub_context_new();
44 sub_var_set_string(scp, "File_Name", d->errpos ? d->errpos : fn);
45 sub_var_set_charstar(scp, "FieLD_Name", "cause");
46 fatal_intl(scp, i18n("$filename: contains no \"$field_name\" field"));
47 // NOTREACHED
48 sub_context_delete(scp);
49 }
50 attributes_list_verify(d->attribute);
51 }
52
53
54 // vim: set ts=8 sw=4 et :
55