libptouch を複数ソースに分割し src/lib に配置
- core / usb / print / status / png と libptouch_internal.h に分割 - 旧単一ファイル src/libptouch.c を削除 - CMake のソース一覧と include パスを更新 - README・libptouch.h の参照パスを追随 Made-with: Cursor
This commit is contained in:
37
src/lib/libptouch_internal.h
Normal file
37
src/lib/libptouch_internal.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* libptouch — internal declarations (not installed)
|
||||
*
|
||||
* Author: knb
|
||||
* Email: knb@artif.org
|
||||
*/
|
||||
|
||||
#ifndef LIBPTOUCH_INTERNAL_H
|
||||
#define LIBPTOUCH_INTERNAL_H
|
||||
|
||||
#include "libptouch.h"
|
||||
|
||||
#include <libusb.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct libptouch_ctx {
|
||||
libptouch_err_t last_code;
|
||||
char last_msg[256];
|
||||
int usb_open;
|
||||
struct libusb_context *usb_ctx;
|
||||
struct libusb_device_handle *usb_handle;
|
||||
int claimed_interface; /* -1 if none */
|
||||
uint8_t bulk_out_ep;
|
||||
uint8_t bulk_in_ep;
|
||||
};
|
||||
|
||||
void ptouch_set_error(libptouch_ctx *ctx, libptouch_err_t code, const char *msg);
|
||||
void ptouch_set_error_usb(libptouch_ctx *ctx, int libusb_err, const char *what);
|
||||
|
||||
int ptouch_bulk_out(libusb_device_handle *h, uint8_t ep, const uint8_t *data,
|
||||
int len, unsigned int timeout_ms);
|
||||
int ptouch_bulk_in_exact(libusb_device_handle *h, uint8_t ep, uint8_t *buf,
|
||||
int len, unsigned int timeout_ms);
|
||||
libptouch_err_t ptouch_bulk_send_job(libptouch_ctx *ctx, const uint8_t *buf,
|
||||
size_t len, const char *what);
|
||||
|
||||
#endif /* LIBPTOUCH_INTERNAL_H */
|
||||
Reference in New Issue
Block a user