1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2007, 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
7 // by 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 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 <common/ac/assert.h>
20 #include <common/ac/stdlib.h>
21 
22 #include <common/trace.h>
23 #include <libaegis/os.h>
24 #include <libaegis/user.h>
25 
26 
27 nstring
pager_command()28 user_ty::pager_command()
29 {
30     trace(("user_ty::pager_command()\n{\n"));
31     assert(!os_become_active());
32     uconf_ty *ucp = uconf_get();
33     if (!ucp->pager_command)
34     {
35         const char *pager = getenv("PAGER");
36         if (!pager || !*pager)
37             pager = "more";
38         ucp->pager_command = str_from_c(pager);
39     }
40     trace(("return \"%s\";\n", ucp->pager_command->str_text));
41     trace(("}\n"));
42     return nstring(ucp->pager_command);
43 }
44 
45 
46 bool
pager_preference()47 user_ty::pager_preference()
48 {
49     uconf_ty *ucp = uconf_get();
50     return (ucp->pager_preference == uconf_pager_preference_foreground);
51 }
52 
53 
54 // vim: set ts=8 sw=4 et :
55