[dedc4cd] | 1 | /*
|
---|
| 2 | * Copyright (c) 2008 Tim Post
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /*
|
---|
| 30 | * Each built in function has two files, one being an entry.h file which
|
---|
| 31 | * prototypes the run/help entry functions, the other being a .def file
|
---|
| 32 | * which fills the modules[] array according to the cmd_t structure
|
---|
| 33 | * defined in cmds.h.
|
---|
| 34 | *
|
---|
| 35 | * To add or remove a module, just make a new directory in cmds/modules
|
---|
| 36 | * for it and copy the 'show' example for basics, then include it here.
|
---|
| 37 | * (or reverse the process to remove one)
|
---|
| 38 | *
|
---|
| 39 | * NOTE: See module_ aliases.h as well, this is where aliases (commands that
|
---|
| 40 | * share an entry point with others) are indexed
|
---|
| 41 | */
|
---|
| 42 |
|
---|
| 43 | #include "config.h"
|
---|
| 44 | #include "modules.h"
|
---|
| 45 |
|
---|
| 46 | /* Prototypes for each module's entry (help/exec) points */
|
---|
| 47 |
|
---|
| 48 | #include "help/entry.h"
|
---|
| 49 | #include "mkdir/entry.h"
|
---|
| 50 | #include "mkfile/entry.h"
|
---|
| 51 | #include "rm/entry.h"
|
---|
| 52 | #include "cat/entry.h"
|
---|
| 53 | #include "touch/entry.h"
|
---|
| 54 | #include "ls/entry.h"
|
---|
| 55 | #include "pwd/entry.h"
|
---|
| 56 | #include "sleep/entry.h"
|
---|
| 57 | #include "cp/entry.h"
|
---|
| 58 | #include "mv/entry.h"
|
---|
| 59 | #include "mount/entry.h"
|
---|
| 60 | #include "unmount/entry.h"
|
---|
| 61 | #include "kcon/entry.h"
|
---|
| 62 | #include "printf/entry.h"
|
---|
| 63 | #include "echo/entry.h"
|
---|
| 64 | #include "cmp/entry.h"
|
---|
[ab936440] | 65 | #include "alias/entry.h"
|
---|
| 66 | #include "unalias/entry.h"
|
---|
[8d07f267] | 67 | #include "clear/entry.h"
|
---|
| 68 | #include "basename/entry.h"
|
---|
| 69 | #include "grep/entry.h"
|
---|
[dedc4cd] | 70 |
|
---|
| 71 | /*
|
---|
| 72 | * Each .def function fills the module_t struct with the individual name, entry
|
---|
| 73 | * point, help entry point, etc. You can use config.h to control what modules
|
---|
| 74 | * are loaded based on what libraries exist on the system.
|
---|
| 75 | */
|
---|
| 76 |
|
---|
| 77 | module_t modules[] = {
|
---|
| 78 | #include "help/help_def.inc"
|
---|
| 79 | #include "mkdir/mkdir_def.inc"
|
---|
| 80 | #include "mkfile/mkfile_def.inc"
|
---|
| 81 | #include "rm/rm_def.inc"
|
---|
| 82 | #include "cat/cat_def.inc"
|
---|
| 83 | #include "touch/touch_def.inc"
|
---|
| 84 | #include "ls/ls_def.inc"
|
---|
| 85 | #include "pwd/pwd_def.inc"
|
---|
| 86 | #include "sleep/sleep_def.inc"
|
---|
| 87 | #include "cp/cp_def.inc"
|
---|
| 88 | #include "mv/mv_def.inc"
|
---|
| 89 | #include "mount/mount_def.inc"
|
---|
| 90 | #include "unmount/unmount_def.inc"
|
---|
| 91 | #include "kcon/kcon_def.inc"
|
---|
| 92 | #include "printf/printf_def.inc"
|
---|
| 93 | #include "echo/echo_def.inc"
|
---|
| 94 | #include "cmp/cmp_def.inc"
|
---|
[ab936440] | 95 | #include "alias/alias_def.inc"
|
---|
| 96 | #include "unalias/unalias_def.inc"
|
---|
[8d07f267] | 97 | #include "clear/clear_def.inc"
|
---|
| 98 | #include "basename/basename_def.inc"
|
---|
| 99 | #include "grep/grep_def.inc"
|
---|
[dedc4cd] | 100 |
|
---|
| 101 | { NULL, NULL, NULL, NULL }
|
---|
| 102 | };
|
---|