TODO: Addition.
[ttfautohint.git] / lib / taerror.c
blob7653a1ea25194bbccdda7cfa0bcbe0ace448b5f7
1 /* taerror.c */
3 /*
4 * Copyright (C) 2011-2012 by Werner Lemberg.
6 * This file is part of the ttfautohint library, and may only be used,
7 * modified, and distributed under the terms given in `COPYING'. By
8 * continuing to use, modify, or distribute this file you indicate that you
9 * have read `COPYING' and understand and accept it fully.
11 * The file `COPYING' mentioned in the previous paragraph is distributed
12 * with the ttfautohint library.
16 #include "ta.h"
19 /* error message strings; */
20 /* we concatenate FreeType and ttfautohint messages into one structure */
22 typedef const struct TA_error_
24 int err_code;
25 const char* err_msg;
26 } TA_error;
28 TA_error TA_Errors[] =
30 #undef __FTERRORS_H__
31 #define FT_ERRORDEF(e, v, s) { e, s },
32 #define FT_ERROR_START_LIST {
33 #define FT_ERROR_END_LIST /* empty */
34 #include FT_ERRORS_H
36 #undef __TTFAUTOHINT_ERRORS_H__
37 #define TA_ERRORDEF(e, v, s) { e, s },
38 #define TA_ERROR_START_LIST /* empty */
39 #define TA_ERROR_END_LIST { 0, NULL } };
40 #include <ttfautohint-errors.h>
43 const char*
44 TA_get_error_message(FT_Error error)
46 TA_error* e = TA_Errors;
49 while (e->err_code || e->err_msg)
51 if (e->err_code == error)
52 return e->err_msg;
53 e++;
56 return NULL;
59 /* end of taerror.c */