1 //
2 //      aegis - project change supervisor
3 //      Copyright (C) 1999, 2003-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
8 //      (at 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
13 //      GNU 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
17 //      <http://www.gnu.org/licenses/>.
18 //
19 
20 #include <common/libdir.h>
21 #include <libaegis/sub.h>
22 #include <libaegis/sub/binary_direc.h>
23 #include <common/wstring/list.h>
24 #include <common/trace.h>
25 
26 
27 //
28 // NAME
29 //      sub_binary_directory - the shared library substitution
30 //
31 // SYNOPSIS
32 //      string_ty *sub_binary_directory(wstring_list_ty *arg);
33 //
34 // DESCRIPTION
35 //      The sub_binary_directory function implements the binary_directory
36 //      substitution.  The binary_directory substitution is replaced by the
37 //      absolute path of aegis' (architecture sprecific) binary directory.
38 //
39 // ARGUMENTS
40 //      arg     - list of arguments, including the function name as [0]
41 //
42 // RETURNS
43 //      a pointer to a string in dynamic memory;
44 //      or NULL on error, setting suberr appropriately.
45 //
46 
47 wstring
sub_binary_directory(sub_context_ty * scp,const wstring_list & arg)48 sub_binary_directory(sub_context_ty *scp, const wstring_list &arg)
49 {
50     trace(("sub_library()\n{\n"));
51     wstring result;
52     if (arg.size() != 1)
53     {
54         scp->error_set(i18n("requires zero arguments"));
55     }
56     else
57         result = wstring(configured_bindir());
58     trace(("return %p;\n", result.get_ref()));
59     trace(("}\n"));
60     return result;
61 }
62 
63 
64 // vim: set ts=8 sw=4 et :
65