-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibupipe.lua
1857 lines (1857 loc) · 95.5 KB
/
libupipe.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local ffi = require("ffi")
ffi.cdef [[
enum ubase_err {
UBASE_ERR_NONE,
UBASE_ERR_UNKNOWN,
UBASE_ERR_ALLOC,
UBASE_ERR_NOSPC,
UBASE_ERR_UPUMP,
UBASE_ERR_UNHANDLED,
UBASE_ERR_INVALID,
UBASE_ERR_EXTERNAL,
UBASE_ERR_BUSY,
UBASE_ERR_LOCAL = 32768,
};
enum uref_date_type {
UREF_DATE_NONE,
UREF_DATE_CR,
UREF_DATE_DTS,
UREF_DATE_PTS,
};
enum uprobe_event {
UPROBE_LOG,
UPROBE_FATAL,
UPROBE_ERROR,
UPROBE_READY,
UPROBE_DEAD,
UPROBE_SOURCE_END,
UPROBE_SINK_END,
UPROBE_NEED_OUTPUT,
UPROBE_PROVIDE_REQUEST,
UPROBE_NEED_UPUMP_MGR,
UPROBE_FREEZE_UPUMP_MGR,
UPROBE_THAW_UPUMP_MGR,
UPROBE_NEW_FLOW_DEF,
UPROBE_NEW_RAP,
UPROBE_SPLIT_UPDATE,
UPROBE_SYNC_ACQUIRED,
UPROBE_SYNC_LOST,
UPROBE_CLOCK_REF,
UPROBE_CLOCK_TS,
UPROBE_CLOCK_UTC,
UPROBE_LOCAL = 32768,
};
enum upipe_command {
UPIPE_ATTACH_UREF_MGR,
UPIPE_ATTACH_UPUMP_MGR,
UPIPE_ATTACH_UCLOCK,
UPIPE_GET_URI,
UPIPE_SET_URI,
UPIPE_GET_OPTION,
UPIPE_SET_OPTION,
UPIPE_REGISTER_REQUEST,
UPIPE_UNREGISTER_REQUEST,
UPIPE_SET_FLOW_DEF,
UPIPE_GET_MAX_LENGTH,
UPIPE_SET_MAX_LENGTH,
UPIPE_FLUSH,
UPIPE_GET_OUTPUT,
UPIPE_SET_OUTPUT,
UPIPE_ATTACH_UBUF_MGR,
UPIPE_GET_FLOW_DEF,
UPIPE_GET_OUTPUT_SIZE,
UPIPE_SET_OUTPUT_SIZE,
UPIPE_SPLIT_ITERATE,
UPIPE_GET_SUB_MGR,
UPIPE_ITERATE_SUB,
UPIPE_SUB_GET_SUPER,
UPIPE_SRC_GET_SIZE,
UPIPE_SRC_GET_POSITION,
UPIPE_SRC_SET_POSITION,
UPIPE_SRC_SET_RANGE,
UPIPE_SRC_GET_RANGE,
UPIPE_CONTROL_LOCAL = 32768,
};
typedef uint32_t volatile uatomic_uint32_t;
typedef void (*urefcount_cb)(struct urefcount *);
struct urefcount {
uatomic_uint32_t refcount;
urefcount_cb cb;
};
struct uclock {
struct urefcount *refcount;
uint64_t (*uclock_now)(struct uclock *);
time_t (*uclock_mktime)(struct uclock *, uint64_t);
};
enum uclock_std_flags {
UCLOCK_FLAG_REALTIME = 1,
};
struct uclock *uclock_std_alloc(enum uclock_std_flags);
struct umem {
struct umem_mgr *mgr;
uint8_t *buffer;
size_t size;
size_t real_size;
};
struct umem_mgr {
struct urefcount *refcount;
bool (*umem_alloc)(struct umem_mgr *, struct umem *, size_t);
bool (*umem_realloc)(struct umem *, size_t);
void (*umem_free)(struct umem *);
void (*umem_mgr_vacuum)(struct umem_mgr *);
};
struct umem_mgr *umem_alloc_mgr_alloc(void);
struct umem_mgr *umem_pool_mgr_alloc(size_t, size_t, ...);
struct umem_mgr *umem_pool_mgr_alloc_simple(uint16_t);
struct uchain {
struct uchain *next;
struct uchain *prev;
};
struct ubuf {
struct uchain uchain;
struct ubuf_mgr *mgr;
};
struct ubuf_mgr {
struct urefcount *refcount;
uint32_t signature;
struct ubuf *(*ubuf_alloc)(struct ubuf_mgr *, uint32_t, va_list);
int (*ubuf_control)(struct ubuf *, int, va_list);
void (*ubuf_free)(struct ubuf *);
int (*ubuf_mgr_control)(struct ubuf_mgr *, int, va_list);
};
struct ubuf_mgr *ubuf_block_mem_mgr_alloc(uint16_t, uint16_t, struct umem_mgr *, int, int);
struct udict {
struct udict_mgr *mgr;
};
struct udict_mgr {
struct urefcount *refcount;
struct udict *(*udict_alloc)(struct udict_mgr *, size_t);
int (*udict_control)(struct udict *, int, va_list);
void (*udict_free)(struct udict *);
int (*udict_mgr_control)(struct udict_mgr *, int, va_list);
};
struct uref_mgr {
struct urefcount *refcount;
size_t control_attr_size;
struct udict_mgr *udict_mgr;
struct uref *(*uref_alloc)(struct uref_mgr *);
void (*uref_free)(struct uref *);
int (*uref_mgr_control)(struct uref_mgr *, int, va_list);
};
struct uref {
struct uchain uchain;
struct uref_mgr *mgr;
struct ubuf *ubuf;
struct udict *udict;
uint64_t flags;
uint64_t date_sys;
uint64_t date_prog;
uint64_t date_orig;
uint64_t dts_pts_delay;
uint64_t cr_dts_delay;
uint64_t rap_cr_delay;
uint64_t priv;
};
struct ubuf_mgr *ubuf_mem_mgr_alloc_from_flow_def(uint16_t, uint16_t, struct umem_mgr *, struct uref *);
typedef uint16_t uring_index;
struct uring_elem {
uint16_t tag;
uring_index next;
void *opaque;
};
struct uring {
uint16_t length;
struct uring_elem *elems;
};
typedef uatomic_uint32_t uring_lifo;
struct ulifo {
struct uring uring;
uring_lifo lifo_carrier;
uring_lifo lifo_empty;
};
typedef void *(*upool_alloc_cb)(struct upool *);
typedef void (*upool_free_cb)(struct upool *, void *);
struct upool {
struct ulifo lifo;
upool_alloc_cb alloc_cb;
upool_free_cb free_cb;
};
void *ubuf_mem_shared_alloc_inner(struct upool *);
void ubuf_mem_shared_free_inner(struct upool *, void *);
int ubuf_pic_common_check_size(struct ubuf_mgr *, int, int);
int ubuf_pic_common_dup(struct ubuf *, struct ubuf *);
int ubuf_pic_common_plane_dup(struct ubuf *, struct ubuf *, uint8_t);
int ubuf_pic_common_size(struct ubuf *, size_t *, size_t *, uint8_t *);
int ubuf_pic_common_plane_iterate(struct ubuf *, char const **);
int ubuf_pic_common_plane_size(struct ubuf *, char const *, size_t *, uint8_t *, uint8_t *, uint8_t *);
int ubuf_pic_common_plane_map(struct ubuf *, char const *, int, int, int, int, uint8_t **);
int ubuf_pic_common_check_skip(struct ubuf_mgr *, int, int);
int ubuf_pic_common_resize(struct ubuf *, int, int, int, int);
void ubuf_pic_common_mgr_clean(struct ubuf_mgr *);
void ubuf_pic_common_mgr_init(struct ubuf_mgr *, uint8_t);
int ubuf_pic_common_mgr_add_plane(struct ubuf_mgr *, char const *, uint8_t, uint8_t, uint8_t);
int ubuf_pic_plane_clear(struct ubuf *, char const *, int, int, int, int, int);
int ubuf_pic_clear(struct ubuf *, int, int, int, int, int);
struct ubuf_mgr *ubuf_pic_mem_mgr_alloc(uint16_t, uint16_t, struct umem_mgr *, uint8_t, int, int, int, int, int, int);
int ubuf_pic_mem_mgr_add_plane(struct ubuf_mgr *, char const *, uint8_t, uint8_t, uint8_t);
struct ubuf_mgr *ubuf_pic_mem_mgr_alloc_fourcc(uint16_t, uint16_t, struct umem_mgr *, char const *, int, int, int, int, int, int);
int ubuf_sound_common_dup(struct ubuf *, struct ubuf *);
int ubuf_sound_common_plane_dup(struct ubuf *, struct ubuf *, uint8_t);
int ubuf_sound_common_size(struct ubuf *, size_t *, uint8_t *);
int ubuf_sound_common_plane_iterate(struct ubuf *, char const **);
int ubuf_sound_common_plane_map(struct ubuf *, char const *, int, int, uint8_t **);
int ubuf_sound_common_resize(struct ubuf *, int, int);
void ubuf_sound_common_mgr_clean(struct ubuf_mgr *);
void ubuf_sound_common_mgr_init(struct ubuf_mgr *, uint8_t);
int ubuf_sound_common_mgr_add_plane(struct ubuf_mgr *, char const *);
struct ubuf_mgr *ubuf_sound_mem_mgr_alloc(uint16_t, uint16_t, struct umem_mgr *, uint8_t, uint64_t);
int ubuf_sound_mem_mgr_add_plane(struct ubuf_mgr *, char const *);
struct udict_mgr *udict_inline_mgr_alloc(unsigned int, struct umem_mgr *, int, int);
struct uref_mgr *uref_std_mgr_alloc(uint16_t, struct udict_mgr *, int);
struct ustring {
char *at;
size_t len;
};
struct uuri_authority {
struct ustring userinfo;
struct ustring host;
struct ustring port;
};
struct uuri {
struct ustring scheme;
struct uuri_authority authority;
struct ustring path;
struct ustring query;
struct ustring fragment;
};
int uref_uri_set(struct uref *, struct uuri const *);
int uref_uri_get(struct uref *, struct uuri *);
int uref_uri_set_from_str(struct uref *, char const *);
int uref_uri_get_to_str(struct uref *, char **);
struct upump;
struct upipe_mgr {
struct urefcount *refcount;
unsigned int signature;
char const *(*upipe_err_str)(int);
char const *(*upipe_command_str)(int);
char const *(*upipe_event_str)(int);
struct upipe *(*upipe_alloc)(struct upipe_mgr *, struct uprobe *, uint32_t, va_list);
void (*upipe_input)(struct upipe *, struct uref *, struct upump **);
int (*upipe_control)(struct upipe *, int, va_list);
int (*upipe_mgr_control)(struct upipe_mgr *, int, va_list);
};
struct upipe {
struct urefcount *refcount;
struct uchain uchain;
void *opaque;
struct uprobe *uprobe;
struct upipe_mgr *mgr;
};
typedef int (*uprobe_throw_func)(struct uprobe *, struct upipe *, int, va_list);
struct uprobe {
struct urefcount *refcount;
uprobe_throw_func uprobe_throw;
struct uprobe *next;
};
void uprobe_dejitter_set(struct uprobe *, bool, uint64_t);
struct urational {
int64_t num;
uint64_t den;
};
struct uprobe_dejitter {
unsigned int offset_divider;
unsigned int deviation_divider;
unsigned int offset_count;
double offset;
unsigned int deviation_count;
double deviation;
uint64_t last_cr_prog;
uint64_t last_cr_sys;
struct urational drift_rate;
uint64_t last_print;
struct uprobe uprobe;
};
struct uprobe *uprobe_dejitter_init(struct uprobe_dejitter *, struct uprobe *, bool, uint64_t);
void uprobe_dejitter_clean(struct uprobe_dejitter *);
struct uprobe *uprobe_dejitter_alloc(struct uprobe *, bool, uint64_t);
enum uprobe_log_level {
UPROBE_LOG_VERBOSE,
UPROBE_LOG_DEBUG,
UPROBE_LOG_NOTICE,
UPROBE_LOG_WARNING,
UPROBE_LOG_ERROR,
};
struct uprobe_loglevel {
enum uprobe_log_level min_level;
struct uprobe uprobe;
struct uchain patterns;
};
struct uprobe *uprobe_loglevel_init(struct uprobe_loglevel *, struct uprobe *, enum uprobe_log_level);
void uprobe_loglevel_clean(struct uprobe_loglevel *);
struct uprobe *uprobe_loglevel_alloc(struct uprobe *, enum uprobe_log_level);
int uprobe_loglevel_set(struct uprobe *, char const *, enum uprobe_log_level);
struct uprobe_pfx {
char *name;
enum uprobe_log_level min_level;
struct uprobe uprobe;
};
struct uprobe *uprobe_pfx_init(struct uprobe_pfx *, struct uprobe *, enum uprobe_log_level, char const *);
void uprobe_pfx_clean(struct uprobe_pfx *);
struct uprobe *uprobe_pfx_alloc(struct uprobe *, enum uprobe_log_level, char const *);
struct uprobe *uprobe_pfx_alloc_va(struct uprobe *, enum uprobe_log_level, char const *, ...);
struct uprobe_output {
struct uprobe uprobe;
};
struct uprobe *uprobe_output_init(struct uprobe_output *, struct uprobe *);
void uprobe_output_clean(struct uprobe_output *);
struct uprobe *uprobe_output_alloc(struct uprobe *);
enum uprobe_selflow_type {
UPROBE_SELFLOW_VOID,
UPROBE_SELFLOW_PIC,
UPROBE_SELFLOW_SOUND,
UPROBE_SELFLOW_SUBPIC,
};
struct uprobe *uprobe_selflow_alloc(struct uprobe *, struct uprobe *, enum uprobe_selflow_type, char const *);
void uprobe_selflow_get(struct uprobe *, char const **);
int uprobe_selflow_set(struct uprobe *, char const *);
int uprobe_selflow_set_va(struct uprobe *, char const *, ...);
struct uprobe_stdio {
FILE *stream;
enum uprobe_log_level min_level;
struct uprobe uprobe;
};
struct uprobe *uprobe_stdio_init(struct uprobe_stdio *, struct uprobe *, FILE *, enum uprobe_log_level);
void uprobe_stdio_clean(struct uprobe_stdio *);
struct uprobe *uprobe_stdio_alloc(struct uprobe *, FILE *, enum uprobe_log_level);
struct uprobe_stdio_color {
FILE *stream;
enum uprobe_log_level min_level;
struct uprobe uprobe;
};
struct uprobe *uprobe_stdio_color_init(struct uprobe_stdio_color *, struct uprobe *, FILE *, enum uprobe_log_level);
void uprobe_stdio_color_clean(struct uprobe_stdio_color *);
struct uprobe *uprobe_stdio_color_alloc(struct uprobe *, FILE *, enum uprobe_log_level);
struct uprobe_syslog {
char *ident;
int facility;
bool inited;
enum uprobe_log_level min_level;
struct uprobe uprobe;
};
struct uprobe *uprobe_syslog_init(struct uprobe_syslog *, struct uprobe *, char const *, int, int, enum uprobe_log_level);
void uprobe_syslog_clean(struct uprobe_syslog *);
struct uprobe *uprobe_syslog_alloc(struct uprobe *, char const *, int, int, enum uprobe_log_level);
struct uprobe_xfer {
struct uchain subs;
struct uprobe uprobe;
};
struct uprobe *uprobe_xfer_init(struct uprobe_xfer *, struct uprobe *);
void uprobe_xfer_clean(struct uprobe_xfer *);
struct uprobe *uprobe_xfer_alloc(struct uprobe *);
enum uprobe_xfer_event {
UPROBE_XFER_SENTINEL = 65536,
UPROBE_XFER_VOID,
UPROBE_XFER_UINT64_T,
UPROBE_XFER_UNSIGNED_LONG_LOCAL,
};
int uprobe_xfer_add(struct uprobe *, enum uprobe_xfer_event, int, uint32_t);
struct uprobe_ubuf_mem {
struct umem_mgr *umem_mgr;
uint16_t ubuf_pool_depth;
uint16_t shared_pool_depth;
struct uprobe uprobe;
};
struct uprobe *uprobe_ubuf_mem_init(struct uprobe_ubuf_mem *, struct uprobe *, struct umem_mgr *, uint16_t, uint16_t);
void uprobe_ubuf_mem_clean(struct uprobe_ubuf_mem *);
struct uprobe *uprobe_ubuf_mem_alloc(struct uprobe *, struct umem_mgr *, uint16_t, uint16_t);
void uprobe_ubuf_mem_set(struct uprobe *, struct umem_mgr *);
typedef void *volatile uatomic_ptr_t;
struct uprobe_ubuf_mem_pool {
struct umem_mgr *umem_mgr;
uint16_t ubuf_pool_depth;
uint16_t shared_pool_depth;
uatomic_ptr_t first;
struct uprobe uprobe;
};
struct uprobe *uprobe_ubuf_mem_pool_init(struct uprobe_ubuf_mem_pool *, struct uprobe *, struct umem_mgr *, uint16_t, uint16_t);
void uprobe_ubuf_mem_pool_vacuum(struct uprobe_ubuf_mem_pool *);
void uprobe_ubuf_mem_pool_clean(struct uprobe_ubuf_mem_pool *);
struct uprobe *uprobe_ubuf_mem_pool_alloc(struct uprobe *, struct umem_mgr *, uint16_t, uint16_t);
void uprobe_ubuf_mem_pool_set(struct uprobe *, struct umem_mgr *);
struct uprobe_uclock {
struct uclock *uclock;
struct uprobe uprobe;
};
struct uprobe *uprobe_uclock_init(struct uprobe_uclock *, struct uprobe *, struct uclock *);
void uprobe_uclock_clean(struct uprobe_uclock *);
struct uprobe *uprobe_uclock_alloc(struct uprobe *, struct uclock *);
void uprobe_uclock_set(struct uprobe *, struct uclock *);
enum upump_type {
UPUMP_TYPE_IDLER,
UPUMP_TYPE_TIMER,
UPUMP_TYPE_FD_READ,
UPUMP_TYPE_FD_WRITE,
};
struct upump_blocker;
struct upump_mgr {
struct urefcount *refcount;
struct uchain uchain;
void *opaque;
struct upump *(*upump_alloc)(struct upump_mgr *, enum upump_type, va_list);
void (*upump_start)(struct upump *);
void (*upump_stop)(struct upump *);
void (*upump_free)(struct upump *);
struct upump_blocker *(*upump_blocker_alloc)(struct upump *);
void (*upump_blocker_free)(struct upump_blocker *);
int (*upump_mgr_control)(struct upump_mgr *, int, va_list);
};
struct uprobe_upump_mgr {
struct upump_mgr *upump_mgr;
bool frozen;
struct uprobe uprobe;
};
struct uprobe *uprobe_upump_mgr_init(struct uprobe_upump_mgr *, struct uprobe *, struct upump_mgr *);
void uprobe_upump_mgr_clean(struct uprobe_upump_mgr *);
struct uprobe *uprobe_upump_mgr_alloc(struct uprobe *, struct upump_mgr *);
void uprobe_upump_mgr_set(struct uprobe *, struct upump_mgr *);
struct uprobe_uref_mgr {
struct uref_mgr *uref_mgr;
struct uprobe uprobe;
};
struct uprobe *uprobe_uref_mgr_init(struct uprobe_uref_mgr *, struct uprobe *, struct uref_mgr *);
void uprobe_uref_mgr_clean(struct uprobe_uref_mgr *);
struct uprobe *uprobe_uref_mgr_alloc(struct uprobe *, struct uref_mgr *);
void uprobe_uref_mgr_set(struct uprobe *, struct uref_mgr *);
struct upump_blocker *upump_common_blocker_alloc(struct upump *);
void upump_common_blocker_free(struct upump_blocker *);
void upump_common_blocker_free_inner(struct upool *, void *);
void upump_common_init(struct upump *);
void upump_common_dispatch(struct upump *);
void upump_common_start(struct upump *);
void upump_common_stop(struct upump *);
void upump_common_clean(struct upump *);
size_t upump_common_mgr_sizeof(uint16_t, uint16_t);
void upump_common_mgr_vacuum(struct upump_mgr *);
void upump_common_mgr_clean(struct upump_mgr *);
void upump_common_mgr_init(struct upump_mgr *, uint16_t, uint16_t, void *, void (*)(struct upump *), void (*)(struct upump *), void *(*)(struct upool *), void (*)(struct upool *, void *));
ssize_t uuri_escape(char const *, char *, size_t);
ssize_t uuri_unescape(char const *, char *, size_t);
struct ustring uuri_parse_ipv4(struct ustring *);
struct ustring uuri_parse_ipv6(struct ustring *);
struct ustring uuri_parse_ipv6_scoped(struct ustring *);
struct ustring uuri_parse_ipvfuture(struct ustring *);
struct ustring uuri_parse_scheme(struct ustring *);
struct ustring uuri_parse_userinfo(struct ustring *);
struct ustring uuri_parse_host(struct ustring *);
struct ustring uuri_parse_port(struct ustring *);
struct uuri_authority uuri_parse_authority(struct ustring *);
struct ustring uuri_parse_path(struct ustring *);
struct ustring uuri_parse_query(struct ustring *);
struct ustring uuri_parse_fragment(struct ustring *);
struct uuri uuri_parse(struct ustring *);
int uuri_authority_len(struct uuri_authority const *, size_t *);
int uuri_len(struct uuri const *, size_t *);
int uuri_authority_to_buffer(struct uuri_authority const *, char *, size_t);
int uuri_to_buffer(struct uuri *, char *, size_t);
int uuri_to_str(struct uuri *, char **);
struct ucookie {
struct ustring name;
struct ustring value;
struct ustring expires;
struct ustring max_age;
struct ustring domain;
struct ustring path;
bool secure;
bool http_only;
};
int ucookie_from_str(struct ucookie *, char const *);
void urefcount_release(struct urefcount *);
bool urefcount_single(struct urefcount *);
bool urefcount_dead(struct urefcount *);
int ubuf_block_check_size(struct ubuf *, int *, int *);
struct uring_elem *uring_elem_from_index(struct uring *, uring_index);
typedef uint32_t uring_lifo_val;
uring_index uring_lifo_to_index(struct uring *, uring_lifo_val);
uring_lifo_val uring_lifo_from_index(struct uring *, uring_index);
typedef uint32_t uring_fifo_val;
void uring_fifo_set_head(struct uring *, uring_fifo_val *, uring_index);
uring_index uring_fifo_get_tail(struct uring *, uring_fifo_val);
uring_index uring_fifo_get_head(struct uring *, uring_fifo_val);
uring_lifo_val uring_init(struct uring *, uint16_t, void *);
enum ueventfd_mode {
UEVENTFD_MODE_EVENTFD,
UEVENTFD_MODE_PIPE,
};
struct ueventfd {
enum ueventfd_mode mode;
union {
int event_fd;
int pipe_fds[2];
};
};
typedef void (*upump_cb)(struct upump *);
struct upump *ueventfd_upump_alloc(struct ueventfd *, struct upump_mgr *, upump_cb, void *);
bool ueventfd_read(struct ueventfd *);
bool ueventfd_write(struct ueventfd *);
void ueventfd_clean(struct ueventfd *);
enum udict_type {
UDICT_TYPE_END,
UDICT_TYPE_OPAQUE,
UDICT_TYPE_STRING,
UDICT_TYPE_VOID,
UDICT_TYPE_BOOL,
UDICT_TYPE_SMALL_UNSIGNED,
UDICT_TYPE_SMALL_INT,
UDICT_TYPE_UNSIGNED,
UDICT_TYPE_INT,
UDICT_TYPE_RATIONAL,
UDICT_TYPE_FLOAT,
UDICT_TYPE_SHORTHAND = 16,
UDICT_TYPE_FLOW_RANDOM,
UDICT_TYPE_FLOW_ERROR,
UDICT_TYPE_FLOW_DEF,
UDICT_TYPE_FLOW_ID,
UDICT_TYPE_FLOW_RAWDEF,
UDICT_TYPE_FLOW_LANGUAGES,
UDICT_TYPE_EVENT_EVENTS,
UDICT_TYPE_CLOCK_DURATION,
UDICT_TYPE_CLOCK_RATE,
UDICT_TYPE_CLOCK_LATENCY,
UDICT_TYPE_BLOCK_END,
UDICT_TYPE_PIC_NUM,
UDICT_TYPE_PIC_KEY,
UDICT_TYPE_PIC_HSIZE,
UDICT_TYPE_PIC_VSIZE,
UDICT_TYPE_PIC_HSIZE_VISIBLE,
UDICT_TYPE_PIC_VSIZE_VISIBLE,
UDICT_TYPE_PIC_VIDEO_FORMAT,
UDICT_TYPE_PIC_FULL_RANGE,
UDICT_TYPE_PIC_COLOUR_PRIMARIES,
UDICT_TYPE_PIC_TRANSFER_CHARACTERISTICS,
UDICT_TYPE_PIC_MATRIX_COEFFICIENTS,
UDICT_TYPE_PIC_HPOSITION,
UDICT_TYPE_PIC_VPOSITION,
UDICT_TYPE_PIC_SAR,
UDICT_TYPE_PIC_OVERSCAN,
UDICT_TYPE_PIC_PROGRESSIVE,
UDICT_TYPE_PIC_TF,
UDICT_TYPE_PIC_BF,
UDICT_TYPE_PIC_TFF,
UDICT_TYPE_PIC_AFD,
UDICT_TYPE_PIC_CEA_708,
};
int udict_get_string(struct udict *, char const **, enum udict_type, char const *);
int udict_get_bool(struct udict *, bool *, enum udict_type, char const *);
int udict_get_small_unsigned(struct udict *, uint8_t *, enum udict_type, char const *);
int udict_get_small_int(struct udict *, int8_t *, enum udict_type, char const *);
int udict_get_unsigned(struct udict *, uint64_t *, enum udict_type, char const *);
int udict_get_int(struct udict *, int64_t *, enum udict_type, char const *);
int udict_get_float(struct udict *, double *, enum udict_type, char const *);
int udict_get_rational(struct udict *, struct urational *, enum udict_type, char const *);
void udict_set_int64(uint8_t *, int64_t);
typedef uatomic_uint32_t uring_fifo;
struct ufifo {
struct uring uring;
uring_fifo fifo_carrier;
uring_lifo lifo_empty;
};
bool ufifo_push(struct ufifo *, void *);
typedef int (*urequest_func)(struct urequest *, va_list);
typedef void (*urequest_free_func)(struct urequest *);
struct urequest {
struct uchain uchain;
void *opaque;
int type;
struct uref *uref;
urequest_func urequest_provide;
urequest_free_func urequest_free;
};
void urequest_init(struct urequest *, int, struct uref *, urequest_func, urequest_free_func);
int upipe_control_nodbg_va(struct upipe *, int, va_list);
void uchain_init(struct uchain *);
char const *ubase_err_str(int);
bool ubase_check(int);
uint64_t ubase_gcd(uint64_t, uint64_t);
void urational_simplify(struct urational *);
struct urational urational_add(struct urational const *, struct urational const *);
struct urational urational_multiply(struct urational const *, struct urational const *);
struct urational urational_divide(struct urational const *, struct urational const *);
int ubase_ncmp(char const *, char const *);
void ubase_clean_ptr(void **);
void ubase_clean_str(char **);
void ubase_clean_data(uint8_t **);
void ubase_clean_fd(int *);
void uatomic_init(uatomic_uint32_t *, uint32_t);
void uatomic_store(uatomic_uint32_t *, uint32_t);
uint32_t uatomic_load(uatomic_uint32_t *);
bool uatomic_compare_exchange(uatomic_uint32_t *, uint32_t *, uint32_t);
void uatomic_clean(uatomic_uint32_t *);
void uatomic_ptr_init(uatomic_ptr_t *, void *);
void uatomic_ptr_store(uatomic_ptr_t *, void *);
void *uatomic_ptr_load(uatomic_ptr_t *);
bool uatomic_ptr_compare_exchange(uatomic_ptr_t *, void **, void *);
void uatomic_ptr_clean(uatomic_ptr_t *);
uint32_t uatomic_fetch_add(uatomic_uint32_t *, uint32_t);
uint32_t uatomic_fetch_sub(uatomic_uint32_t *, uint32_t);
void urefcount_init(struct urefcount *, urefcount_cb);
void urefcount_reset(struct urefcount *);
struct urefcount *urefcount_use(struct urefcount *);
void urefcount_clean(struct urefcount *);
struct ubuf *ubuf_alloc(struct ubuf_mgr *, uint32_t, ...);
int ubuf_control_va(struct ubuf *, int, va_list);
int ubuf_control(struct ubuf *, int, ...);
struct ubuf *ubuf_dup(struct ubuf *);
void ubuf_free(struct ubuf *);
struct ubuf_mgr *ubuf_mgr_use(struct ubuf_mgr *);
void ubuf_mgr_release(struct ubuf_mgr *);
int ubuf_mgr_control_va(struct ubuf_mgr *, int, va_list);
int ubuf_mgr_control(struct ubuf_mgr *, int, ...);
int ubuf_mgr_check(struct ubuf_mgr *, struct uref *);
int ubuf_mgr_vacuum(struct ubuf_mgr *);
struct ubuf *ubuf_block_alloc(struct ubuf_mgr *, int);
int ubuf_block_size(struct ubuf *, size_t *);
struct ubuf *ubuf_block_get(struct ubuf *, int *, int *);
int ubuf_block_size_linear(struct ubuf *, int, size_t *);
int ubuf_block_read(struct ubuf *, int, int *, uint8_t const **);
int ubuf_block_write(struct ubuf *, int, int *, uint8_t **);
int ubuf_block_unmap(struct ubuf *, int);
int ubuf_block_append(struct ubuf *, struct ubuf *);
int ubuf_block_split(struct ubuf *, int);
int ubuf_block_insert(struct ubuf *, int, struct ubuf *);
int ubuf_block_delete(struct ubuf *, int, int);
int ubuf_block_truncate(struct ubuf *, int);
int ubuf_block_resize(struct ubuf *, int, int);
struct ubuf *ubuf_block_splice(struct ubuf *, int, int);
uint8_t const *ubuf_block_peek(struct ubuf *, int, int, uint8_t *);
int ubuf_block_peek_unmap(struct ubuf *, int, uint8_t *, uint8_t const *);
int ubuf_block_extract(struct ubuf *, int, int, uint8_t *);
int ubuf_block_iovec_count(struct ubuf *, int, int);
int ubuf_block_iovec_read(struct ubuf *, int, int, struct iovec *);
int ubuf_block_iovec_unmap(struct ubuf *, int, int, struct iovec *);
bool ubuf_block_check_resize(struct ubuf *, int *, int *, size_t *);
struct ubuf *ubuf_block_copy(struct ubuf_mgr *, struct ubuf *, int, int);
int ubuf_block_merge(struct ubuf_mgr *, struct ubuf **, int, int);
int ubuf_block_compare(struct ubuf *, int, struct ubuf *);
int ubuf_block_equal(struct ubuf *, struct ubuf *);
int ubuf_block_match(struct ubuf *, uint8_t const *, uint8_t const *, size_t);
int ubuf_block_scan(struct ubuf *, size_t *, uint8_t);
int ubuf_block_find_va(struct ubuf *, size_t *, unsigned int, va_list);
int ubuf_block_find(struct ubuf *, size_t *, unsigned int, ...);
void ubuf_block_common_init(struct ubuf *, bool);
void ubuf_block_common_set(struct ubuf *, size_t, size_t);
void ubuf_block_common_set_buffer(struct ubuf *, uint8_t *);
int ubuf_block_common_dup(struct ubuf *, struct ubuf *);
int ubuf_block_common_splice(struct ubuf *, struct ubuf *, int, int);
void ubuf_block_common_clean(struct ubuf *);
struct ubuf_block_stream {
struct ubuf *ubuf;
uint8_t const *buffer;
uint8_t const *end;
int offset;
int size;
uint32_t bits;
uint32_t available;
bool overflow;
};
int ubuf_block_stream_init(struct ubuf_block_stream *, struct ubuf *, int);
int ubuf_block_stream_clean(struct ubuf_block_stream *);
int ubuf_block_stream_get(struct ubuf_block_stream *, uint8_t *);
void uring_elem_set(struct uring *, uring_index, void *);
void *uring_elem_get(struct uring *, uring_index);
void uring_lifo_init(struct uring *, uring_lifo *, uring_lifo_val);
void uring_lifo_clean(struct uring *, uring_lifo *);
uring_index uring_lifo_pop(struct uring *, uring_lifo *);
void uring_lifo_push(struct uring *, uring_lifo *, uring_index);
void uring_fifo_set_tail(struct uring *, uring_fifo_val *, uring_index);
uring_index uring_fifo_find(struct uring *, uring_index, uring_index);
uring_index uring_fifo_pop(struct uring *, uring_fifo *);
void uring_fifo_push(struct uring *, uring_fifo *, uring_index);
void uring_fifo_init(struct uring *, uring_fifo *);
void uring_fifo_clean(struct uring *, uring_fifo *);
void ulifo_init(struct ulifo *, uint16_t, void *);
bool ulifo_push(struct ulifo *, void *);
void *ulifo_pop_internal(struct ulifo *);
void ulifo_clean(struct ulifo *);
void upool_init(struct upool *, uint16_t, void *, upool_alloc_cb, upool_free_cb);
void *upool_alloc_internal(struct upool *);
void upool_free(struct upool *, void *);
void upool_vacuum(struct upool *);
void upool_clean(struct upool *);
uint8_t *umem_buffer(struct umem *);
size_t umem_size(struct umem *);
bool umem_alloc(struct umem_mgr *, struct umem *, size_t);
bool umem_realloc(struct umem *, size_t);
void umem_free(struct umem *);
void umem_mgr_vacuum(struct umem_mgr *);
struct umem_mgr *umem_mgr_use(struct umem_mgr *);
void umem_mgr_release(struct umem_mgr *);
struct ubuf_mem_shared {
uatomic_uint32_t refcount;
struct umem umem;
};
struct ubuf_mem_shared *ubuf_mem_shared_use(struct ubuf_mem_shared *);
bool ubuf_mem_shared_release(struct ubuf_mem_shared *);
bool ubuf_mem_shared_single(struct ubuf_mem_shared *);
uint8_t *ubuf_mem_shared_buffer(struct ubuf_mem_shared *);
size_t ubuf_mem_shared_size(struct ubuf_mem_shared *);
int ubuf_pic_common_plane(struct ubuf_mgr *, char const *);
size_t ubuf_pic_common_sizeof(struct ubuf_mgr *);
void ubuf_pic_common_init(struct ubuf *, size_t, size_t, size_t, size_t, size_t, size_t);
void ubuf_pic_common_clean(struct ubuf *);
void ubuf_pic_common_plane_init(struct ubuf *, uint8_t, uint8_t *, size_t);
void ubuf_pic_common_plane_clean(struct ubuf *, uint8_t);
struct ubuf *ubuf_pic_alloc(struct ubuf_mgr *, int, int);
int ubuf_pic_size(struct ubuf *, size_t *, size_t *, uint8_t *);
int ubuf_pic_plane_iterate(struct ubuf *, char const **);
int ubuf_pic_plane_size(struct ubuf *, char const *, size_t *, uint8_t *, uint8_t *, uint8_t *);
int ubuf_pic_plane_check_offset(struct ubuf *, char const *, int *, int *, int *, int *);
int ubuf_pic_plane_read(struct ubuf *, char const *, int, int, int, int, uint8_t const **);
int ubuf_pic_plane_write(struct ubuf *, char const *, int, int, int, int, uint8_t **);
int ubuf_pic_plane_unmap(struct ubuf *, char const *, int, int, int, int);
int ubuf_pic_check_resize(struct ubuf *, int *, int *, int *, int *, size_t *, size_t *, uint8_t *);
int ubuf_pic_resize(struct ubuf *, int, int, int, int);
int ubuf_pic_blit(struct ubuf *, struct ubuf *, int, int, int, int, int, int);
struct ubuf *ubuf_pic_copy(struct ubuf_mgr *, struct ubuf *, int, int, int, int);
int ubuf_pic_replace(struct ubuf_mgr *, struct ubuf **, int, int, int, int);
int ubuf_sound_common_plane(struct ubuf_mgr *, char const *);
size_t ubuf_sound_common_sizeof(struct ubuf_mgr *);
void ubuf_sound_common_init(struct ubuf *, size_t);
void ubuf_sound_common_clean(struct ubuf *);
void ubuf_sound_common_plane_init(struct ubuf *, uint8_t, uint8_t *);
void ubuf_sound_common_plane_clean(struct ubuf *, uint8_t);
struct ubuf *ubuf_sound_alloc(struct ubuf_mgr *, int);
int ubuf_sound_size(struct ubuf *, size_t *, uint8_t *);
int ubuf_sound_plane_iterate(struct ubuf *, char const **);
int ubuf_sound_plane_unmap(struct ubuf *, char const *, int, int);
int ubuf_sound_unmap(struct ubuf *, int, int, uint8_t);
int ubuf_sound_plane_read_void(struct ubuf *, char const *, int, int, void const **);
int ubuf_sound_plane_write_void(struct ubuf *, char const *, int, int, void **);
int ubuf_sound_read_void(struct ubuf *, int, int, void const **, uint8_t);
int ubuf_sound_write_void(struct ubuf *, int, int, void **, uint8_t);
int ubuf_sound_plane_read_uint8_t(struct ubuf *, char const *, int, int, uint8_t const **);
int ubuf_sound_plane_write_uint8_t(struct ubuf *, char const *, int, int, uint8_t **);
int ubuf_sound_read_uint8_t(struct ubuf *, int, int, uint8_t const **, uint8_t);
int ubuf_sound_write_uint8_t(struct ubuf *, int, int, uint8_t **, uint8_t);
int ubuf_sound_plane_read_int16_t(struct ubuf *, char const *, int, int, int16_t const **);
int ubuf_sound_plane_write_int16_t(struct ubuf *, char const *, int, int, int16_t **);
int ubuf_sound_read_int16_t(struct ubuf *, int, int, int16_t const **, uint8_t);
int ubuf_sound_write_int16_t(struct ubuf *, int, int, int16_t **, uint8_t);
int ubuf_sound_plane_read_int32_t(struct ubuf *, char const *, int, int, int32_t const **);
int ubuf_sound_plane_write_int32_t(struct ubuf *, char const *, int, int, int32_t **);
int ubuf_sound_read_int32_t(struct ubuf *, int, int, int32_t const **, uint8_t);
int ubuf_sound_write_int32_t(struct ubuf *, int, int, int32_t **, uint8_t);
int ubuf_sound_plane_read_float(struct ubuf *, char const *, int, int, float const **);
int ubuf_sound_plane_write_float(struct ubuf *, char const *, int, int, float **);
int ubuf_sound_read_float(struct ubuf *, int, int, float const **, uint8_t);
int ubuf_sound_write_float(struct ubuf *, int, int, float **, uint8_t);
int ubuf_sound_plane_read_double(struct ubuf *, char const *, int, int, double const **);
int ubuf_sound_plane_write_double(struct ubuf *, char const *, int, int, double **);
int ubuf_sound_read_double(struct ubuf *, int, int, double const **, uint8_t);
int ubuf_sound_write_double(struct ubuf *, int, int, double **, uint8_t);
int ubuf_sound_resize(struct ubuf *, int, int);
struct ubuf *ubuf_sound_copy(struct ubuf_mgr *, struct ubuf *, int, int);
int ubuf_sound_interleave(struct ubuf *, uint8_t *, int, int, uint8_t, uint8_t);
int ubuf_sound_replace(struct ubuf_mgr *, struct ubuf **, int, int);
uint64_t uclock_now(struct uclock *);
time_t uclock_mktime(struct uclock *, uint64_t);
struct uclock *uclock_use(struct uclock *);
void uclock_release(struct uclock *);
struct ustring ustring_null(void);
struct ustring ustring_from_str(char const *);
bool ustring_is_null(struct ustring const);
bool ustring_is_empty(struct ustring const);
int ustring_to_str(struct ustring const, char **);
int ustring_cpy(struct ustring const, char *, size_t);
struct ustring ustring_sub(struct ustring, size_t, size_t);
struct ustring ustring_shift(struct ustring const, size_t);
struct ustring ustring_truncate(struct ustring const, size_t);
struct ustring ustring_while(struct ustring const, char const *);
struct ustring ustring_until(struct ustring const, char const *);
struct ustring ustring_shift_while(struct ustring const, char const *);
struct ustring ustring_shift_until(struct ustring const, char const *);
int ustring_ncmp(struct ustring const, struct ustring const, size_t);
int ustring_ncasecmp(struct ustring const, struct ustring const, size_t);
int ustring_cmp(struct ustring const, struct ustring const);
int ustring_casecmp(struct ustring const, struct ustring const);
bool ustring_match(struct ustring const, struct ustring const);
bool ustring_match_str(struct ustring const, char const *);
bool ustring_casematch(struct ustring const, struct ustring const);
bool ustring_match_sfx(struct ustring const, struct ustring const);
bool ustring_casematch_sfx(struct ustring const, struct ustring const);
struct ustring ustring_split_while(struct ustring *, char const *);
struct ustring ustring_split_until(struct ustring *, char const *);
struct ustring ustring_split_sep(struct ustring *, char const *);
struct ustring ustring_split_match(struct ustring *, struct ustring const);
struct ustring ustring_split_match_str(struct ustring *, char const *);
struct ustring ustring_split_casematch(struct ustring *, struct ustring const);
struct ustring ustring_split_casematch_str(struct ustring *, char const *);
struct ucookie ucookie_null(void);
void ulist_init(struct uchain *);
bool ulist_is_first(struct uchain *, struct uchain *);
bool ulist_is_last(struct uchain *, struct uchain *);
bool ulist_is_in(struct uchain *);
bool ulist_empty(struct uchain *);
size_t ulist_depth(struct uchain *);
void ulist_insert(struct uchain *, struct uchain *, struct uchain *);
void ulist_delete(struct uchain *);
void ulist_add(struct uchain *, struct uchain *);
void ulist_unshift(struct uchain *, struct uchain *);
struct uchain *ulist_peek(struct uchain *);
struct uchain *ulist_pop(struct uchain *);
struct uchain *ulist_at(struct uchain *, unsigned int);
void ulist_sort(struct uchain *, int (*)(struct uchain **, struct uchain **));
struct upump *upump_alloc(struct upump_mgr *, upump_cb, void *, enum upump_type, ...);
struct upump *upump_alloc_idler(struct upump_mgr *, upump_cb, void *);
struct upump *upump_alloc_timer(struct upump_mgr *, upump_cb, void *, uint64_t, uint64_t);
struct upump *upump_alloc_fd_read(struct upump_mgr *, upump_cb, void *, int);
struct upump *upump_alloc_fd_write(struct upump_mgr *, upump_cb, void *, int);
void upump_start(struct upump *);
void upump_stop(struct upump *);
void upump_free(struct upump *);
void upump_set_cb(struct upump *, upump_cb, void *);
struct upump_mgr *upump_mgr_use(struct upump_mgr *);
void upump_mgr_release(struct upump_mgr *);
void upump_mgr_set_opaque(struct upump_mgr *, void *);
int upump_mgr_control_va(struct upump_mgr *, int, va_list);
int upump_mgr_control(struct upump_mgr *, int, ...);
int upump_mgr_vacuum(struct upump_mgr *);
bool ueventfd_init(struct ueventfd *, bool);
struct udeal {
uatomic_uint32_t waiters;
uatomic_uint32_t access;
struct ueventfd event;
};
bool udeal_init(struct udeal *);
struct upump *udeal_upump_alloc(struct udeal *, struct upump_mgr *, upump_cb, void *);
void udeal_start(struct udeal *, struct upump *);
bool udeal_grab(struct udeal *);
void udeal_yield(struct udeal *, struct upump *);
void udeal_abort(struct udeal *, struct upump *);
void udeal_clean(struct udeal *);
struct udict *udict_alloc(struct udict_mgr *, size_t);
int udict_control_va(struct udict *, int, va_list);
int udict_control(struct udict *, int, ...);
struct udict *udict_dup(struct udict *);
int udict_iterate(struct udict *, char const **, enum udict_type *);
int udict_get(struct udict *, char const *, enum udict_type, size_t *, uint8_t const **);
struct udict_opaque {
uint8_t const *v;
size_t size;
};
int udict_get_opaque(struct udict *, struct udict_opaque *, enum udict_type, char const *);
int udict_get_void(struct udict *, void *, enum udict_type, char const *);
uint64_t udict_get_uint64(uint8_t const *);
int64_t udict_get_int64(uint8_t const *);
int udict_set(struct udict *, char const *, enum udict_type, size_t, uint8_t **);
int udict_set_opaque(struct udict *, struct udict_opaque, enum udict_type, char const *);
int udict_set_string(struct udict *, char const *, enum udict_type, char const *);
int udict_set_void(struct udict *, void *, enum udict_type, char const *);
int udict_set_bool(struct udict *, bool, enum udict_type, char const *);
int udict_set_small_unsigned(struct udict *, uint8_t, enum udict_type, char const *);
int udict_set_small_int(struct udict *, int8_t, enum udict_type, char const *);
void udict_set_uint64(uint8_t *, uint64_t);
int udict_set_unsigned(struct udict *, uint64_t, enum udict_type, char const *);
int udict_set_int(struct udict *, uint64_t, enum udict_type, char const *);
int udict_set_float(struct udict *, double, enum udict_type, char const *);
int udict_set_rational(struct udict *, struct urational, enum udict_type, char const *);
int udict_delete(struct udict *, enum udict_type, char const *);
int udict_name(struct udict *, enum udict_type, char const **, enum udict_type *);
void udict_free(struct udict *);
int udict_import(struct udict *, struct udict *);
struct udict *udict_copy(struct udict_mgr *, struct udict *);
int udict_cmp(struct udict *, struct udict *);
struct udict_mgr *udict_mgr_use(struct udict_mgr *);
void udict_mgr_release(struct udict_mgr *);
int udict_mgr_control_va(struct udict_mgr *, int, va_list);
int udict_mgr_control(struct udict_mgr *, int, ...);
int udict_mgr_vacuum(struct udict_mgr *);
char const *uref_date_type_str(int);
void uref_free(struct uref *);
void uref_init(struct uref *);
struct uref *uref_alloc(struct uref_mgr *);
struct uref *uref_sibling_alloc(struct uref *);
struct uref *uref_alloc_control(struct uref_mgr *);
struct uref *uref_sibling_alloc_control(struct uref *);
struct uref *uref_dup_inner(struct uref *);
struct uref *uref_dup(struct uref *);
void uref_attach_ubuf(struct uref *, struct ubuf *);
struct ubuf *uref_detach_ubuf(struct uref *);
struct uref_mgr *uref_mgr_use(struct uref_mgr *);
void uref_mgr_release(struct uref_mgr *);
int uref_mgr_control_va(struct uref_mgr *, int, va_list);
int uref_mgr_control(struct uref_mgr *, int, ...);
int uref_mgr_vacuum(struct uref_mgr *);
int uref_attr_import(struct uref *, struct uref *);
int uref_attr_copy_list(struct uref *, struct uref *, int (**)(struct uref *, struct uref *), size_t);
int uref_attr_delete(struct uref *, enum udict_type, char const *);
int uref_attr_delete_va(struct uref *, enum udict_type, char const *, ...);
int uref_attr_delete_list(struct uref *, int (**)(struct uref *), size_t);
int uref_attr_get_opaque(struct uref *, struct udict_opaque *, enum udict_type, char const *);
int uref_attr_get_opaque_va(struct uref *, struct udict_opaque *, enum udict_type, char const *, ...);
int uref_attr_set_opaque(struct uref *, struct udict_opaque, enum udict_type, char const *);
int uref_attr_set_opaque_va(struct uref *, struct udict_opaque, enum udict_type, char const *, ...);
int uref_attr_copy_opaque(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_opaque_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_string(struct uref *, char const **, enum udict_type, char const *);
int uref_attr_get_string_va(struct uref *, char const **, enum udict_type, char const *, ...);
int uref_attr_set_string(struct uref *, char const *, enum udict_type, char const *);
int uref_attr_set_string_va(struct uref *, char const *, enum udict_type, char const *, ...);
int uref_attr_copy_string(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_string_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_void(struct uref *, void **, enum udict_type, char const *);
int uref_attr_get_void_va(struct uref *, void **, enum udict_type, char const *, ...);
int uref_attr_set_void(struct uref *, void *, enum udict_type, char const *);
int uref_attr_set_void_va(struct uref *, void *, enum udict_type, char const *, ...);
int uref_attr_copy_void(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_void_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_bool(struct uref *, bool *, enum udict_type, char const *);
int uref_attr_get_bool_va(struct uref *, bool *, enum udict_type, char const *, ...);
int uref_attr_set_bool(struct uref *, bool, enum udict_type, char const *);
int uref_attr_set_bool_va(struct uref *, bool, enum udict_type, char const *, ...);
int uref_attr_copy_bool(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_bool_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_small_unsigned(struct uref *, uint8_t *, enum udict_type, char const *);
int uref_attr_get_small_unsigned_va(struct uref *, uint8_t *, enum udict_type, char const *, ...);
int uref_attr_set_small_unsigned(struct uref *, uint8_t, enum udict_type, char const *);
int uref_attr_set_small_unsigned_va(struct uref *, uint8_t, enum udict_type, char const *, ...);
int uref_attr_copy_small_unsigned(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_small_unsigned_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_small_int(struct uref *, int8_t *, enum udict_type, char const *);
int uref_attr_get_small_int_va(struct uref *, int8_t *, enum udict_type, char const *, ...);
int uref_attr_set_small_int(struct uref *, int8_t, enum udict_type, char const *);
int uref_attr_set_small_int_va(struct uref *, int8_t, enum udict_type, char const *, ...);
int uref_attr_copy_small_int(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_small_int_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_unsigned(struct uref *, uint64_t *, enum udict_type, char const *);
int uref_attr_get_unsigned_va(struct uref *, uint64_t *, enum udict_type, char const *, ...);
int uref_attr_set_unsigned(struct uref *, uint64_t, enum udict_type, char const *);
int uref_attr_set_unsigned_va(struct uref *, uint64_t, enum udict_type, char const *, ...);
int uref_attr_copy_unsigned(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_unsigned_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_int(struct uref *, int64_t *, enum udict_type, char const *);
int uref_attr_get_int_va(struct uref *, int64_t *, enum udict_type, char const *, ...);
int uref_attr_set_int(struct uref *, int64_t, enum udict_type, char const *);
int uref_attr_set_int_va(struct uref *, int64_t, enum udict_type, char const *, ...);
int uref_attr_copy_int(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_int_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_float(struct uref *, double *, enum udict_type, char const *);
int uref_attr_get_float_va(struct uref *, double *, enum udict_type, char const *, ...);
int uref_attr_set_float(struct uref *, double, enum udict_type, char const *);
int uref_attr_set_float_va(struct uref *, double, enum udict_type, char const *, ...);
int uref_attr_copy_float(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_float_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_rational(struct uref *, struct urational *, enum udict_type, char const *);
int uref_attr_get_rational_va(struct uref *, struct urational *, enum udict_type, char const *, ...);
int uref_attr_set_rational(struct uref *, struct urational, enum udict_type, char const *);
int uref_attr_set_rational_va(struct uref *, struct urational, enum udict_type, char const *, ...);
int uref_attr_copy_rational(struct uref *, struct uref *, enum udict_type, char const *);
int uref_attr_copy_rational_va(struct uref *, struct uref *, enum udict_type, char const *, ...);
int uref_attr_get_priv(struct uref *, uint64_t *);
void uref_attr_set_priv(struct uref *, uint64_t);
void uref_attr_delete_priv(struct uref *);
void uref_attr_copy_priv(struct uref *, struct uref *);
int uref_attr_match_priv(struct uref *, uint8_t, uint8_t);
int uref_attr_cmp_priv(struct uref *, struct uref *);
int uref_flow_get_end(struct uref *);
void uref_flow_set_end(struct uref *);
void uref_flow_delete_end(struct uref *);
void uref_flow_copy_end(struct uref *, struct uref *);
int uref_flow_get_discontinuity(struct uref *);
void uref_flow_set_discontinuity(struct uref *);
void uref_flow_delete_discontinuity(struct uref *);
void uref_flow_copy_discontinuity(struct uref *, struct uref *);
int uref_flow_get_random(struct uref *);
int uref_flow_set_random(struct uref *);
int uref_flow_delete_random(struct uref *);
int uref_flow_copy_random(struct uref *, struct uref *);
int uref_flow_cmp_random(struct uref *, struct uref *);
int uref_flow_get_error(struct uref *);
int uref_flow_set_error(struct uref *);
int uref_flow_delete_error(struct uref *);
int uref_flow_copy_error(struct uref *, struct uref *);
int uref_flow_cmp_error(struct uref *, struct uref *);
int uref_flow_get_def(struct uref *, char const **);
int uref_flow_set_def(struct uref *, char const *);
int uref_flow_delete_def(struct uref *);
int uref_flow_copy_def(struct uref *, struct uref *);
int uref_flow_match_def(struct uref *, char const *);
int uref_flow_cmp_def(struct uref *, struct uref *);
int uref_flow_get_id(struct uref *, uint64_t *);
int uref_flow_set_id(struct uref *, uint64_t);
int uref_flow_delete_id(struct uref *);
int uref_flow_copy_id(struct uref *, struct uref *);
int uref_flow_match_id(struct uref *, uint64_t, uint64_t);
int uref_flow_cmp_id(struct uref *, struct uref *);
int uref_flow_get_raw_def(struct uref *, char const **);
int uref_flow_set_raw_def(struct uref *, char const *);
int uref_flow_delete_raw_def(struct uref *);
int uref_flow_copy_raw_def(struct uref *, struct uref *);
int uref_flow_match_raw_def(struct uref *, char const *);
int uref_flow_cmp_raw_def(struct uref *, struct uref *);
int uref_flow_get_languages(struct uref *, uint8_t *);
int uref_flow_set_languages(struct uref *, uint8_t);
int uref_flow_delete_languages(struct uref *);
int uref_flow_copy_languages(struct uref *, struct uref *);
int uref_flow_match_languages(struct uref *, uint8_t, uint8_t);
int uref_flow_cmp_languages(struct uref *, struct uref *);
int uref_flow_get_language(struct uref *, char const **, uint8_t);
int uref_flow_set_language(struct uref *, char const *, uint8_t);
int uref_flow_delete_language(struct uref *, uint8_t);
int uref_flow_copy_language(struct uref *, struct uref *, uint8_t);