Usermode/AxWin3 - Clean up unneeded (and silly) log message
[tpg/acess2.git] / Usermode / Applications / insmod_src / main.c
1 /*
2  * Acess2 OS Userland - insmod
3  * - By John Hodge (thePowersGang)
4  *
5  * main.c
6  * - Core
7  */
8 #include <stdio.h>
9 #include <string.h>
10 #include <errno.h>
11 #include <acess/sys.h>
12
13 #define MODDIR  "/Acess/Modules/"
14
15 // === CODE ===
16 void Usage(const char *progname)
17 {
18         fprintf(stderr, "Usage: %s <module>\n", progname);
19 }
20
21
22 int main(int argc, char *argv[])
23 {
24         if( argc != 2 ) {
25                 Usage(argv[0]);
26                 return 1;
27         }
28
29         const char *modname = argv[1];
30         
31         char path[strlen(MODDIR)+strlen(modname)+1];
32         strcpy(path, MODDIR);
33         strcat(path, modname);
34         
35         int rv = _SysLoadModule(path);
36         if( rv )
37         {
38                 fprintf(stderr, "_SysLoadModule(\"%s\"): %s\n", path, strerror(rv));
39         }
40         else {
41                 printf("Loaded module '%s'\n", path);
42         }
43
44         return 0;
45 }

UCC git Repository :: git.ucc.asn.au