void print_score(t_display_env *data, int line, int col) { int high_score; mvprintw(line + 2, col, "| High Score "); mvprintw(line + 2, col + 18, " |"); high_score = get_high_score(); print_nbr(high_score, line + 2, col + 13 + 4); mvprintw(line + 3, col, "| Score "); mvprintw(line + 3, col + 18, " |"); print_nbr(data->ev->score, line + 3, col + 13 + 4); }
void print_timer_next(int line, int col, int time) { int min; int sec; min = time / 60; sec = time - (60 * min); mvprintw(line + 8, col, "| Timer: "); mvprintw(line + 8, col + 13, "00:00"); mvprintw(line + 8, col + 18, " |"); print_nbr(min, line + 8, col + 14); print_nbr(sec, line + 8, col + 17); }
void print_level(t_display_env *data, int line, int col) { mvprintw(line + 6, col, "| Level "); mvprintw(line + 6, col + 16, "00"); mvprintw(line + 6, col + 18, " |"); print_nbr(data->ev->level, line + 6, col + 13 + 4); }
void print_nbr(int n) { int i; i = n / 10; if (i) print_nbr(n / 10); i = n % 10; if (i < 0) i *= -1; ft_putchar(i + '0'); }
int print_ptr(void *ptr) { int size; size = get_size(ptr); puthex((size_t)ptr); ft_putstr(" - "); puthex((size_t)(ptr + size)); ft_putstr(" : "); print_nbr(size); ft_putendl(" octets"); return (size); }
/******************************************************************* * Prints neighbor list from instance. *******************************************************************/ void print_nbr_list(struct sr_instance *sr) { struct pwospf_iflist* iface = sr->ospf_subsys->interfaces; int i; fprintf(stderr, "---NEIGHBOR LIST---\n"); while(iface) { fprintf(stderr, "%s: ", iface->name); for(i = 0; i < iface->nbr_size; i++) { print_nbr(iface->neighbors[i]); } fprintf(stderr, "\n"); iface = iface->next; } }