File: ftsupport.c

package info (click to toggle)
renpy 8.3.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 86,772 kB
  • sloc: python: 55,363; ansic: 13,858; javascript: 849; makefile: 87; sh: 13
file content (32 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (6)
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
#include "pyfreetype.h"
#include <stdio.h>

#undef __FTERRORS_H__
#define FT_ERRORDEF( e, v, s )  { e, s },
#define FT_ERROR_START_LIST
#define FT_ERROR_END_LIST       { 0, 0 }
const struct {
	int          err_code;
	char*  err_msg;
} ft_errors[] = {
#include FT_ERRORS_H
};


char *freetype_error_to_string(int code) {

    int i = 0;

    while (1) {

    	if (ft_errors[i].err_code == code) {
    		return ft_errors[i].err_msg;
    	}

    	if (ft_errors[i].err_msg == NULL) {
    		return "unknown error";
    	}

    	i += 1;
    }
}