projects
/
my-code
/
api.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor fixes + upgrades
[my-code/api.git]
/
display
/
display.c
diff --git
a/display/display.c
b/display/display.c
index
178ec62
..
bb9d707
100644
(file)
--- a/
display/display.c
+++ b/
display/display.c
@@
-8,7
+8,7
@@
#define USE_NCURSES
#define USE_NCURSES
-int display_init(t_display *display) {
+int display_init(t_display *display
,int outfd
) {
struct winsize ws;
struct winsize ws;
@@
-20,8
+20,10
@@
int display_init(t_display *display) {
display->max_x=ws.ws_col;
display->max_y=ws.ws_row;
display->max_x=ws.ws_col;
display->max_y=ws.ws_row;
- fprintf(stderr,"[display] initializing display, width: %02d / height: %02d \n"
- ,ws.ws_col,ws.ws_row);
+ display->outfd=outfd;
+
+ dprintf(display->outfd,"[display] initializing display, w: %02d / h: %02d\n",
+ ws.ws_col,ws.ws_row);
/* allocating 'screen' buffer */
if((display->screen=(char *)malloc(display->max_x*display->max_y))
/* allocating 'screen' buffer */
if((display->screen=(char *)malloc(display->max_x*display->max_y))
@@
-110,7
+112,7
@@
int display_shutdown(t_display *display) {
free(display->screen);
free(display->screen);
-
fprintf(stderr
,"[display] shutdown\n");
+
dprintf(display->outfd
,"[display] shutdown\n");
return D_SUCCESS;
}
return D_SUCCESS;
}