pict
Documentation for pict is still a work-in-progress
 
Loading...
Searching...
No Matches
cl_bind.h
Go to the documentation of this file.
1
2// Bindings for usage in IPC, etc. Niche and not very well supported or implemented.
3#ifndef CL_BIND_H
4#define CL_BIND_H
5
6// Recommended buffer size for bind_run
7#define PTP_BIND_DEFAULT_SIZE 5000000
8
9#define BIND_MAX_NAME 64
10
11struct BindReq {
12 // @brief Argument passed to out or out_bytes
13 void *arg;
14 // @brief Output JSON data
15 int (*out)(struct BindReq *bind, char *fmt, ...);
17 int (*out_bytes)(struct BindReq *bind, void *bytes, size_t length);
18
20 char name[BIND_MAX_NAME];
21
24 int params[5];
25 int params_length;
27 char *string;
29 uint8_t *bytes;
30 int bytes_length;
31};
32
33// @brief Run a binding directly from an instance of struct BindReq
34int bind_run_req(struct PtpRuntime *r, struct BindReq *bind);
35
36#endif
int(* out_bytes)(struct BindReq *bind, void *bytes, size_t length)
Output raw binary data.
Definition cl_bind.h:17
int params[5]
Parameters for command.
Definition cl_bind.h:24
uint8_t * bytes
Data argument, NULL for none.
Definition cl_bind.h:29
char * string
String argument, NULL for none.
Definition cl_bind.h:27
char name[BIND_MAX_NAME]
Name of command to be run.
Definition cl_bind.h:20