Pillow

Форк
0
/
Except.c 
72 строки · 1.4 Кб
1
/*
2
 * The Python Imaging Library
3
 * $Id$
4
 *
5
 * default exception handling
6
 *
7
 * This module is usually overridden by application code (e.g.
8
 * _imaging.c for PIL's standard Python bindings).  If you get
9
 * linking errors, remove this file from your project/library.
10
 *
11
 * history:
12
 * 1995-06-15 fl   Created
13
 * 1998-12-29 fl   Minor tweaks
14
 * 2003-09-13 fl   Added ImagingEnter/LeaveSection()
15
 *
16
 * Copyright (c) 1997-2003 by Secret Labs AB.
17
 * Copyright (c) 1995-2003 by Fredrik Lundh.
18
 *
19
 * See the README file for information on usage and redistribution.
20
 */
21

22
#include "Imaging.h"
23

24
/* exception state */
25

26
void *
27
ImagingError_OSError(void) {
28
    fprintf(stderr, "*** exception: file access error\n");
29
    return NULL;
30
}
31

32
void *
33
ImagingError_MemoryError(void) {
34
    fprintf(stderr, "*** exception: out of memory\n");
35
    return NULL;
36
}
37

38
void *
39
ImagingError_ModeError(void) {
40
    return ImagingError_ValueError("bad image mode");
41
}
42

43
void *
44
ImagingError_Mismatch(void) {
45
    return ImagingError_ValueError("images don't match");
46
}
47

48
void *
49
ImagingError_ValueError(const char *message) {
50
    if (!message) {
51
        message = "exception: bad argument to function";
52
    }
53
    fprintf(stderr, "*** %s\n", message);
54
    return NULL;
55
}
56

57
void
58
ImagingError_Clear(void) {
59
    /* nop */;
60
}
61

62
/* thread state */
63

64
void
65
ImagingSectionEnter(ImagingSectionCookie *cookie) {
66
    /* pass */
67
}
68

69
void
70
ImagingSectionLeave(ImagingSectionCookie *cookie) {
71
    /* pass */
72
}
73

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.