static int ft_custom(void) { int key; int choice; clear(); choice = 2; print_custom(2); while ((key = getch()) != 27 && key != '\n') { if (key == KEY_LEFT) choice--; else if (key == KEY_RIGHT) choice++; if (choice < 2) choice = 2; else if (choice > 30) choice = 30; print_custom(choice); } if (key == 27) return (-1); return (choice); }
// get all data from main process and print it on device static int output_process(void){ printf("DEBUG: output process entered\n"); while(*mode_shm != '0'){ if(*mode_shm == '1'){ print_stopwatch(); } if(*mode_shm == '2'){ print_texteditor(); } if(*mode_shm == '3'){ print_custom(); } } printf("DEBUG: output process ended\n"); return 0; }
/** Computes all the Voronoi cells and saves customized * information about them * \param[in] format the custom output string to use. * \param[in] filename the name of the file to write to. */ void container_periodic_poly::print_custom(const char *format,const char *filename) { FILE *fp=safe_fopen(filename,"w"); print_custom(format,fp); fclose(fp); }
/** Computes all the Voronoi cells and saves customized * information about them. * \param[in] format the custom output string to use. * \param[in] fp a file handle to write to. */ void container_periodic_poly::print_custom(const char *format,FILE *fp) { c_loop_all_periodic vl(*this); print_custom(vl,format,fp); }