~ubuntu-branches/ubuntu/warty/bash/warty

« back to all changes in this revision

Viewing changes to examples/loadables/perl/bperl.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2002-04-08 20:51:41 UTC
  • Revision ID: james.westby@ubuntu.com-20020408205141-qovkhu3a90201hf2
Tags: upstream-2.05a
ImportĀ upstreamĀ versionĀ 2.05a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * perl builtin
 
3
 */
 
4
#include <config.h>
 
5
 
 
6
#include <fcntl.h>
 
7
#include <errno.h>
 
8
 
 
9
#include "builtins.h"
 
10
#include "shell.h"
 
11
 
 
12
#ifndef errno
 
13
extern int errno;
 
14
#endif
 
15
 
 
16
extern char **make_builtin_argv ();
 
17
extern char **export_env;
 
18
 
 
19
extern int perl_main();
 
20
 
 
21
bperl_builtin(list)
 
22
WORD_LIST *list;
 
23
{
 
24
        char    **v;
 
25
        int     c, r;
 
26
 
 
27
        v = make_builtin_argv(list, &c);
 
28
        r = perl_main(c, v, export_env);
 
29
        free(v);
 
30
 
 
31
        return r;
 
32
}
 
33
 
 
34
char *bperl_doc[] = {
 
35
        "An interface to a perl5 interpreter.",
 
36
        (char *)0
 
37
};
 
38
 
 
39
struct builtin bperl_struct = {
 
40
        "bperl",
 
41
        bperl_builtin,
 
42
        BUILTIN_ENABLED,
 
43
        bperl_doc,
 
44
        "bperl [perl options] [file ...]",
 
45
        0
 
46
};