diff options
| author | dam <dam@gudinoff> | 2023-04-04 17:45:05 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-04-04 17:45:05 +0100 |
| commit | 98a21ce9edcd22bf7a9dde62f317f143e289ecf5 (patch) | |
| tree | 14613e8506a6fe481b2072fae7aad826809b1b19 /sizeof.c | |
| parent | ee5fa34d14288a4ce79d77a0d3a89cc14b16a6b1 (diff) | |
| download | task-time-tracker-98a21ce9edcd22bf7a9dde62f317f143e289ecf5.tar.zst task-time-tracker-98a21ce9edcd22bf7a9dde62f317f143e289ecf5.zip | |
WIP Making ncurses work a bit.
Diffstat (limited to 'sizeof.c')
| -rw-r--r-- | sizeof.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sizeof.c b/sizeof.c new file mode 100644 index 0000000..4844cba --- /dev/null +++ b/sizeof.c @@ -0,0 +1,47 @@ +// compile with : gcc sizeof.c -lncurses + +#include <assert.h> +#include <errno.h> +#include <inttypes.h> +#include <limits.h> +#include <locale.h> +#include <ncurses.h> +#include <signal.h> +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <time.h> + +int main(int argc, char **argv) { + initscr(); + + fprintf(stderr, "sizeof char: %d\n", sizeof(char)); + fprintf(stderr, "sizeof short: %d\n", sizeof(short)); + fprintf(stderr, "sizeof int: %d\n", sizeof(int)); + fprintf(stderr, "sizeof unsigned: %d\n", sizeof(unsigned)); + fprintf(stderr, "sizeof chtype: %d\n", sizeof(chtype)); + int w_size_x, w_size_y; + getmaxyx(stdscr, w_size_y, w_size_x); + char str[64]; + memset(str, 0, 64); + sprintf(str, "x,y : %dx%d\n", w_size_x, w_size_y); + mvaddstr(2, 2, str); + + unsigned m = ACS_DIAMOND; + fprintf(stderr, "sizeof ACS %d\n", sizeof(ACS_DIAMOND)); + + if (ACS_DIAMOND != 0 || ACS_URCORNER != 0){ + fprintf(stderr, "BAZINGA\n"); + } +// fprintf(stderr, ">%d<\n", strlen(ACS_DIAMOND)); + + mvaddch(0, 0, m); + getch(); + endwin(); +} + |
