| 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 | #ifndef MODULES_H | 
|---|
| 30 | #define MODULES_H | 
|---|
| 31 |  | 
|---|
| 32 | /* Each built in function has two files, one being an entry.h file which | 
|---|
| 33 | * prototypes the run/help entry functions, the other being a .def file | 
|---|
| 34 | * which fills the modules[] array according to the cmd_t structure | 
|---|
| 35 | * defined in cmds.h. | 
|---|
| 36 | * | 
|---|
| 37 | * To add or remove a module, just make a new directory in cmds/modules | 
|---|
| 38 | * for it and copy the 'show' example for basics, then include it here. | 
|---|
| 39 | * (or reverse the process to remove one) | 
|---|
| 40 | * | 
|---|
| 41 | * NOTE: See module_ aliases.h as well, this is where aliases (commands that | 
|---|
| 42 | * share an entry point with others) are indexed */ | 
|---|
| 43 |  | 
|---|
| 44 | #include "config.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" | 
|---|
| 65 |  | 
|---|
| 66 | /* Each .def function fills the module_t struct with the individual name, entry | 
|---|
| 67 | * point, help entry point, etc. You can use config.h to control what modules | 
|---|
| 68 | * are loaded based on what libraries exist on the system. */ | 
|---|
| 69 |  | 
|---|
| 70 | module_t modules[] = { | 
|---|
| 71 | #include "help/help_def.inc" | 
|---|
| 72 | #include "mkdir/mkdir_def.inc" | 
|---|
| 73 | #include "mkfile/mkfile_def.inc" | 
|---|
| 74 | #include "rm/rm_def.inc" | 
|---|
| 75 | #include "cat/cat_def.inc" | 
|---|
| 76 | #include "touch/touch_def.inc" | 
|---|
| 77 | #include "ls/ls_def.inc" | 
|---|
| 78 | #include "pwd/pwd_def.inc" | 
|---|
| 79 | #include "sleep/sleep_def.inc" | 
|---|
| 80 | #include "cp/cp_def.inc" | 
|---|
| 81 | #include "mv/mv_def.inc" | 
|---|
| 82 | #include "mount/mount_def.inc" | 
|---|
| 83 | #include "unmount/unmount_def.inc" | 
|---|
| 84 | #include "kcon/kcon_def.inc" | 
|---|
| 85 | #include "printf/printf_def.inc" | 
|---|
| 86 | #include "echo/echo_def.inc" | 
|---|
| 87 | #include "cmp/cmp_def.inc" | 
|---|
| 88 |  | 
|---|
| 89 | { NULL, NULL, NULL, NULL } | 
|---|
| 90 | }; | 
|---|
| 91 |  | 
|---|
| 92 | #endif | 
|---|