From ecca345f3ea63dfe85759311cea90227bdc4384a Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Tue, 12 Jan 2016 21:01:30 +0100 Subject: Loading image data from standard input This commit changes processing of arguments: * When called without arguments (with or without flags), imv reads list of files from standard input. * When called with "-" among arguments, read image data from standard input. --- src/loader.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/loader.h') diff --git a/src/loader.h b/src/loader.h index 65c8689..6e20349 100644 --- a/src/loader.h +++ b/src/loader.h @@ -28,6 +28,9 @@ struct imv_loader { pthread_mutex_t lock; pthread_t bg_thread; char *path; + BYTE *buffer; + size_t buffer_size; + FIMEMORY *fi_buffer; FIBITMAP *out_bmp; int out_is_new_image; char *out_err; @@ -48,7 +51,8 @@ void imv_init_loader(struct imv_loader *img); void imv_destroy_loader(struct imv_loader *img); /* Asynchronously load the given file */ -void imv_loader_load_path(struct imv_loader *ldr, const char *path); +void imv_loader_load(struct imv_loader *ldr, const char *path, + const void *buffer, const size_t buffer_size); /* Returns 1 if image data is available. 0 if not. Caller is responsible for * cleaning up the data returned. Each image is only returned once. -- cgit v1.2.3