sim

the sim text editor
git clone git://ssnf.xyz/sim
Log | Files | Refs | README

commit ca2f499cdc740ad9d13cdf7e7d36622a4e759252
parent d19a4bbb2144da607cb2882e1110a99697844840
Author: ssnf <ssnf@ssnf.xyz>
Date:   Sun, 15 Aug 2021 17:46:15 +0000

moved main() back to the bottom... :D

Diffstat:
Msim.c | 50+++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/sim.c b/sim.c @@ -91,31 +91,6 @@ static Window w; #include "config.h" -int -main(int argc, char* argv[]) -{ - uint i; - uchar c; - - init(); - if (argv[1]) { - str_adds(f->name, argv[1]); - file_load(f); - } - for (;;) { - win_query(&w); - fr_update(); - c = fgetc(stdin); - for (i = 0; i < LENGTH(keys); ++i) { - if (keys[i].key == c) { - keys[i].func(keys[i].value); - break; - } - } - fr_update(); - } -} - void die(char* fmt, ...) { @@ -517,3 +492,28 @@ str_delete(String* p, Posn p0, Posn p1) memmove(p->s + p0, p->s + p1, p->n - p1); p->n -= p1 - p0; } + +int +main(int argc, char* argv[]) +{ + uint i; + uchar c; + + init(); + if (argv[1]) { + str_adds(f->name, argv[1]); + file_load(f); + } + for (;;) { + win_query(&w); + fr_update(); + c = fgetc(stdin); + for (i = 0; i < LENGTH(keys); ++i) { + if (keys[i].key == c) { + keys[i].func(keys[i].value); + break; + } + } + fr_update(); + } +}