it compiles
This commit is contained in:
commit
5340cd4ef2
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
efn
|
3
commands.c
Normal file
3
commands.c
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
void (*commands[256])() = {
|
||||||
|
NULL,
|
||||||
|
['q'] = c_quit,
|
2
compile.sh
Executable file
2
compile.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
gcc efn.c -o efn
|
15
efn.c
Normal file
15
efn.c
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "consts.h"
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
#include "efn.h"
|
||||||
|
|
||||||
|
#include "main.c"
|
||||||
|
|
||||||
|
#include "commands.c"
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "c_quit.c"
|
||||||
|
|
11
main.c
Normal file
11
main.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
int
|
||||||
|
main(int argc, char **argv) {
|
||||||
|
static char buf[256];
|
||||||
|
while (1) {
|
||||||
|
char *com = fgets(buf, sizeof(buf), stdin);
|
||||||
|
if (com != NULL) {
|
||||||
|
commands[com[0]]();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user