From 5aa7f1ad704b48eb3843de3f071cd9ad179f3df2 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sat, 29 Apr 2023 18:56:11 -0400 Subject: [PATCH] tweak: change name to mumble. --- lisp | Bin 3052 -> 0 bytes makefile | 7 ++- notes/gbd-tutorial.txt | 130 +++++++++++++++++++++++++++++++++++++++++ notes/typedef.txt | 11 ++++ src/lisp.c | 6 -- src/mumble.c | 20 +++++++ 6 files changed, 166 insertions(+), 8 deletions(-) delete mode 100755 lisp create mode 100644 notes/gbd-tutorial.txt create mode 100644 notes/typedef.txt delete mode 100644 src/lisp.c create mode 100644 src/mumble.c diff --git a/lisp b/lisp deleted file mode 100755 index 37a4ec9b04e6429b55cdf5dcd1532dbcad4376d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3052 zcmbtW-D@0G6hFJ0P2xu<(MDKkFzZ8c`;bX0Y1lqQW}M$wP4!GB-u0zo82%o zi%CUPR>dJkgD<|OZ}}5^QL7QeH+`sxRun(5N|fRUgko9GxpPjuS?f!CVdrpWH}i}Q^^xxw^N(U6(I`_^ub{uI*UI?dkB-BV2+0t?BKWz zBK6O)|6D533HEcGAcyJNDBr)$;ckM8oq_;)?I%6eD!j_hYF`^)nBU4Id|7(|ip)2dKgRqRVxId4!1Hhx^IjPFLF6s_l^U!xq7ay# z4;$WMrB*R*G$YWFo_BG%USq8XG!V^x6cfmWZzApDE|2RWvuHR%Kym@ z0L8mcmo~(PW4BauxBL2|Xs8cvWuk%OU-b;U zNMn@Z-%Igt6Y)=OtM41t+)1gEUpIbH&5ydDIq%N6=iLjgx3jot_YAyD;W{6t#n&KN zg+9%qed$R^t@fsl+~3u`iD`(}?`Esj8lsqqE}D+!3EShzDe>lh{NMN!MtqqDJZ1I1 znVzz8Z)7H|{6@#5Rd_u+VGY09sjOnN>j}%LSw+_xcCEs=l^?fq<5usu)vfDUKzRY{ zH1pEB(weFD?8y|a`zu$Xbn8=EmmR$Z+NUi_4$wOBCEzX|y@pS1AH9jaB^vVQZ*gqm zRJmHM=bxx;u)3Cd)8eh~O;iA(wvApJ@$DhDe#_*yMoTTU1pSzPOwQFXOpgooQLB3V;4b$h_5Xt@vMdy(AQ1r6T5eIH_V1}`S zQTDHjHu*#^=cboKCdih4?IvnlIae-2&NW>N#KnLli{ygjR z9Pot*8RdNvn!cB2{d=t6WBm~cWR$!@(>-bG`?8L9_3_1YNCFw#^(T-w>o2grU|wv- z813~>+@=2XUFzRrz3hK`{dx48P3o6*p!<&IFYkx^ca#5gbmq(^df_f%hjNQv?mqc% zx5a_tm%MTgo9H+5L+5Ow;0Y<#3rKz$hxV5^8DFtp$%2TGQS?H;ZD@rf6#ZqB#6Hz( GwtoPgVJFl8 diff --git a/makefile b/makefile index 0b24ede..653d8cf 100644 --- a/makefile +++ b/makefile @@ -8,15 +8,18 @@ ## C compiler CC=tcc # much faster compilation than gcc +## Debugging options +DEBUG=-g#-g + ## Main file -SRC=./src/lisp.c +SRC=./src/mumble.c ## Formatter STYLE_BLUEPRINT=webkit FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) build: $(SRC) - $(CC) $(SRC) -o lisp + $(CC) $(SRC) -o mumble $(DEBUG) format: $(SRC) $(FORMATTER) $(SRC) diff --git a/notes/gbd-tutorial.txt b/notes/gbd-tutorial.txt new file mode 100644 index 0000000..d08b133 --- /dev/null +++ b/notes/gbd-tutorial.txt @@ -0,0 +1,130 @@ +From: + +In this article, let us discuss how to debug a c program using gdb debugger in 6 simple steps. + +### Write a sample C program with errors for debugging purpose + +To learn C program debugging, let us create the following C program that calculates and prints the factorial of a number. However this C program contains some errors in it for our debugging purpose. + +$ vim factorial.c +# include + +int main() +{ + int i, num, j; + printf ("Enter the number: "); + scanf ("%d", &num ); + + for (i=1; i - -int main(int argc, char** argv){ - puts("Hello world!"); - return 0; -} diff --git a/src/mumble.c b/src/mumble.c new file mode 100644 index 0000000..c162f6e --- /dev/null +++ b/src/mumble.c @@ -0,0 +1,20 @@ +#include + +static char input[2048]; + +int main(int argc, char** argv) +{ + puts("Mumble version 0.0.1\n"); + puts("Press Ctrl+C to exit\n"); + int loop = 1; + while (loop) { + fputs("mumble>", stdout); + void* catcher = fgets(input, 2048, stdin); + if (catcher == NULL) { + loop = 0; + } else { + printf("You said: %s", input); + } + } + return 0; +}