Pillow
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
26void *27ImagingError_OSError(void) {28fprintf(stderr, "*** exception: file access error\n");29return NULL;30}
31
32void *33ImagingError_MemoryError(void) {34fprintf(stderr, "*** exception: out of memory\n");35return NULL;36}
37
38void *39ImagingError_ModeError(void) {40return ImagingError_ValueError("bad image mode");41}
42
43void *44ImagingError_Mismatch(void) {45return ImagingError_ValueError("images don't match");46}
47
48void *49ImagingError_ValueError(const char *message) {50if (!message) {51message = "exception: bad argument to function";52}53fprintf(stderr, "*** %s\n", message);54return NULL;55}
56
57void
58ImagingError_Clear(void) {59/* nop */;60}
61
62/* thread state */
63
64void
65ImagingSectionEnter(ImagingSectionCookie *cookie) {66/* pass */67}
68
69void
70ImagingSectionLeave(ImagingSectionCookie *cookie) {71/* pass */72}
73