History

various: reduce the include scope of some public headers

Kacper Michajłow committed 1 year ago

Commit 77313f71 parent b848ffa16 files · +30 −24Browse files

Unified · Split

16 files
  1. common/stats.c +2 −0
  2. fuzzers/fuzzer_load.c +0 −2
  3. fuzzers/fuzzer_loadfile_direct.c +0 −2
  4. fuzzers/fuzzer_set_property.c +0 −2
  5. input/input.c +2 −0
  6. input/ipc.c +2 −0
  7. misc/json.c +2 −0
  8. misc/json.h +1 −3
  9. misc/node.c +6 −3
  10. misc/node.h +9 −6
  11. player/client.h +0 −1
  12. player/core.h +0 −2
  13. player/loadfile.c +0 −1
  14. test/json.c +2 −0
  15. test/libmpv_common.h +2 −1
  16. test/libmpv_encode.c +2 −1
common/stats.c+2−0
@@ -1,6 +1,8 @@
11 #include <stdatomic.h>
22 #include <time.h>
33
4+#include <libmpv/client.h>
5+
46 #include "common.h"
57 #include "global.h"
68 #include "misc/linked_list.h"
fuzzers/fuzzer_load.c+0−2
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323 #include <sys/mman.h>
2424 #include <unistd.h>
2525
26−#include <libmpv/client.h>
27−
2826 #include "common.h"
2927
3028 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
fuzzers/fuzzer_loadfile_direct.c+0−2
@@ -20,8 +20,6 @@ · 19 unmodified lines
2020
2121 #include <unistd.h>
2222
23−#include <libmpv/client.h>
24−
2523 #include "common.h"
2624
2725 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
fuzzers/fuzzer_set_property.c+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515 * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18−#include <libmpv/client.h>
19−
2018 #include "common.h"
2119
2220 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
input/input.c+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #include <fcntl.h>
2929 #include <assert.h>
3030
31+#include <libmpv/client.h>
32+
3133 #include "osdep/io.h"
3234 #include "misc/rendezvous.h"
3335
input/ipc.c+2−0
@@ -15,6 +15,8 @@ · 14 unmodified lines
1515 * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18+#include <libmpv/client.h>
19+
1820 #include "common/msg.h"
1921 #include "input/input.h"
2022 #include "misc/json.h"
misc/json.c+2−0
@@ -48,6 +48,8 @@ · 47 unmodified lines
4848 #include <inttypes.h>
4949 #include <assert.h>
5050
51+#include <libmpv/client.h>
52+
5153 #include "common/common.h"
5254 #include "misc/bstr.h"
5355 #include "misc/ctype.h"
misc/json.h+1−3
@@ -18,12 +18,10 @@ · 17 unmodified lines
1818 #ifndef MP_JSON_H
1919 #define MP_JSON_H
2020
21−// We reuse mpv_node.
22−#include "libmpv/client.h"
23−
2421 #define MAX_JSON_DEPTH 50
2522
2623 struct bstr;
24+struct mpv_node;
2725
2826 int json_parse(void *ta_parent, struct mpv_node *dst, char **src, int max_depth);
2927 int json_append(struct bstr *b, const struct mpv_node *src, int indent);
misc/node.c+6−3
@@ -1,7 +1,10 @@
1−#include "common/common.h"
2−
31 #include "node.h"
42
3+#include <libmpv/client.h>
4+
5+#include "common/common.h"
6+#include "bstr.h"
7+
58 // Init a node with the given format. If parent is not NULL, it is set as
69 // parent allocation according to m_option_type_node rules (which means
710 // the mpv_node_list allocs are used for chaining the TA allocations).
@@ -117,7 +120,7 @@ mpv_node *node_map_bget(mpv_node *src, struct bstr key) · 109 unmodified lines
117120
118121 // Note: for MPV_FORMAT_NODE_MAP, this (incorrectly) takes the order into
119122 // account, instead of treating it as set.
120−bool equal_mpv_value(const void *a, const void *b, mpv_format format)
123+bool equal_mpv_value(const void *a, const void *b, int format)
121124 {
122125 switch (format) {
123126 case MPV_FORMAT_NONE:
misc/node.h+9−6
@@ -1,21 +1,24 @@
11 #ifndef MP_MISC_NODE_H_
22 #define MP_MISC_NODE_H_
33
4−#include "libmpv/client.h"
5−#include "misc/bstr.h"
4+#include <stdbool.h>
5+#include <stdint.h>
6+
7+struct bstr;
8+struct mpv_node;
69
710 void node_init(struct mpv_node *dst, int format, struct mpv_node *parent);
811 struct mpv_node *node_array_add(struct mpv_node *dst, int format);
912 struct mpv_node *node_map_add(struct mpv_node *dst, const char *key, int format);
1013 struct mpv_node *node_map_badd(struct mpv_node *dst, struct bstr key, int format);
1114 void node_map_add_string(struct mpv_node *dst, const char *key, const char *val);
12−void node_map_add_bstr(struct mpv_node *dst, const char *key, bstr val);
15+void node_map_add_bstr(struct mpv_node *dst, const char *key, struct bstr val);
1316 void node_map_add_int64(struct mpv_node *dst, const char *key, int64_t v);
1417 void node_map_add_double(struct mpv_node *dst, const char *key, double v);
1518 void node_map_add_flag(struct mpv_node *dst, const char *key, bool v);
16−mpv_node *node_map_get(mpv_node *src, const char *key);
17−mpv_node *node_map_bget(mpv_node *src, struct bstr key);
18−bool equal_mpv_value(const void *a, const void *b, mpv_format format);
19+struct mpv_node *node_map_get(struct mpv_node *src, const char *key);
20+struct mpv_node *node_map_bget(struct mpv_node *src, struct bstr key);
21+bool equal_mpv_value(const void *a, const void *b, int format);
1922 bool equal_mpv_node(const struct mpv_node *a, const struct mpv_node *b);
2023
2124 #endif
player/client.h+0−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 #include <stdint.h>
55 #include <stdbool.h>
66
7−#include "libmpv/client.h"
87 #include "libmpv/stream_cb.h"
98 #include "misc/bstr.h"
109
player/core.h+0−2
@@ -21,8 +21,6 @@ · 20 unmodified lines
2121 #include <stdatomic.h>
2222 #include <stdbool.h>
2323
24−#include "libmpv/client.h"
25−
2624 #include "audio/aframe.h"
2725 #include "clipboard/clipboard.h"
2826 #include "common/common.h"
player/loadfile.c+0−1
@@ -60,7 +60,6 @@ · 59 unmodified lines
6060
6161 #include "core.h"
6262 #include "command.h"
63−#include "libmpv/client.h"
6463
6564 // Called from the demuxer thread if a new packet is available, or other changes.
6665 static void wakeup_demux(void *pctx)
test/json.c+2−0
@@ -1,3 +1,5 @@
1+#include <libmpv/client.h>
2+
13 #include "misc/json.h"
24 #include "misc/node.h"
35 #include "test_utils.h"
test/libmpv_common.h+2−1
@@ -16,13 +16,14 @@ · 15 unmodified lines
1616 */
1717
1818 #include <inttypes.h>
19−#include <libmpv/client.h>
2019 #include <stdarg.h>
2120 #include <stdbool.h>
2221 #include <stdio.h>
2322 #include <stdlib.h>
2423 #include <string.h>
2524
25+#include <libmpv/client.h>
26+
2627 // Stolen from osdep/compiler.h
2728 #ifdef __GNUC__
2829 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2)))
test/libmpv_encode.c+2−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 */
1717
1818 #include <inttypes.h>
19−#include <libmpv/client.h>
2019 #include <stdarg.h>
2120 #include <stdio.h>
2221 #include <stdlib.h>
@@ -29,6 +28,8 @@ · 6 unmodified lines
2928 #include <unistd.h>
3029 #endif
3130
31+#include <libmpv/client.h>
32+
3233 // Stolen from osdep/compiler.h
3334 #ifdef __GNUC__
3435 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2)))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t