File: taerror.c

package info (click to toggle)
ttfautohint 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,504 kB
  • ctags: 4,347
  • sloc: ansic: 38,386; sh: 5,749; cpp: 4,131; perl: 340; makefile: 309; sed: 39
file content (59 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* taerror.c */

/*
 * Copyright (C) 2011-2016 by Werner Lemberg.
 *
 * This file is part of the ttfautohint library, and may only be used,
 * modified, and distributed under the terms given in `COPYING'.  By
 * continuing to use, modify, or distribute this file you indicate that you
 * have read `COPYING' and understand and accept it fully.
 *
 * The file `COPYING' mentioned in the previous paragraph is distributed
 * with the ttfautohint library.
 */


#include "ta.h"


/* error message strings; */
/* we concatenate FreeType and ttfautohint messages into one structure */

typedef const struct TA_error_
{
  int err_code;
  const char* err_msg;
} TA_error;

static TA_error TA_Errors[] =

#undef __FTERRORS_H__
#define FT_ERRORDEF(e, v, s) { e, s },
#define FT_ERROR_START_LIST {
#define FT_ERROR_END_LIST /* empty */
#include FT_ERRORS_H

#undef TTFAUTOHINT_ERRORS_H_
#define TA_ERRORDEF(e, v, s) { e, s },
#define TA_ERROR_START_LIST /* empty */
#define TA_ERROR_END_LIST { 0, NULL } };
#include <ttfautohint-errors.h>


const char*
TA_get_error_message(FT_Error error)
{
  TA_error* e = TA_Errors;


  while (e->err_code || e->err_msg)
  {
    if (e->err_code == error)
      return e->err_msg;
    e++;
  }

  return NULL;
}

/* end of taerror.c */