ltk

Socket-based GUI for X11 (WIP)
git clone git://lumidify.org/ltk.git (fast, but not encrypted)
git clone https://lumidify.org/git/ltk.git (encrypted, but very slow)
Log | Files | Refs | README | LICENSE

err.c (668B)


      1 #include "err.h"
      2 
      3 static const char *errtable[] = {
      4 	"None",
      5 	"Widget already in container",
      6 	"Widget not in container",
      7 	"Widget id already in use",
      8 	"Invalid number of arguments",
      9 	"Invalid argument",
     10 	"Invalid index",
     11 	"Invalid widget id",
     12 	"Invalid widget type",
     13 	"Invalid command",
     14 	"Unknown error",
     15 	"Menu is not submenu",
     16 	"Menu entry already contains submenu",
     17 	"Invalid grid position",
     18 	"Invalid sequence number",
     19 };
     20 
     21 #define LENGTH(X) (sizeof(X) / sizeof(X[0]))
     22 
     23 const char *
     24 errtype_to_string(ltk_errtype type) {
     25 	if (type < 0 || type >= LENGTH(errtable)) {
     26 		/* that's a funny error, now isn't it? */
     27 		return "Invalid error";
     28 	}
     29 	return errtable[type];
     30 }