annotate Modules/clmodule.c @ 4566:6403c94de50d legacy-trunk

Added safeguard against failure in __del__.
author Guido van Rossum <guido@python.org>
date Wed, 27 Nov 1996 19:39:58 +0000
parents 65d2d8e67da3
children d36250aefb82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
1 /***********************************************************
2061
172ba04a5191 Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
172ba04a5191 Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
3 The Netherlands.
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
4
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
5 All Rights Reserved
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
6
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
8 documentation for any purpose and without fee is hereby granted,
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
9 provided that the above copyright notice appear in all copies and that
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
10 both that copyright notice and this permission notice appear in
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
11 supporting documentation, and that the names of Stichting Mathematisch
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
12 Centrum or CWI or Corporation for National Research Initiatives or
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
13 CNRI not be used in advertising or publicity pertaining to
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
14 distribution of the software without specific, written prior
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
15 permission.
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
16
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
17 While CWI is the initial source for this software, a modified version
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
18 is made available by the Corporation for National Research Initiatives
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
19 (CNRI) at the Internet address ftp://ftp.python.org.
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
20
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2714
diff changeset
28 PERFORMANCE OF THIS SOFTWARE.
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
29
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
30 ******************************************************************/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
31
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
32
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
33 /* Cl objects */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
34
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
35 #define CLDEBUG
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
36
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
37 #include <stdarg.h>
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
38 #include <cl.h>
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
39 #include "allobjects.h"
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
40 #include "modsupport.h" /* For getargs() etc. */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
41 #include "ceval.h" /* For call_object() */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
42
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
43 typedef struct {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
44 OB_HEAD
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
45 int ob_isCompressor; /* Compressor or Decompressor */
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
46 CL_Handle ob_compressorHdl;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
47 int *ob_paramtypes;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
48 int ob_nparams;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
49 } clobject;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
50
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
51 static object *ClError; /* exception cl.error */
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
52
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
53 static int error_handler_called = 0;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
54
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
55 /*
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
56 * We want to use the function prototypes that are available in the C
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
57 * compiler on the SGI. Because of that, we need to declare the first
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
58 * argument of the compressor and decompressor methods as "object *",
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
59 * even though they are really "clobject *". Therefore we cast the
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
60 * argument to the proper type using this macro.
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
61 */
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
62 #define SELF ((clobject *) self)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
63
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
64 /********************************************************************
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
65 Utility routines.
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
66 ********************************************************************/
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
67 static void
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
68 cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
69 {
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
70 va_list ap;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
71 char errbuf[BUFSIZ]; /* hopefully big enough */
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
72 char *p;
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
73
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
74 if (err_occurred()) /* don't change existing error */
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
75 return;
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
76 error_handler_called = 1;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
77 va_start(ap, fmt);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
78 vsprintf(errbuf, fmt, ap);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
79 va_end(ap);
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
80 p = &errbuf[strlen(errbuf) - 1]; /* swat the line feed */
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
81 if (*p == '\n')
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
82 *p = 0;
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
83 err_setstr(ClError, errbuf);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
84 }
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
85
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
86 /*
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
87 * This assumes that params are always in the range 0 to some maximum.
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
88 */
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
89 static int
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
90 param_type_is_float(clobject *self, int param)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
91 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
92 int bufferlength;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
93 int ret;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
94
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
95 if (self->ob_paramtypes == NULL) {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
96 error_handler_called = 0;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
97 bufferlength = clQueryParams(self->ob_compressorHdl, 0, 0);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
98 if (error_handler_called)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
99 return -1;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
100
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
101 self->ob_paramtypes = NEW(int, bufferlength);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
102 if (self->ob_paramtypes == NULL)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
103 return -1;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
104 self->ob_nparams = bufferlength / 2;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
105
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
106 (void) clQueryParams(self->ob_compressorHdl, self->ob_paramtypes, bufferlength);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
107 if (error_handler_called) {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
108 DEL(self->ob_paramtypes);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
109 self->ob_paramtypes = NULL;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
110 return -1;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
111 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
112 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
113
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
114 if (param < 0 || param >= self->ob_nparams)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
115 return -1;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
116
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
117 if (self->ob_paramtypes[param*2 + 1] == CL_FLOATING_ENUM_VALUE ||
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
118 self->ob_paramtypes[param*2 + 1] == CL_FLOATING_RANGE_VALUE)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
119 return 1;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
120 else
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
121 return 0;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
122 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
123
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
124 /********************************************************************
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
125 Single image compression/decompression.
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
126 ********************************************************************/
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
127 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
128 cl_CompressImage(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
129 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
130 int compressionScheme, width, height, originalFormat;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
131 float compressionRatio;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
132 int frameBufferSize, compressedBufferSize;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
133 char *frameBuffer;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
134 object *compressedBuffer;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
135
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
136 if (!getargs(args, "(iiiifs#)", &compressionScheme, &width, &height,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
137 &originalFormat, &compressionRatio, &frameBuffer,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
138 &frameBufferSize))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
139 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
140
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
141 retry:
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
142 compressedBuffer = newsizedstringobject(NULL, frameBufferSize);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
143 if (compressedBuffer == NULL)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
144 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
145
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
146 compressedBufferSize = frameBufferSize;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
147 error_handler_called = 0;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
148 if (clCompressImage(compressionScheme, width, height, originalFormat,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
149 compressionRatio, (void *) frameBuffer,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
150 &compressedBufferSize,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
151 (void *) getstringvalue(compressedBuffer))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
152 == FAILURE) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
153 DECREF(compressedBuffer);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
154 if (!error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
155 err_setstr(ClError, "clCompressImage failed");
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
156 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
157 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
158
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
159 if (compressedBufferSize > frameBufferSize) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
160 frameBufferSize = compressedBufferSize;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
161 DECREF(compressedBuffer);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
162 goto retry;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
163 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
164
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
165 if (compressedBufferSize < frameBufferSize)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
166 if (resizestring(&compressedBuffer, compressedBufferSize))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
167 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
168
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
169 return compressedBuffer;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
170 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
171
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
172 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
173 cl_DecompressImage(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
174 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
175 int compressionScheme, width, height, originalFormat;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
176 char *compressedBuffer;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
177 int compressedBufferSize, frameBufferSize;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
178 object *frameBuffer;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
179
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
180 if (!getargs(args, "(iiiis#)", &compressionScheme, &width, &height,
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
181 &originalFormat, &compressedBuffer,
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
182 &compressedBufferSize))
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
183 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
184
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
185 frameBufferSize = width * height * CL_BytesPerPixel(originalFormat);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
186
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
187 frameBuffer = newsizedstringobject(NULL, frameBufferSize);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
188 if (frameBuffer == NULL)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
189 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
190
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
191 error_handler_called = 0;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
192 if (clDecompressImage(compressionScheme, width, height, originalFormat,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
193 compressedBufferSize, compressedBuffer,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
194 (void *) getstringvalue(frameBuffer)) == FAILURE) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
195 DECREF(frameBuffer);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
196 if (!error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
197 err_setstr(ClError, "clDecompressImage failed");
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
198 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
199 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
200
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
201 return frameBuffer;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
202 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
203
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
204 /********************************************************************
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
205 Sequential compression/decompression.
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
206 ********************************************************************/
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
207 #define CheckCompressor(self) if ((self)->ob_compressorHdl == NULL) { \
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
208 err_setstr(RuntimeError, "(de)compressor not active"); \
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
209 return NULL; \
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
210 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
211
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
212 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
213 doClose(clobject *self, object *args, int (*close_func)(CL_Handle))
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
214 {
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
215 CheckCompressor(self);
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
216
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
217 if (!getnoarg(args))
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
218 return NULL;
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
219
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
220 error_handler_called = 0;
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
221 if ((*close_func)(self->ob_compressorHdl) == FAILURE) {
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
222 if (!error_handler_called)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
223 err_setstr(ClError, "close failed");
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
224 return NULL;
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
225 }
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
226
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
227 self->ob_compressorHdl = NULL;
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
228
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
229 if (self->ob_paramtypes)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
230 DEL(self->ob_paramtypes);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
231 self->ob_paramtypes = NULL;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
232
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
233 INCREF(None);
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
234 return None;
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
235 }
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
236
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
237 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
238 clm_CloseCompressor(object *self, object *args)
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
239 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
240 return doClose(SELF, args, clCloseCompressor);
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
241 }
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
242
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
243 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
244 clm_CloseDecompressor(object *self, object *args)
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
245 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
246 return doClose(SELF, args, clCloseDecompressor);
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
247 }
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
248
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
249 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
250 clm_Compress(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
251 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
252 int numberOfFrames;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
253 int frameBufferSize, compressedBufferSize, size;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
254 char *frameBuffer;
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
255 object *data;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
256
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
257 CheckCompressor(SELF);
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
258
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
259 if (!getargs(args, "(is#)", &numberOfFrames, &frameBuffer, &frameBufferSize))
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
260 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
261
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
262 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
263 size = clGetParam(SELF->ob_compressorHdl, CL_COMPRESSED_BUFFER_SIZE);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
264 compressedBufferSize = size;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
265 if (error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
266 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
267
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
268 data = newsizedstringobject(NULL, size);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
269 if (data == NULL)
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
270 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
271
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
272 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
273 if (clCompress(SELF->ob_compressorHdl, numberOfFrames,
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
274 (void *) frameBuffer, &compressedBufferSize,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
275 (void *) getstringvalue(data)) == FAILURE) {
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
276 DECREF(data);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
277 if (!error_handler_called)
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
278 err_setstr(ClError, "compress failed");
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
279 return NULL;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
280 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
281
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
282 if (compressedBufferSize < size)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
283 if (resizestring(&data, compressedBufferSize))
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
284 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
285
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
286 if (compressedBufferSize > size) {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
287 /* we didn't get all "compressed" data */
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
288 DECREF(data);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
289 err_setstr(ClError, "compressed data is more than fitted");
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
290 return NULL;
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
291 }
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
292
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
293 return data;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
294 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
295
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
296 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
297 clm_Decompress(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
298 {
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
299 object *data;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
300 int numberOfFrames;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
301 char *compressedData;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
302 int compressedDataSize, dataSize;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
303
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
304 CheckCompressor(SELF);
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
305
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
306 if (!getargs(args, "(is#)", &numberOfFrames, &compressedData,
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
307 &compressedDataSize))
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
308 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
309
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
310 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
311 dataSize = clGetParam(SELF->ob_compressorHdl, CL_FRAME_BUFFER_SIZE);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
312 if (error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
313 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
314
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
315 data = newsizedstringobject(NULL, dataSize);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
316 if (data == NULL)
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
317 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
318
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
319 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
320 if (clDecompress(SELF->ob_compressorHdl, numberOfFrames,
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
321 compressedDataSize, (void *) compressedData,
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
322 (void *) getstringvalue(data)) == FAILURE) {
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
323 DECREF(data);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
324 if (!error_handler_called)
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
325 err_setstr(ClError, "decompress failed");
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
326 return NULL;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
327 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
328
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
329 return data;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
330 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
331
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
332 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
333 doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
334 int modified)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
335 {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
336 object *list, *v;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
337 int *PVbuffer;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
338 int length;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
339 int i;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
340 float number;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
341
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
342 CheckCompressor(self);
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
343
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
344 if (!getargs(args, "O", &list))
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
345 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
346 if (!is_listobject(list)) {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
347 err_badarg();
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
348 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
349 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
350 length = getlistsize(list);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
351 PVbuffer = NEW(int, length);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
352 if (PVbuffer == NULL)
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
353 return err_nomem();
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
354 for (i = 0; i < length; i++) {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
355 v = getlistitem(list, i);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
356 if (is_floatobject(v)) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
357 number = getfloatvalue(v);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
358 PVbuffer[i] = CL_TypeIsInt(number);
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
359 } else if (is_intobject(v)) {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
360 PVbuffer[i] = getintvalue(v);
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
361 if ((i & 1) &&
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
362 param_type_is_float(self, PVbuffer[i-1]) > 0) {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
363 number = PVbuffer[i];
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
364 PVbuffer[i] = CL_TypeIsInt(number);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
365 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
366 } else {
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
367 DEL(PVbuffer);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
368 err_badarg();
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
369 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
370 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
371 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
372
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
373 error_handler_called = 0;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
374 (*func)(self->ob_compressorHdl, PVbuffer, length);
1334
f3848f74b282 * clmodule.c (doParams): free PVbuffer in error condition.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1252
diff changeset
375 if (error_handler_called) {
f3848f74b282 * clmodule.c (doParams): free PVbuffer in error condition.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1252
diff changeset
376 DEL(PVbuffer);
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
377 return NULL;
1334
f3848f74b282 * clmodule.c (doParams): free PVbuffer in error condition.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1252
diff changeset
378 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
379
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
380 if (modified) {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
381 for (i = 0; i < length; i++) {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
382 if ((i & 1) &&
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
383 param_type_is_float(self, PVbuffer[i-1]) > 0) {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
384 number = CL_TypeIsFloat(PVbuffer[i]);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
385 v = newfloatobject(number);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
386 } else
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
387 v = newintobject(PVbuffer[i]);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
388 setlistitem(list, i, v);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
389 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
390 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
391
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
392 DEL(PVbuffer);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
393
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
394 INCREF(None);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
395 return None;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
396 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
397
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
398 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
399 clm_GetParams(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
400 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
401 return doParams(SELF, args, clGetParams, 1);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
402 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
403
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
404 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
405 clm_SetParams(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
406 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
407 return doParams(SELF, args, clSetParams, 0);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
408 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
409
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
410 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
411 do_get(clobject *self, object *args, int (*func)(CL_Handle, int))
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
412 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
413 int paramID, value;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
414 float fvalue;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
415
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
416 CheckCompressor(self);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
417
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
418 if (!getargs(args, "i", &paramID))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
419 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
420
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
421 error_handler_called = 0;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
422 value = (*func)(self->ob_compressorHdl, paramID);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
423 if (error_handler_called)
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
424 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
425
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
426 if (param_type_is_float(self, paramID) > 0) {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
427 fvalue = CL_TypeIsFloat(value);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
428 return newfloatobject(fvalue);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
429 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
430
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
431 return newintobject(value);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
432 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
433
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
434 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
435 clm_GetParam(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
436 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
437 return do_get(SELF, args, clGetParam);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
438 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
439
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
440 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
441 clm_GetDefault(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
442 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
443 return do_get(SELF, args, clGetDefault);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
444 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
445
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
446 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
447 clm_SetParam(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
448 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
449 int paramID, value;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
450 float fvalue;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
451
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
452 CheckCompressor(SELF);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
453
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
454 if (!getargs(args, "(ii)", &paramID, &value)) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
455 err_clear();
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
456 if (!getargs(args, "(if)", &paramID, &fvalue)) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
457 err_clear();
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
458 err_setstr(TypeError, "bad argument list (format '(ii)' or '(if)')");
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
459 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
460 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
461 value = CL_TypeIsInt(fvalue);
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
462 } else {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
463 if (param_type_is_float(SELF, paramID) > 0) {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
464 fvalue = value;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
465 value = CL_TypeIsInt(fvalue);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
466 }
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
467 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
468
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
469 error_handler_called = 0;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
470 value = clSetParam(SELF->ob_compressorHdl, paramID, value);
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
471 if (error_handler_called)
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
472 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
473
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
474 if (param_type_is_float(SELF, paramID) > 0)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
475 return newfloatobject(CL_TypeIsFloat(value));
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
476 else
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
477 return newintobject(value);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
478 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
479
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
480 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
481 clm_GetParamID(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
482 {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
483 char *name;
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
484 int value;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
485
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
486 CheckCompressor(SELF);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
487
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
488 if (!getargs(args, "s", &name))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
489 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
490
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
491 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
492 value = clGetParamID(SELF->ob_compressorHdl, name);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
493 if (value == FAILURE) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
494 if (!error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
495 err_setstr(ClError, "getparamid failed");
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
496 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
497 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
498
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
499 return newintobject(value);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
500 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
501
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
502 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
503 clm_QueryParams(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
504 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
505 int bufferlength;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
506 int *PVbuffer;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
507 object *list;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
508 int i;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
509
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
510 CheckCompressor(SELF);
1070
1a54d320f296 Fixed the last known bugs.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1061
diff changeset
511
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
512 if (!getnoarg(args))
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
513 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
514
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
515 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
516 bufferlength = clQueryParams(SELF->ob_compressorHdl, 0, 0);
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
517 if (error_handler_called)
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
518 return NULL;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
519
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
520 PVbuffer = NEW(int, bufferlength);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
521 if (PVbuffer == NULL)
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
522 return err_nomem();
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
523
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
524 bufferlength = clQueryParams(SELF->ob_compressorHdl, PVbuffer,
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
525 bufferlength);
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
526 if (error_handler_called) {
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
527 DEL(PVbuffer);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
528 return NULL;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
529 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
530
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
531 list = newlistobject(bufferlength);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
532 if (list == NULL) {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
533 DEL(PVbuffer);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
534 return NULL;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
535 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
536
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
537 for (i = 0; i < bufferlength; i++) {
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
538 if (i & 1)
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
539 setlistitem(list, i, newintobject(PVbuffer[i]));
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
540 else if (PVbuffer[i] == 0) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
541 INCREF(None);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
542 setlistitem(list, i, None);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
543 } else
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
544 setlistitem(list, i, newstringobject((char *) PVbuffer[i]));
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
545 }
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
546
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
547 DEL(PVbuffer);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
548
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
549 return list;
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
550 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
551
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
552 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
553 clm_GetMinMax(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
554 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
555 int param, min, max;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
556 float fmin, fmax;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
557
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
558 CheckCompressor(SELF);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
559
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
560 if (!getargs(args, "i", &param))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
561 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
562
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
563 clGetMinMax(SELF->ob_compressorHdl, param, &min, &max);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
564
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
565 if (param_type_is_float(SELF, param) > 0) {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
566 fmin = CL_TypeIsFloat(min);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
567 fmax = CL_TypeIsFloat(max);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
568 return mkvalue("(ff)", fmin, fmax);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
569 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
570
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
571 return mkvalue("(ii)", min, max);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
572 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
573
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
574 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
575 clm_GetName(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
576 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
577 int param;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
578 char *name;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
579
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
580 CheckCompressor(SELF);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
581
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
582 if (!getargs(args, "i", &param))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
583 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
584
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
585 error_handler_called = 0;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
586 name = clGetName(SELF->ob_compressorHdl, param);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
587 if (name == NULL || error_handler_called) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
588 if (!error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
589 err_setstr(ClError, "getname failed");
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
590 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
591 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
592
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
593 return newstringobject(name);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
594 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
595
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
596 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
597 clm_QuerySchemeFromHandle(object *self, object *args)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
598 {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
599 CheckCompressor(SELF);
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
600
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
601 if (!getnoarg(args))
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
602 return NULL;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
603
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
604 return newintobject(clQuerySchemeFromHandle(SELF->ob_compressorHdl));
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
605 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
606
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
607 static object *
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
608 clm_ReadHeader(object *self, object *args)
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
609 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
610 char *header;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
611 int headerSize;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
612
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
613 CheckCompressor(SELF);
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
614
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
615 if (!getargs(args, "s#", &header, &headerSize))
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
616 return NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
617
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
618 return newintobject(clReadHeader(SELF->ob_compressorHdl,
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
619 headerSize, header));
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
620 }
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
621
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
622 static struct methodlist compressor_methods[] = {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
623 {"close", clm_CloseCompressor}, /* alias */
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
624 {"CloseCompressor", clm_CloseCompressor},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
625 {"Compress", clm_Compress},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
626 {"GetDefault", clm_GetDefault},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
627 {"GetMinMax", clm_GetMinMax},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
628 {"GetName", clm_GetName},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
629 {"GetParam", clm_GetParam},
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
630 {"GetParamID", clm_GetParamID},
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
631 {"GetParams", clm_GetParams},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
632 {"QueryParams", clm_QueryParams},
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
633 {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
634 {"SetParam", clm_SetParam},
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
635 {"SetParams", clm_SetParams},
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
636 {NULL, NULL} /* sentinel */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
637 };
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
638
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
639 static struct methodlist decompressor_methods[] = {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
640 {"close", clm_CloseDecompressor}, /* alias */
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
641 {"CloseDecompressor", clm_CloseDecompressor},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
642 {"Decompress", clm_Decompress},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
643 {"GetDefault", clm_GetDefault},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
644 {"GetMinMax", clm_GetMinMax},
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
645 {"GetName", clm_GetName},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
646 {"GetParam", clm_GetParam},
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
647 {"GetParamID", clm_GetParamID},
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
648 {"GetParams", clm_GetParams},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
649 {"ReadHeader", clm_ReadHeader},
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
650 {"QueryParams", clm_QueryParams},
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
651 {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
652 {"SetParam", clm_SetParam},
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
653 {"SetParams", clm_SetParams},
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
654 {NULL, NULL} /* sentinel */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
655 };
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
656
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
657 static void
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
658 cl_dealloc(object *self)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
659 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
660 if (SELF->ob_compressorHdl) {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
661 if (SELF->ob_isCompressor)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
662 clCloseCompressor(SELF->ob_compressorHdl);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
663 else
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
664 clCloseDecompressor(SELF->ob_compressorHdl);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
665 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
666 DEL(self);
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
667 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
668
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
669 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
670 cl_getattr(object *self, char *name)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
671 {
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
672 if (SELF->ob_isCompressor)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
673 return findmethod(compressor_methods, self, name);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
674 else
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
675 return findmethod(decompressor_methods, self, name);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
676 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
677
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
678 static typeobject Cltype = {
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
679 OB_HEAD_INIT(&Typetype)
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
680 0, /*ob_size*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
681 "cl", /*tp_name*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
682 sizeof(clobject), /*tp_size*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
683 0, /*tp_itemsize*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
684 /* methods */
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1334
diff changeset
685 (destructor)cl_dealloc, /*tp_dealloc*/
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
686 0, /*tp_print*/
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1334
diff changeset
687 (getattrfunc)cl_getattr, /*tp_getattr*/
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
688 0, /*tp_setattr*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
689 0, /*tp_compare*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
690 0, /*tp_repr*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
691 0, /*tp_as_number*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
692 0, /*tp_as_sequence*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
693 0, /*tp_as_mapping*/
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
694 };
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
695
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
696 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
697 doOpen(object *self, object *args, int (*open_func)(int, CL_Handle *),
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
698 int iscompressor)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
699 {
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
700 int scheme;
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
701 clobject *new;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
702
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
703 if (!getargs(args, "i", &scheme))
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
704 return NULL;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
705
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
706 new = NEWOBJ(clobject, &Cltype);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
707 if (new == NULL)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
708 return NULL;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
709
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
710 new->ob_compressorHdl = NULL;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
711 new->ob_isCompressor = iscompressor;
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
712 new->ob_paramtypes = NULL;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
713
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
714 error_handler_called = 0;
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
715 if ((*open_func)(scheme, &new->ob_compressorHdl) == FAILURE) {
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
716 DECREF(new);
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
717 if (!error_handler_called)
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
718 err_setstr(ClError, "Open(De)Compressor failed");
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
719 return NULL;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
720 }
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1334
diff changeset
721 return (object *)new;
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
722 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
723
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
724 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
725 cl_OpenCompressor(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
726 {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
727 return doOpen(self, args, clOpenCompressor, 1);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
728 }
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
729
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
730 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
731 cl_OpenDecompressor(object *self, object *args)
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
732 {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
733 return doOpen(self, args, clOpenDecompressor, 0);
1075
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
734 }
98cb6a1252cb Lots of little fixes.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1070
diff changeset
735
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
736 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
737 cl_QueryScheme(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
738 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
739 char *header;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
740 int headerlen;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
741 int scheme;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
742
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
743 if (!getargs(args, "s#", &header, &headerlen))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
744 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
745
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
746 scheme = clQueryScheme(header);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
747 if (scheme < 0) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
748 err_setstr(ClError, "unknown compression scheme");
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
749 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
750 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
751
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
752 return newintobject(scheme);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
753 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
754
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
755 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
756 cl_QueryMaxHeaderSize(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
757 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
758 int scheme;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
759
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
760 if (!getargs(args, "i", &scheme))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
761 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
762
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
763 return newintobject(clQueryMaxHeaderSize(scheme));
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
764 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
765
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
766 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
767 cl_QueryAlgorithms(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
768 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
769 int algorithmMediaType;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
770 int bufferlength;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
771 int *PVbuffer;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
772 object *list;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
773 int i;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
774
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
775 if (!getargs(args, "i", &algorithmMediaType))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
776 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
777
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
778 error_handler_called = 0;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
779 bufferlength = clQueryAlgorithms(algorithmMediaType, 0, 0);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
780 if (error_handler_called)
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
781 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
782
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
783 PVbuffer = NEW(int, bufferlength);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
784 if (PVbuffer == NULL)
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
785 return err_nomem();
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
786
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
787 bufferlength = clQueryAlgorithms(algorithmMediaType, PVbuffer,
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
788 bufferlength);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
789 if (error_handler_called) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
790 DEL(PVbuffer);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
791 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
792 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
793
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
794 list = newlistobject(bufferlength);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
795 if (list == NULL) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
796 DEL(PVbuffer);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
797 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
798 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
799
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
800 for (i = 0; i < bufferlength; i++) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
801 if (i & 1)
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
802 setlistitem(list, i, newintobject(PVbuffer[i]));
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
803 else if (PVbuffer[i] == 0) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
804 INCREF(None);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
805 setlistitem(list, i, None);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
806 } else
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
807 setlistitem(list, i, newstringobject((char *) PVbuffer[i]));
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
808 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
809
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
810 DEL(PVbuffer);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
811
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
812 return list;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
813 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
814
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
815 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
816 cl_QuerySchemeFromName(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
817 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
818 int algorithmMediaType;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
819 char *name;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
820 int scheme;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
821
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
822 if (!getargs(args, "(is)", &algorithmMediaType, &name))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
823 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
824
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
825 error_handler_called = 0;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
826 scheme = clQuerySchemeFromName(algorithmMediaType, name);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
827 if (error_handler_called) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
828 err_setstr(ClError, "unknown compression scheme");
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
829 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
830 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
831
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
832 return newintobject(scheme);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
833 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
834
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
835 static object *
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
836 cl_GetAlgorithmName(object *self, object *args)
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
837 {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
838 int scheme;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
839 char *name;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
840
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
841 if (!getargs(args, "i", &scheme))
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
842 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
843
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
844 name = clGetAlgorithmName(scheme);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
845 if (name == 0) {
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
846 err_setstr(ClError, "unknown compression scheme");
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
847 return NULL;
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
848 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
849
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
850 return newstringobject(name);
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
851 }
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
852
1222
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
853 static object *
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
854 do_set(object *self, object *args, int (*func)(int, int, int))
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
855 {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
856 int scheme, paramID, value;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
857 float fvalue;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
858 int is_float = 0;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
859
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
860 if (!getargs(args, "(iii)", &scheme, &paramID, &value)) {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
861 err_clear();
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
862 if (!getargs(args, "(iif)", &scheme, &paramID, &fvalue)) {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
863 err_clear();
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
864 err_setstr(TypeError, "bad argument list (format '(iii)' or '(iif)')");
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
865 return NULL;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
866 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
867 value = CL_TypeIsInt(fvalue);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
868 is_float = 1;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
869 } else {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
870 /* check some parameters which we know to be floats */
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
871 switch (scheme) {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
872 case CL_COMPRESSION_RATIO:
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
873 case CL_SPEED:
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
874 fvalue = value;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
875 value = CL_TypeIsInt(fvalue);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
876 is_float = 1;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
877 break;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
878 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
879 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
880
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
881 error_handler_called = 0;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
882 value = (*func)(scheme, paramID, value);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
883 if (error_handler_called)
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
884 return NULL;
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
885
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
886 if (is_float)
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
887 return newfloatobject(CL_TypeIsFloat(value));
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
888 else
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
889 return newintobject(value);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
890 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
891
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
892 static object *
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
893 cl_SetDefault(object *self, object *args)
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
894 {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
895 return do_set(self, args, clSetDefault);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
896 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
897
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
898 static object *
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
899 cl_SetMin(object *self, object *args)
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
900 {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
901 return do_set(self, args, clSetMin);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
902 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
903
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
904 static object *
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
905 cl_SetMax(object *self, object *args)
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
906 {
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
907 return do_set(self, args, clSetMax);
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
908 }
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
909
2714
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
910 #define func(name, type) \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
911 static object *cl_##name(object *self, object *args) \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
912 { \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
913 int x; \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
914 if (!getargs(args, "i", &x)) return NULL; \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
915 return new##type##object(CL_##name(x)); \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
916 }
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
917
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
918 #define func2(name, type) \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
919 static object *cl_##name(object *self, object *args) \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
920 { \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
921 int a1, a2; \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
922 if (!getargs(args, "(ii)", &a1, &a2)) return NULL; \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
923 return new##type##object(CL_##name(a1, a2)); \
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
924 }
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
925
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
926 func(BytesPerSample,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
927 func(BytesPerPixel,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
928 func(AudioFormatName,string)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
929 func(VideoFormatName,string)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
930 func(AlgorithmNumber,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
931 func(AlgorithmType,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
932 func2(Algorithm,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
933 func(ParamNumber,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
934 func(ParamType,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
935 func2(ParamID,int)
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
936
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
937 #ifdef CLDEBUG
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
938 static object *
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
939 cvt_type(object *self, object *args)
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
940 {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
941 int number;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
942 float fnumber;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
943
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
944 if (getargs(args, "i", &number))
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
945 return newfloatobject(CL_TypeIsFloat(number));
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
946 else {
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
947 err_clear();
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
948 if (getargs(args, "f", &fnumber))
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
949 return newintobject(CL_TypeIsInt(fnumber));
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
950 return NULL;
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
951 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
952 }
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
953 #endif
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
954
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
955 static struct methodlist cl_methods[] = {
1116
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
956 {"CompressImage", cl_CompressImage},
c26f5bec3438 adapted to newest version of CL library.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1075
diff changeset
957 {"DecompressImage", cl_DecompressImage},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
958 {"GetAlgorithmName", cl_GetAlgorithmName},
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
959 {"OpenCompressor", cl_OpenCompressor},
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
960 {"OpenDecompressor", cl_OpenDecompressor},
1205
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
961 {"QueryAlgorithms", cl_QueryAlgorithms},
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
962 {"QueryMaxHeaderSize", cl_QueryMaxHeaderSize},
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
963 {"QueryScheme", cl_QueryScheme},
ecfbc246eeaa CL.py, clmodule.c: Adapted to new CL library. Lots of new methods.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1116
diff changeset
964 {"QuerySchemeFromName", cl_QuerySchemeFromName},
1222
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
965 {"SetDefault", cl_SetDefault},
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
966 {"SetMax", cl_SetMax},
ce7ae8f81b06 * clmodule.c: the documentation was wrong, so changed the interface
Sjoerd Mullender <sjoerd@acm.org>
parents: 1219
diff changeset
967 {"SetMin", cl_SetMin},
2714
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
968 {"BytesPerSample", cl_BytesPerSample},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
969 {"BytesPerPixel", cl_BytesPerPixel},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
970 {"AudioFormatName", cl_AudioFormatName},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
971 {"VideoFormatName", cl_VideoFormatName},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
972 {"AlgorithmNumber", cl_AlgorithmNumber},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
973 {"AlgorithmType", cl_AlgorithmType},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
974 {"Algorithm", cl_Algorithm},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
975 {"ParamNumber", cl_ParamNumber},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
976 {"ParamType", cl_ParamType},
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
977 {"ParamID", cl_ParamID},
1219
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
978 #ifdef CLDEBUG
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
979 {"cvt_type", cvt_type},
64ec7bd2e837 * clmodule.c: use function prototypes (found and fixed some bugs this
Sjoerd Mullender <sjoerd@acm.org>
parents: 1205
diff changeset
980 #endif
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
981 {NULL, NULL} /* Sentinel */
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
982 };
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
983
2714
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
984 #ifdef CL_JPEG_SOFTWARE
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
985 #define IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
986 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
987
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
988 void
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
989 initcl()
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
990 {
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
991 object *m, *d;
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
992
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
993 m = initmodule("cl", cl_methods);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
994 d = getmoduledict(m);
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
995
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
996 ClError = newstringobject("cl.error");
2714
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
997 (void) dictinsert(d, "error", ClError);
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
998
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
999 (void) dictinsert(d, "MAX_NUMBER_OF_ORIGINAL_FORMATS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1000 newintobject(CL_MAX_NUMBER_OF_ORIGINAL_FORMATS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1001 (void) dictinsert(d, "MONO", newintobject(CL_MONO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1002 (void) dictinsert(d, "STEREO_INTERLEAVED",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1003 newintobject(CL_STEREO_INTERLEAVED));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1004 (void) dictinsert(d, "RGB", newintobject(CL_RGB));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1005 (void) dictinsert(d, "RGBX", newintobject(CL_RGBX));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1006 (void) dictinsert(d, "RGBA", newintobject(CL_RGBA));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1007 (void) dictinsert(d, "RGB332", newintobject(CL_RGB332));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1008 (void) dictinsert(d, "GRAYSCALE", newintobject(CL_GRAYSCALE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1009 (void) dictinsert(d, "Y", newintobject(CL_Y));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1010 (void) dictinsert(d, "YUV", newintobject(CL_YUV));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1011 (void) dictinsert(d, "YCbCr", newintobject(CL_YCbCr));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1012 (void) dictinsert(d, "YUV422", newintobject(CL_YUV422));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1013 (void) dictinsert(d, "YCbCr422", newintobject(CL_YCbCr422));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1014 (void) dictinsert(d, "YUV422HC", newintobject(CL_YUV422HC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1015 (void) dictinsert(d, "YCbCr422HC", newintobject(CL_YCbCr422HC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1016 (void) dictinsert(d, "YUV422DC", newintobject(CL_YUV422DC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1017 (void) dictinsert(d, "YCbCr422DC", newintobject(CL_YCbCr422DC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1018 (void) dictinsert(d, "RGB8", newintobject(CL_RGB8));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1019 (void) dictinsert(d, "BEST_FIT", newintobject(CL_BEST_FIT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1020 (void) dictinsert(d, "MAX_NUMBER_OF_AUDIO_ALGORITHMS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1021 newintobject(CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1022 (void) dictinsert(d, "MAX_NUMBER_OF_VIDEO_ALGORITHMS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1023 newintobject(CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1024 (void) dictinsert(d, "AUDIO", newintobject(CL_AUDIO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1025 (void) dictinsert(d, "VIDEO", newintobject(CL_VIDEO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1026 (void) dictinsert(d, "UNKNOWN_SCHEME",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1027 newintobject(CL_UNKNOWN_SCHEME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1028 (void) dictinsert(d, "UNCOMPRESSED_AUDIO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1029 newintobject(CL_UNCOMPRESSED_AUDIO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1030 (void) dictinsert(d, "G711_ULAW", newintobject(CL_G711_ULAW));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1031 (void) dictinsert(d, "ULAW", newintobject(CL_ULAW));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1032 (void) dictinsert(d, "G711_ALAW", newintobject(CL_G711_ALAW));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1033 (void) dictinsert(d, "ALAW", newintobject(CL_ALAW));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1034 (void) dictinsert(d, "AWARE_MPEG_AUDIO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1035 newintobject(CL_AWARE_MPEG_AUDIO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1036 (void) dictinsert(d, "AWARE_MULTIRATE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1037 newintobject(CL_AWARE_MULTIRATE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1038 (void) dictinsert(d, "UNCOMPRESSED", newintobject(CL_UNCOMPRESSED));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1039 (void) dictinsert(d, "UNCOMPRESSED_VIDEO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1040 newintobject(CL_UNCOMPRESSED_VIDEO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1041 (void) dictinsert(d, "RLE", newintobject(CL_RLE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1042 (void) dictinsert(d, "JPEG", newintobject(CL_JPEG));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1043 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1044 (void) dictinsert(d, "JPEG_SOFTWARE", newintobject(CL_JPEG_SOFTWARE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1045 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1046 (void) dictinsert(d, "MPEG_VIDEO", newintobject(CL_MPEG_VIDEO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1047 (void) dictinsert(d, "MVC1", newintobject(CL_MVC1));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1048 (void) dictinsert(d, "RTR", newintobject(CL_RTR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1049 (void) dictinsert(d, "RTR1", newintobject(CL_RTR1));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1050 (void) dictinsert(d, "HDCC", newintobject(CL_HDCC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1051 (void) dictinsert(d, "MVC2", newintobject(CL_MVC2));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1052 (void) dictinsert(d, "RLE24", newintobject(CL_RLE24));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1053 (void) dictinsert(d, "MAX_NUMBER_OF_PARAMS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1054 newintobject(CL_MAX_NUMBER_OF_PARAMS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1055 (void) dictinsert(d, "IMAGE_WIDTH", newintobject(CL_IMAGE_WIDTH));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1056 (void) dictinsert(d, "IMAGE_HEIGHT", newintobject(CL_IMAGE_HEIGHT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1057 (void) dictinsert(d, "ORIGINAL_FORMAT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1058 newintobject(CL_ORIGINAL_FORMAT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1059 (void) dictinsert(d, "INTERNAL_FORMAT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1060 newintobject(CL_INTERNAL_FORMAT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1061 (void) dictinsert(d, "COMPONENTS", newintobject(CL_COMPONENTS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1062 (void) dictinsert(d, "BITS_PER_COMPONENT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1063 newintobject(CL_BITS_PER_COMPONENT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1064 (void) dictinsert(d, "FRAME_RATE", newintobject(CL_FRAME_RATE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1065 (void) dictinsert(d, "COMPRESSION_RATIO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1066 newintobject(CL_COMPRESSION_RATIO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1067 (void) dictinsert(d, "EXACT_COMPRESSION_RATIO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1068 newintobject(CL_EXACT_COMPRESSION_RATIO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1069 (void) dictinsert(d, "FRAME_BUFFER_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1070 newintobject(CL_FRAME_BUFFER_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1071 (void) dictinsert(d, "COMPRESSED_BUFFER_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1072 newintobject(CL_COMPRESSED_BUFFER_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1073 (void) dictinsert(d, "BLOCK_SIZE", newintobject(CL_BLOCK_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1074 (void) dictinsert(d, "PREROLL", newintobject(CL_PREROLL));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1075 (void) dictinsert(d, "FRAME_TYPE", newintobject(CL_FRAME_TYPE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1076 (void) dictinsert(d, "ALGORITHM_ID", newintobject(CL_ALGORITHM_ID));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1077 (void) dictinsert(d, "ALGORITHM_VERSION",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1078 newintobject(CL_ALGORITHM_VERSION));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1079 (void) dictinsert(d, "ORIENTATION", newintobject(CL_ORIENTATION));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1080 (void) dictinsert(d, "NUMBER_OF_FRAMES",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1081 newintobject(CL_NUMBER_OF_FRAMES));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1082 (void) dictinsert(d, "SPEED", newintobject(CL_SPEED));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1083 (void) dictinsert(d, "LAST_FRAME_INDEX",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1084 newintobject(CL_LAST_FRAME_INDEX));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1085 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1086 (void) dictinsert(d, "ENABLE_IMAGEINFO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1087 newintobject(CL_ENABLE_IMAGEINFO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1088 (void) dictinsert(d, "INTERNAL_IMAGE_WIDTH",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1089 newintobject(CL_INTERNAL_IMAGE_WIDTH));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1090 (void) dictinsert(d, "INTERNAL_IMAGE_HEIGHT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1091 newintobject(CL_INTERNAL_IMAGE_HEIGHT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1092 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1093 (void) dictinsert(d, "NUMBER_OF_PARAMS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1094 newintobject(CL_NUMBER_OF_PARAMS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1095 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1096 (void) dictinsert(d, "MVC2_LUMA_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1097 newintobject(CL_MVC2_LUMA_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1098 (void) dictinsert(d, "MVC2_CHROMA_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1099 newintobject(CL_MVC2_CHROMA_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1100 (void) dictinsert(d, "MVC2_EDGE_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1101 newintobject(CL_MVC2_EDGE_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1102 (void) dictinsert(d, "MVC2_BLENDING", newintobject(CL_MVC2_BLENDING));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1103 (void) dictinsert(d, "MVC2_BLENDING_OFF",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1104 newintobject(CL_MVC2_BLENDING_OFF));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1105 (void) dictinsert(d, "MVC2_BLENDING_ON",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1106 newintobject(CL_MVC2_BLENDING_ON));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1107 (void) dictinsert(d, "JPEG_QUALITY_FACTOR",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1108 newintobject(CL_JPEG_QUALITY_FACTOR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1109 (void) dictinsert(d, "JPEG_STREAM_HEADERS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1110 newintobject(CL_JPEG_STREAM_HEADERS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1111 (void) dictinsert(d, "JPEG_QUANTIZATION_TABLES",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1112 newintobject(CL_JPEG_QUANTIZATION_TABLES));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1113 (void) dictinsert(d, "JPEG_NUM_PARAMS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1114 newintobject(CL_JPEG_NUM_PARAMS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1115 (void) dictinsert(d, "RTR_QUALITY_LEVEL",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1116 newintobject(CL_RTR_QUALITY_LEVEL));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1117 (void) dictinsert(d, "HDCC_TILE_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1118 newintobject(CL_HDCC_TILE_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1119 (void) dictinsert(d, "HDCC_SAMPLES_PER_TILE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1120 newintobject(CL_HDCC_SAMPLES_PER_TILE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1121 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1122 (void) dictinsert(d, "END_OF_SEQUENCE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1123 newintobject(CL_END_OF_SEQUENCE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1124 (void) dictinsert(d, "CHANNEL_POLICY",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1125 newintobject(CL_CHANNEL_POLICY));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1126 (void) dictinsert(d, "NOISE_MARGIN", newintobject(CL_NOISE_MARGIN));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1127 (void) dictinsert(d, "BITRATE_POLICY",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1128 newintobject(CL_BITRATE_POLICY));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1129 (void) dictinsert(d, "BITRATE_TARGET",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1130 newintobject(CL_BITRATE_TARGET));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1131 (void) dictinsert(d, "LAYER", newintobject(CL_LAYER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1132 (void) dictinsert(d, "ENUM_VALUE", newintobject(CL_ENUM_VALUE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1133 (void) dictinsert(d, "RANGE_VALUE", newintobject(CL_RANGE_VALUE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1134 (void) dictinsert(d, "FLOATING_ENUM_VALUE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1135 newintobject(CL_FLOATING_ENUM_VALUE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1136 (void) dictinsert(d, "FLOATING_RANGE_VALUE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1137 newintobject(CL_FLOATING_RANGE_VALUE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1138 (void) dictinsert(d, "DECOMPRESSOR", newintobject(CL_DECOMPRESSOR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1139 (void) dictinsert(d, "COMPRESSOR", newintobject(CL_COMPRESSOR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1140 (void) dictinsert(d, "CODEC", newintobject(CL_CODEC));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1141 (void) dictinsert(d, "NONE", newintobject(CL_NONE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1142 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1143 (void) dictinsert(d, "BUF_FRAME", newintobject(CL_BUF_FRAME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1144 (void) dictinsert(d, "BUF_DATA", newintobject(CL_BUF_DATA));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1145 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1146 #ifdef CL_FRAME
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1147 (void) dictinsert(d, "FRAME", newintobject(CL_FRAME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1148 (void) dictinsert(d, "DATA", newintobject(CL_DATA));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1149 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1150 (void) dictinsert(d, "NONE", newintobject(CL_NONE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1151 (void) dictinsert(d, "KEYFRAME", newintobject(CL_KEYFRAME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1152 (void) dictinsert(d, "INTRA", newintobject(CL_INTRA));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1153 (void) dictinsert(d, "PREDICTED", newintobject(CL_PREDICTED));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1154 (void) dictinsert(d, "BIDIRECTIONAL", newintobject(CL_BIDIRECTIONAL));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1155 (void) dictinsert(d, "TOP_DOWN", newintobject(CL_TOP_DOWN));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1156 (void) dictinsert(d, "BOTTOM_UP", newintobject(CL_BOTTOM_UP));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1157 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1158 (void) dictinsert(d, "CONTINUOUS_BLOCK",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1159 newintobject(CL_CONTINUOUS_BLOCK));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1160 (void) dictinsert(d, "CONTINUOUS_NONBLOCK",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1161 newintobject(CL_CONTINUOUS_NONBLOCK));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1162 (void) dictinsert(d, "EXTERNAL_DEVICE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1163 newintobject((long)CL_EXTERNAL_DEVICE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1164 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1165 (void) dictinsert(d, "AWCMP_STEREO", newintobject(AWCMP_STEREO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1166 (void) dictinsert(d, "AWCMP_JOINT_STEREO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1167 newintobject(AWCMP_JOINT_STEREO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1168 (void) dictinsert(d, "AWCMP_INDEPENDENT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1169 newintobject(AWCMP_INDEPENDENT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1170 (void) dictinsert(d, "AWCMP_FIXED_RATE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1171 newintobject(AWCMP_FIXED_RATE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1172 (void) dictinsert(d, "AWCMP_CONST_QUAL",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1173 newintobject(AWCMP_CONST_QUAL));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1174 (void) dictinsert(d, "AWCMP_LOSSLESS", newintobject(AWCMP_LOSSLESS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1175 (void) dictinsert(d, "AWCMP_MPEG_LAYER_I",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1176 newintobject(AWCMP_MPEG_LAYER_I));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1177 (void) dictinsert(d, "AWCMP_MPEG_LAYER_II",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1178 newintobject(AWCMP_MPEG_LAYER_II));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1179 (void) dictinsert(d, "HEADER_START_CODE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1180 newintobject(CL_HEADER_START_CODE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1181 (void) dictinsert(d, "BAD_NO_BUFFERSPACE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1182 newintobject(CL_BAD_NO_BUFFERSPACE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1183 (void) dictinsert(d, "BAD_PVBUFFER", newintobject(CL_BAD_PVBUFFER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1184 (void) dictinsert(d, "BAD_BUFFERLENGTH_NEG",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1185 newintobject(CL_BAD_BUFFERLENGTH_NEG));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1186 (void) dictinsert(d, "BAD_BUFFERLENGTH_ODD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1187 newintobject(CL_BAD_BUFFERLENGTH_ODD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1188 (void) dictinsert(d, "BAD_PARAM", newintobject(CL_BAD_PARAM));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1189 (void) dictinsert(d, "BAD_COMPRESSION_SCHEME",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1190 newintobject(CL_BAD_COMPRESSION_SCHEME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1191 (void) dictinsert(d, "BAD_COMPRESSOR_HANDLE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1192 newintobject(CL_BAD_COMPRESSOR_HANDLE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1193 (void) dictinsert(d, "BAD_COMPRESSOR_HANDLE_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1194 newintobject(CL_BAD_COMPRESSOR_HANDLE_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1195 (void) dictinsert(d, "BAD_BUFFER_HANDLE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1196 newintobject(CL_BAD_BUFFER_HANDLE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1197 (void) dictinsert(d, "BAD_BUFFER_QUERY_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1198 newintobject(CL_BAD_BUFFER_QUERY_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1199 (void) dictinsert(d, "JPEG_ERROR", newintobject(CL_JPEG_ERROR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1200 (void) dictinsert(d, "BAD_FRAME_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1201 newintobject(CL_BAD_FRAME_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1202 (void) dictinsert(d, "PARAM_OUT_OF_RANGE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1203 newintobject(CL_PARAM_OUT_OF_RANGE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1204 (void) dictinsert(d, "ADDED_ALGORITHM_ERROR",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1205 newintobject(CL_ADDED_ALGORITHM_ERROR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1206 (void) dictinsert(d, "BAD_ALGORITHM_TYPE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1207 newintobject(CL_BAD_ALGORITHM_TYPE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1208 (void) dictinsert(d, "BAD_ALGORITHM_NAME",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1209 newintobject(CL_BAD_ALGORITHM_NAME));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1210 (void) dictinsert(d, "BAD_BUFFERING", newintobject(CL_BAD_BUFFERING));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1211 (void) dictinsert(d, "BUFFER_NOT_CREATED",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1212 newintobject(CL_BUFFER_NOT_CREATED));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1213 (void) dictinsert(d, "BAD_BUFFER_EXISTS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1214 newintobject(CL_BAD_BUFFER_EXISTS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1215 (void) dictinsert(d, "BAD_INTERNAL_FORMAT",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1216 newintobject(CL_BAD_INTERNAL_FORMAT));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1217 (void) dictinsert(d, "BAD_BUFFER_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1218 newintobject(CL_BAD_BUFFER_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1219 (void) dictinsert(d, "FRAME_BUFFER_SIZE_ZERO",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1220 newintobject(CL_FRAME_BUFFER_SIZE_ZERO));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1221 (void) dictinsert(d, "BAD_STREAM_HEADER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1222 newintobject(CL_BAD_STREAM_HEADER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1223 (void) dictinsert(d, "BAD_LICENSE", newintobject(CL_BAD_LICENSE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1224 (void) dictinsert(d, "AWARE_ERROR", newintobject(CL_AWARE_ERROR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1225 (void) dictinsert(d, "BAD_BUFFER_SIZE_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1226 newintobject(CL_BAD_BUFFER_SIZE_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1227 (void) dictinsert(d, "BAD_BUFFER_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1228 newintobject(CL_BAD_BUFFER_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1229 (void) dictinsert(d, "BAD_BUFFER_TYPE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1230 newintobject(CL_BAD_BUFFER_TYPE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1231 (void) dictinsert(d, "BAD_HEADER_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1232 newintobject(CL_BAD_HEADER_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1233 (void) dictinsert(d, "BAD_FUNCTION_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1234 newintobject(CL_BAD_FUNCTION_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1235 (void) dictinsert(d, "BAD_SCHEME_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1236 newintobject(CL_BAD_SCHEME_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1237 (void) dictinsert(d, "BAD_STRING_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1238 newintobject(CL_BAD_STRING_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1239 (void) dictinsert(d, "BAD_MIN_GT_MAX",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1240 newintobject(CL_BAD_MIN_GT_MAX));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1241 (void) dictinsert(d, "BAD_INITIAL_VALUE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1242 newintobject(CL_BAD_INITIAL_VALUE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1243 (void) dictinsert(d, "BAD_PARAM_ID_POINTER",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1244 newintobject(CL_BAD_PARAM_ID_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1245 (void) dictinsert(d, "BAD_PARAM_TYPE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1246 newintobject(CL_BAD_PARAM_TYPE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1247 (void) dictinsert(d, "BAD_TEXT_STRING_PTR",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1248 newintobject(CL_BAD_TEXT_STRING_PTR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1249 (void) dictinsert(d, "BAD_FUNCTIONALITY",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1250 newintobject(CL_BAD_FUNCTIONALITY));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1251 (void) dictinsert(d, "BAD_NUMBER_OF_BLOCKS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1252 newintobject(CL_BAD_NUMBER_OF_BLOCKS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1253 (void) dictinsert(d, "BAD_BLOCK_SIZE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1254 newintobject(CL_BAD_BLOCK_SIZE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1255 (void) dictinsert(d, "BAD_POINTER", newintobject(CL_BAD_POINTER));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1256 (void) dictinsert(d, "BAD_BOARD", newintobject(CL_BAD_BOARD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1257 (void) dictinsert(d, "MVC2_ERROR", newintobject(CL_MVC2_ERROR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1258 #ifdef IRIX_5_3_LIBRARY
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1259 (void) dictinsert(d, "NEXT_NOT_AVAILABLE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1260 newintobject(CL_NEXT_NOT_AVAILABLE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1261 (void) dictinsert(d, "SCHEME_BUSY", newintobject(CL_SCHEME_BUSY));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1262 (void) dictinsert(d, "SCHEME_NOT_AVAILABLE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1263 newintobject(CL_SCHEME_NOT_AVAILABLE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1264 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1265 #ifdef CL_LUMA_THRESHOLD
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1266 /* backward compatibility */
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1267 (void) dictinsert(d, "LUMA_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1268 newintobject(CL_LUMA_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1269 (void) dictinsert(d, "CHROMA_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1270 newintobject(CL_CHROMA_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1271 (void) dictinsert(d, "EDGE_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1272 newintobject(CL_EDGE_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1273 (void) dictinsert(d, "BLENDING", newintobject(CL_BLENDING));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1274 (void) dictinsert(d, "QUALITY_FACTOR",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1275 newintobject(CL_QUALITY_FACTOR));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1276 (void) dictinsert(d, "STREAM_HEADERS",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1277 newintobject(CL_STREAM_HEADERS));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1278 (void) dictinsert(d, "QUALITY_LEVEL", newintobject(CL_QUALITY_LEVEL));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1279 (void) dictinsert(d, "TILE_THRESHOLD",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1280 newintobject(CL_TILE_THRESHOLD));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1281 (void) dictinsert(d, "SAMPLES_PER_TILE",
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1282 newintobject(CL_SAMPLES_PER_TILE));
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1283 #endif
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1284
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1285 if (err_occurred())
75afaac85567 Make constants from cl.h include file available as module variables.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2061
diff changeset
1286 fatal("can't initialize module cl");
1061
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
1287
a3fa229775c1 New built-in module "cl" (Compression Library). Only for Irix 4.0.5
Sjoerd Mullender <sjoerd@acm.org>
parents: 1056
diff changeset
1288 (void) clSetErrorHandler(cl_ErrorHandler);
1056
9bf75e4d9aec New built-in module cl, the Compression Library.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
1289 }