source: vendor/bash/3.1/builtins/inlib.def

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 2.0 KB
Line 
1This file is inlib.def, from which is created inlib.c.
2It implements the Apollo-specific builtin "inlib" in Bash.
3
4Copyright (C) 1987-2002 Free Software Foundation, Inc.
5
6This file is part of GNU Bash, the Bourne Again SHell.
7
8Bash is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 2, or (at your option) any later
11version.
12
13Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License along
19with Bash; see the file COPYING. If not, write to the Free Software
20Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
21
22$PRODUCES inlib.c
23#include <config.h>
24
25#include <stdio.h>
26#include "../shell.h"
27
28$BUILTIN inlib
29$FUNCTION inlib_builtin
30$DEPENDS_ON apollo
31$SHORT_DOC inlib pathname [pathname...]
32Install a user-supplied library specified by pathname in the current
33shell process. The library is used to resolve external references
34in programs and libraries loaded after its installation. Note
35that the library is not loaded into the address space unless it is
36needed to resolve an external reference. The list of inlibed
37libraries is passed to all children of the current shell.
38$END
39
40#if defined (apollo)
41
42#include <apollo/base.h>
43#include <apollo/loader.h>
44
45inlib_builtin (list)
46 WORD_LIST *list;
47{
48 status_$t status;
49 int return_value;
50 short len;
51
52 if (!list)
53 {
54 builtin_usage ();
55 return (EX_USAGE);
56 }
57
58 return_value = EXECUTION_SUCCESS;
59
60 while (list)
61 {
62 len = (short)strlen (list->word->word);
63 loader_$inlib (list->word->word, len, &status);
64
65 if (status.all != status_$ok)
66 {
67 builtin_error ("%s: inlib failed", list->word->word);
68 return_value = EXECUTION_FAILURE;
69 }
70
71 list = list->next;
72 }
73
74 return (return_value);
75}
76#endif /* apollo */
Note: See TracBrowser for help on using the repository browser.