diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2022-05-03 07:57:47 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2022-05-03 08:31:29 +0900 |
commit | c5bb8ebc24e08315c894229ef8807ff37f954511 (patch) | |
tree | 0d68da4c4cac12f0401207a4dfcb5712a9231f2c | |
parent | 5506cdf9413569ab1dad0a8a2749ba099191070a (diff) | |
download | libhinoko-c5bb8ebc24e08315c894229ef8807ff37f954511.tar.gz |
split private header into two parts
It's better to split private header per each.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | src/cycle_timer.c | 2 | ||||
-rw-r--r-- | src/fw_iso_ctx.c | 4 | ||||
-rw-r--r-- | src/fw_iso_ctx_private.h (renamed from src/internal.h) | 30 | ||||
-rw-r--r-- | src/fw_iso_resource.c | 4 | ||||
-rw-r--r-- | src/fw_iso_resource_auto.c | 4 | ||||
-rw-r--r-- | src/fw_iso_resource_once.c | 2 | ||||
-rw-r--r-- | src/fw_iso_resource_private.h | 33 | ||||
-rw-r--r-- | src/fw_iso_rx_multiple.c | 4 | ||||
-rw-r--r-- | src/fw_iso_rx_single.c | 5 | ||||
-rw-r--r-- | src/fw_iso_tx.c | 5 | ||||
-rw-r--r-- | src/meson.build | 3 |
11 files changed, 48 insertions, 48 deletions
diff --git a/src/cycle_timer.c b/src/cycle_timer.c index 97e53af..e3bd80c 100644 --- a/src/cycle_timer.c +++ b/src/cycle_timer.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" +#include "fw_iso_ctx_private.h" /** * HinokoCycleTimer: diff --git a/src/fw_iso_ctx.c b/src/fw_iso_ctx.c index a3940e2..bbb12fa 100644 --- a/src/fw_iso_ctx.c +++ b/src/fw_iso_ctx.c @@ -1,13 +1,11 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" +#include "fw_iso_ctx_private.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/ioctl.h> -#include <unistd.h> #include <sys/mman.h> -#include <errno.h> /** * HinokoFwIsoCtx diff --git a/src/internal.h b/src/fw_iso_ctx_private.h index 2c13067..2286606 100644 --- a/src/internal.h +++ b/src/fw_iso_ctx_private.h @@ -1,9 +1,12 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#ifndef __HINOKO_INTERNAL_H__ -#define __HINOKO_INTERNAL_H__ +#ifndef __HINOKO_FW_ISO_CTX_PRIVATE_H__ +#define __HINOKO_FW_ISO_CTX_PRIVATE_H__ #include "hinoko.h" +#include <unistd.h> +#include <errno.h> + void hinoko_fw_iso_ctx_allocate(HinokoFwIsoCtx *self, const char *path, HinokoFwIsoCtxMode mode, HinokoFwScode scode, guint channel, guint header_size, @@ -39,27 +42,4 @@ void hinoko_fw_iso_tx_handle_event(HinokoFwIsoTx *self, const struct fw_cdev_event_iso_interrupt *event, GError **error); -void hinoko_fw_iso_resource_ioctl(HinokoFwIsoResource *self, - unsigned long request, void *argp, - GError **error); - -void hinoko_fw_iso_resource_auto_handle_event(HinokoFwIsoResourceAuto *self, guint channel, - guint bandwidth, const char *signal_name, - const GError *error); - -struct fw_iso_resource_waiter { - GMutex mutex; - GCond cond; - GError *error; - gboolean handled; - guint64 expiration; - gulong handler_id; -}; - -void fw_iso_resource_waiter_init(HinokoFwIsoResource *self, struct fw_iso_resource_waiter *w, - const char *signal_name, guint timeout_ms); - -void fw_iso_resource_waiter_wait(HinokoFwIsoResource *self, struct fw_iso_resource_waiter *w, - GError **error); - #endif diff --git a/src/fw_iso_resource.c b/src/fw_iso_resource.c index a28e826..7a356a1 100644 --- a/src/fw_iso_resource.c +++ b/src/fw_iso_resource.c @@ -1,11 +1,9 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" +#include "fw_iso_resource_private.h" -#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> -#include <errno.h> #include <sys/ioctl.h> /** diff --git a/src/fw_iso_resource_auto.c b/src/fw_iso_resource_auto.c index 6a8a586..c1ffa98 100644 --- a/src/fw_iso_resource_auto.c +++ b/src/fw_iso_resource_auto.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" - -#include <errno.h> +#include "fw_iso_resource_private.h" /** * HinokoFwIsoResourceAuto: diff --git a/src/fw_iso_resource_once.c b/src/fw_iso_resource_once.c index b0493a5..3685b05 100644 --- a/src/fw_iso_resource_once.c +++ b/src/fw_iso_resource_once.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" +#include "fw_iso_resource_private.h" /** * HinokoFwIsoResourceOnce: diff --git a/src/fw_iso_resource_private.h b/src/fw_iso_resource_private.h new file mode 100644 index 0000000..51a2b91 --- /dev/null +++ b/src/fw_iso_resource_private.h @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +#ifndef __HINOKO_FW_ISO_RESOURCE_PRIVATE_H__ +#define __HINOKO_FW_ISO_RESOURCE_PRIVATE_H__ + +#include "hinoko.h" + +#include <unistd.h> +#include <errno.h> + +void hinoko_fw_iso_resource_ioctl(HinokoFwIsoResource *self, + unsigned long request, void *argp, + GError **error); + +void hinoko_fw_iso_resource_auto_handle_event(HinokoFwIsoResourceAuto *self, guint channel, + guint bandwidth, const char *signal_name, + const GError *error); + +struct fw_iso_resource_waiter { + GMutex mutex; + GCond cond; + GError *error; + gboolean handled; + guint64 expiration; + gulong handler_id; +}; + +void fw_iso_resource_waiter_init(HinokoFwIsoResource *self, struct fw_iso_resource_waiter *w, + const char *signal_name, guint timeout_ms); + +void fw_iso_resource_waiter_wait(HinokoFwIsoResource *self, struct fw_iso_resource_waiter *w, + GError **error); + +#endif diff --git a/src/fw_iso_rx_multiple.c b/src/fw_iso_rx_multiple.c index 7bbce24..c54fbd6 100644 --- a/src/fw_iso_rx_multiple.c +++ b/src/fw_iso_rx_multiple.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" - -#include <errno.h> +#include "fw_iso_ctx_private.h" /** * HinokoFwIsoRxMultiple: diff --git a/src/fw_iso_rx_single.c b/src/fw_iso_rx_single.c index be50a27..7bad45f 100644 --- a/src/fw_iso_rx_single.c +++ b/src/fw_iso_rx_single.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" - -#include <unistd.h> -#include <errno.h> +#include "fw_iso_ctx_private.h" /** * HinokoFwIsoRxSingle: diff --git a/src/fw_iso_tx.c b/src/fw_iso_tx.c index 718ab3f..8d0229a 100644 --- a/src/fw_iso_tx.c +++ b/src/fw_iso_tx.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: LGPL-2.1-or-later -#include "internal.h" - -#include <unistd.h> -#include <errno.h> +#include "fw_iso_ctx_private.h" /** * HinokoFwIsoTx: diff --git a/src/meson.build b/src/meson.build index dd546a0..998095c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,7 +31,8 @@ headers = [ ] privates = [ - 'internal.h', + 'fw_iso_ctx_private.h', + 'fw_iso_resource_private.h', ] inc_dir = meson.project_name() |