1 /*
2  * cups - Python bindings for CUPS
3  * Copyright (C) 2006-2020  Tim Waugh <twaugh@redhat.com>
4  * Authors: Tim Waugh <twaugh@redhat.com>
5  *          Zdenek Dohnal <zdohnal@redhat.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20  */
21 
22 #ifndef HAVE_CUPSMODULE_H
23 #define HAVE_CUPSMODULE_H
24 
25 #include <cups/cups.h>
26 #include <cups/language.h>
27 #include <cups/adminutil.h>
28 
29 /* GCC attributes */
30 #if !defined(__GNUC__) || __GNUC__ < 2 || \
31     (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
32 # define FORMAT(x)
33 #else /* GNU C: */
34 # define FORMAT(x) __attribute__ ((__format__ x))
35 #endif
36 
37 extern void debugprintf (const char *fmt, ...) FORMAT ((__printf__, 1, 2));
38 
39 struct TLS
40 {
41     PyObject *cups_password_callback;
42     PyObject *cups_password_callback_context;
43 };
44 
45 extern struct TLS *get_TLS (void);
46 
47 typedef struct
48 {
49   PyObject *cb;
50   PyObject *user_data;
51 } CallbackContext;
52 
53 extern const char * UTF8_from_PyObj (char **const utf8, PyObject *obj);
54 
55 #endif /* HAVE_CUPSMODULE_H */
56