mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-02-09 23:19:12 +01:00
Allow passing id as 6th argument
This commit is contained in:
parent
5bdf9d372b
commit
d67d10af9f
5
ctpv.c
5
ctpv.c
@ -106,12 +106,13 @@ static int preview(int argc, char *argv[])
|
|||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *f, *w, *h, *x, *y;
|
char *f, *w, *h, *x, *y, *id;
|
||||||
GET_PARG(f, 0);
|
GET_PARG(f, 0);
|
||||||
GET_PARG(w, 1);
|
GET_PARG(w, 1);
|
||||||
GET_PARG(h, 2);
|
GET_PARG(h, 2);
|
||||||
GET_PARG(x, 3);
|
GET_PARG(x, 3);
|
||||||
GET_PARG(y, 4);
|
GET_PARG(y, 4);
|
||||||
|
GET_PARG(id, 5);
|
||||||
|
|
||||||
ERRCHK_RET_OK(check_file(f));
|
ERRCHK_RET_OK(check_file(f));
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ static int preview(int argc, char *argv[])
|
|||||||
|
|
||||||
PreviewArgs args = {
|
PreviewArgs args = {
|
||||||
.ctpv = ctpv.ctpv_path,
|
.ctpv = ctpv.ctpv_path,
|
||||||
.f = f, .w = w, .h = h, .x = x, .y = y
|
.f = f, .w = w, .h = h, .x = x, .y = y, .id = id
|
||||||
};
|
};
|
||||||
|
|
||||||
return run_preview(get_ext(f), mimetype, &args);
|
return run_preview(get_ext(f), mimetype, &args);
|
||||||
|
@ -163,6 +163,7 @@ int run_preview(const char *ext, const char *mimetype, PreviewArgs *pa)
|
|||||||
SET_PENV("h", pa->h);
|
SET_PENV("h", pa->h);
|
||||||
SET_PENV("x", pa->x);
|
SET_PENV("x", pa->x);
|
||||||
SET_PENV("y", pa->y);
|
SET_PENV("y", pa->y);
|
||||||
|
SET_PENV("id", pa->id);
|
||||||
|
|
||||||
SET_PENV("m", mimetype);
|
SET_PENV("m", mimetype);
|
||||||
SET_PENV("e", ext);
|
SET_PENV("e", ext);
|
||||||
|
@ -10,7 +10,7 @@ typedef struct {
|
|||||||
} Preview;
|
} Preview;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *ctpv, *f, *w, *h, *x, *y;
|
char *ctpv, *f, *w, *h, *x, *y, *id;
|
||||||
} PreviewArgs;
|
} PreviewArgs;
|
||||||
|
|
||||||
void init_previews(Preview *ps, size_t len);
|
void init_previews(Preview *ps, size_t len);
|
||||||
|
Loading…
Reference in New Issue
Block a user