A 3rd party library have a list of defined status variables in a header
// <status.h> -- 3rd party header file
#define SUCCESS 0
#define FAILURE 1
#define OUT_OF_MEM 2
// ... and a lot of them ...
// Functions that return the above status
int Send();
I want to display the status names, i.e. those defined variable names
// "main.c"
#include <status.h>
#include <stdio.h>
void printstat(stat)
{ // Print out stat with variable name
// Example if 0, print "SUCCESS", and so on...
}
void main()
{
int stat = Send();
printstat(stat);
}
Because too much define status variables, so what is the easy way to do that?