
commit
1bf43eacb9
5 changed files with 92 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||
|
BasedOnStyle: LLVM |
||||
|
PointerAlignment: Left |
@ -0,0 +1,46 @@ |
|||||
|
# Prerequisites |
||||
|
*.d |
||||
|
|
||||
|
# Object files |
||||
|
*.o |
||||
|
*.ko |
||||
|
*.obj |
||||
|
*.elf |
||||
|
|
||||
|
# Linker output |
||||
|
*.ilk |
||||
|
*.map |
||||
|
*.exp |
||||
|
|
||||
|
# Precompiled Headers |
||||
|
*.gch |
||||
|
*.pch |
||||
|
|
||||
|
# Libraries |
||||
|
*.lib |
||||
|
*.a |
||||
|
*.la |
||||
|
*.lo |
||||
|
|
||||
|
# Shared objects (inc. Windows DLLs) |
||||
|
*.dll |
||||
|
*.so |
||||
|
*.so.* |
||||
|
*.dylib |
||||
|
|
||||
|
# Executables |
||||
|
*.exe |
||||
|
*.out |
||||
|
*.app |
||||
|
*.i*86 |
||||
|
*.x86_64 |
||||
|
*.hex |
||||
|
|
||||
|
# Debug files |
||||
|
*.dSYM/ |
||||
|
*.su |
||||
|
*.idb |
||||
|
*.pdb |
||||
|
|
||||
|
# Default build dir |
||||
|
build/ |
@ -0,0 +1,20 @@ |
|||||
|
basic_flags := -std=c99 -Wall -Wpedantic -Wextra |
||||
|
debug_flags := -DDEBUG -O0 -ggdb -feliminate-unused-debug-symbols |
||||
|
library_flags := -lncurses |
||||
|
source_files := main.c |
||||
|
|
||||
|
all: debug |
||||
|
|
||||
|
build: |
||||
|
mkdir $@ |
||||
|
|
||||
|
build/debug build/release: | build |
||||
|
mkdir $@ |
||||
|
|
||||
|
.PHONY: debug |
||||
|
debug: | build/debug |
||||
|
cc $(basic_flags) $(debug_flags) $(source_files) -o build/debug/acro $(library_flags) |
||||
|
|
||||
|
.PHONY: clean |
||||
|
clean: |
||||
|
rm -rf build |
@ -0,0 +1 @@ |
|||||
|
A basic starting point for an ncurses C99 program. |
@ -0,0 +1,23 @@ |
|||||
|
#include <ncurses.h> |
||||
|
|
||||
|
int main() { |
||||
|
initscr(); // Initialize ncurses
|
||||
|
raw(); // Receive keyboard input immediately
|
||||
|
noecho(); // Don't echo keyboard input
|
||||
|
keypad(stdscr, TRUE); // Also receive arrow keys, etc.
|
||||
|
curs_set(0); // Hide the terminal cursor
|
||||
|
|
||||
|
printw("Type any character to see it in bold\n"); |
||||
|
refresh(); |
||||
|
int ch = getch(); |
||||
|
printw("Your character:\n"); |
||||
|
attron(A_BOLD); |
||||
|
printw(" %c\n", ch); |
||||
|
attroff(A_BOLD); |
||||
|
printw("Press any key to exit"); |
||||
|
attroff(A_BOLD); |
||||
|
refresh(); |
||||
|
getch(); |
||||
|
endwin(); |
||||
|
return 0; |
||||
|
} |
Loading…
Reference in new issue