apps/top.c
/**
 * @brief Print the column headings.
 */
@brief Print the column headings.
@brief Print the column headings .
void print_header(void) {
	printf("\033[44;30m");
	for (int * c = columns; *c; ++c) {
		if (*c == sort_column) printf("\033[97m");
		printf("%*s ", ColumnDescriptions[*c].width, ColumnDescriptions[*c].title);
		if (*c == sort_column) printf("\033[30m");
	}
	if (sort_column == COLUMN_NONE) {
		printf("\033[1;97mCMD\033[30m");
	} else {
		printf("CMD");
	}
	printf("\033[K\033[0m\n");
}
void print_header ( void ) { printf ( " \033 " ) ; for ( int * c = columns ; * c ; ++ c ) { if ( * c == sort_column ) printf ( " \033 " ) ; printf ( " " , ColumnDescriptions [ * c ] . width , ColumnDescriptions [ * c ] . title ) ; if ( * c == sort_column ) printf ( " \033 " ) ; } if ( sort_column == COLUMN_NONE ) { printf ( " \033 \033 " ) ; } else { printf ( " " ) ; } printf ( " \033 \033 \n " ) ; }
@brief Print the column headings.
@brief Print the column headings .