Skip to content

Commit 13868ab

Browse files
committed
add gint64 args
1 parent 096bba9 commit 13868ab

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

libvips/include/vips/object.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,19 @@ VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the x pos of the image minimum
197197
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
198198
}
199199

200+
#define VIPS_ARG_INT64( CLASS, NAME, PRIORITY, LONG, DESC, \
201+
FLAGS, OFFSET, MIN, MAX, VALUE ) { \
202+
GParamSpec *pspec; \
203+
\
204+
pspec = g_param_spec_int64( (NAME), (LONG), (DESC), \
205+
(MIN), (MAX), (VALUE), \
206+
(GParamFlags) (G_PARAM_READWRITE) );\
207+
g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \
208+
vips_argument_get_id(), pspec ); \
209+
vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \
210+
pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \
211+
}
212+
200213
#define VIPS_ARG_ENUM( CLASS, NAME, PRIORITY, LONG, DESC, \
201214
FLAGS, OFFSET, TYPE, VALUE ) { \
202215
GParamSpec *pspec; \

libvips/iofuncs/configure.c

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef struct _VipsConfigure {
7878

7979
/* Max size of pipe.
8080
*/
81-
int64 pipe_read_limit;
81+
gint64 pipe_read_limit;
8282

8383
/* Trace libvips operation cache actions.
8484
*/
@@ -90,7 +90,7 @@ typedef struct _VipsConfigure {
9090

9191
/* Maximum memory to use for operation caching.
9292
*/
93-
int64 cache_max_mem;
93+
gint64 cache_max_mem;
9494

9595
/* Maximum number of open files we allow in the cache.
9696
*/
@@ -160,35 +160,33 @@ vips_configure_class_init( VipsConfigureClass *class )
160160
G_STRUCT_OFFSET( VipsConfigure, operation_unblock ),
161161
NULL );
162162

163-
VIPS_ARG_BOOL( class, "leak", 5,
164-
_( "Leak" ),
165-
_( "Report any leaks on exit" ),
166-
VIPS_ARGUMENT_OPTIONAL_INPUT,
167-
G_STRUCT_OFFSET( VipsConfigure, leak ),
168-
FALSE );
169-
170-
VIPS_ARG_BOOL( class, "profile", 5,
171-
_( "Profile" ),
172-
_( "Write profiling data on exit" ),
173-
VIPS_ARGUMENT_OPTIONAL_INPUT,
174-
G_STRUCT_OFFSET( VipsConfigure, profile ),
175-
FALSE );
176-
177163
VIPS_ARG_INT( class, "concurrency", 5,
178164
_( "Concurrency" ),
179165
_( "Set threadpool size" ),
180166
VIPS_ARGUMENT_OPTIONAL_INPUT,
181167
G_STRUCT_OFFSET( VipsConfigure, concurrency ),
182168
-1 );
183169

170+
VIPS_ARG_INT64( class, "pipe_read_limit", 5,
171+
_( "Pipe read limit" ),
172+
_( "Maxiumum number of bytes to buffer for pipe read" ),
173+
VIPS_ARGUMENT_OPTIONAL_INPUT,
174+
G_STRUCT_OFFSET( VipsConfigure, pipe_read_limit ),
175+
-1 );
184176

185-
/* Max size of pipe.
186-
*/
187-
int64 pipe_read_limit;
177+
VIPS_ARG_INT( class, "cache_max", 5,
178+
_( "Cache max size" ),
179+
_( "Maxium number of operations to cache" ),
180+
VIPS_ARGUMENT_OPTIONAL_INPUT,
181+
G_STRUCT_OFFSET( VipsConfigure, cache_max ),
182+
-1 );
188183

189-
/* Trace libvips operation cache actions.
190-
*/
191-
gboolean cache_trace;
184+
VIPS_ARG_INT( class, "cache_max_mem", 5,
185+
_( "Cache max memory size" ),
186+
_( "Maxium number of operations to cache" ),
187+
VIPS_ARGUMENT_OPTIONAL_INPUT,
188+
G_STRUCT_OFFSET( VipsConfigure, cache_max ),
189+
-1 );
192190

193191
/* Number of recent operations to cache.
194192
*/
@@ -208,6 +206,7 @@ static void
208206
vips_configure_init( VipsConfigure *configure )
209207
{
210208
configure->concurrency = -1;
209+
configure->pipe_read_limit = -1;
211210
}
212211

213212
/**

0 commit comments

Comments
 (0)