You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
788 B
24 lines
788 B
/**
|
|
* Forth printing
|
|
*
|
|
* Created on 2021/11/13.
|
|
*/
|
|
|
|
#ifndef FORTH_FH_PRINT_H
|
|
#define FORTH_FH_PRINT_H
|
|
|
|
/* for printing */
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include "fh_globals.h"
|
|
|
|
/* logging */
|
|
#define LOG(format, ...) do { if(fh_globals.verbose) { fprintf(stderr, format "\n", ##__VA_ARGS__); } } while (0)
|
|
#define LOGI(format, ...) fprintf(stderr, "\x1b[32m" format "\x1b[m\n", ##__VA_ARGS__)
|
|
#define LOGE(format, ...) fprintf(stderr, "\x1b[31;1m" format "\x1b[m\n", ##__VA_ARGS__)
|
|
|
|
/* Forth standard output. XXX should be stdout, but then colors get mangled if logging is used */
|
|
#define FHPRINT(format, ...) fprintf(stderr, "\x1b[33;1m" format "\x1b[m", ##__VA_ARGS__)
|
|
#define FHPRINT_SVC(format, ...) fprintf(stderr, "" format "", ##__VA_ARGS__)
|
|
|
|
#endif //FORTH_FH_PRINT_H
|
|
|