-
Notifications
You must be signed in to change notification settings - Fork 7
/
fundecl_BM.h
1817 lines (1577 loc) · 95.4 KB
/
fundecl_BM.h
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
// file fundecl_BM.h
// SPDX-License-Identifier: GPL-3.0-or-later
/***
BISMON
Copyright © 2018 - 2022 CEA (Commissariat à l'énergie atomique et aux énergies alternatives)
contributed by Basile Starynkevitch (working at CEA, LIST, France)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef FUNDECL_BM_INCLUDED
#define FUNDECL_BM_INCLUDED
#ifdef __cplusplus
extern "C"
{
#endif /*__cplusplus*/
extern void abort_BM (void) __attribute__((noreturn));
static inline pid_t gettid_BM (void);
extern int64_t prime_above_BM (int64_t n);
extern int64_t prime_below_BM (int64_t n);
static inline const char *basename_BM (const char *);
extern const char *bismon_home_BM (void);
extern void
backtrace_print_BM (struct backtrace_state *state, int skip, FILE * f);
extern void warning_at_BM(const char*fil, int lin);
static inline double clocktime_BM (clockid_t);
// convert some absolute Unix Epoch time into milliseconds since Y2K
static inline intptr_t timetoY2Kmillisec_BM (double t);
// convert milliseconds since Y2K to absolute Unix Epoch time
static inline double Y2Kmillisectotime_BM (intptr_t);
static inline double cputime_BM (void);
static inline double elapsedtime_BM (void);
/// return a static buffer containing the real executable path
extern const char* get_real_executable_path_BM(void);
static inline void get_realtimespec_delayedms_BM (struct timespec *pts,
unsigned millisec);
extern double taskletcputime_BM (void);
extern double taskletelapsedtime_BM (void);
static inline bool istaggedint_BM (value_tyBM v);
static inline intptr_t getint_BM (value_tyBM v);
static inline intptr_t getintdefault_BM (value_tyBM v, intptr_t df);
static inline value_tyBM taggedint_BM (intptr_t i);
static inline int valtype_BM (const value_tyBM v);
extern const char *typestring_BM (int ty);
static inline bool isgenuineval_BM (const value_tyBM v);
static inline objectval_tyBM *valclass_BM (const value_tyBM v);
extern const closure_tyBM *valfindmethod_BM (const value_tyBM recv,
const objectval_tyBM *
obselector);
static inline hash_tyBM valhash_BM (const value_tyBM v);
void valgcdestroy_BM (struct garbcoll_stBM *, value_tyBM v);
void valgckeep_BM (struct garbcoll_stBM *, value_tyBM v);
static inline bool valequal_BM (const value_tyBM v1, const value_tyBM v2);
extern bool valsamecontent_BM (const value_tyBM v1, const value_tyBM v2,
int depth);
static inline int valcmp_BM (const value_tyBM v1, const value_tyBM v2);
extern int valcmpdepth_BM (const value_tyBM v1, const value_tyBM v2,
int depth);
extern int valqcmp_BM (const void *, const void *); // for qsort
static inline void valarrqsort_BM (value_tyBM * arr, unsigned siz);
extern const char *objectdbg_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg1_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg2_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg3_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg4_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg5_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg6_BM (const objectval_tyBM * obj); // non reentrant!
extern const char *objectdbg7_BM (const objectval_tyBM * obj); // non reentrant!
/* see the objrout_sigBM signature in types_BM.h */
extern value_tyBM crashing_objrout_BM (struct stackframe_stBM *stkf,
const value_tyBM arg1,
const value_tyBM arg2,
const value_tyBM arg3,
const value_tyBM arg4,
const quasinode_tyBM * restargs);
extern value_tyBM warning_objrout_BM(struct stackframe_stBM *stkf,
const value_tyBM arg1,
const value_tyBM arg2,
const value_tyBM arg3,
const value_tyBM arg4,
const quasinode_tyBM * restargs);
extern void *allocgcty_BM (unsigned type, size_t sz);
static inline bool isstring_BM (const value_tyBM v);
static inline bool hasstring_BM (const value_tyBM v, const char *str);
static inline const stringval_tyBM *stringcast_BM (const value_tyBM);
extern hash_tyBM stringhash_BM (const char *str);
extern hash_tyBM stringhashlen_BM (const char *str, long len);
extern const stringval_tyBM *makestring_BM (const char *str);
extern const stringval_tyBM *makestringlen_BM (const char *str, long len);
extern const stringval_tyBM *sprintfstring_BM (const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
// stringify the strftime of localtime, of gmtime...
extern const stringval_tyBM *flocaltimestring_BM (const char *fmt,
time_t ti);
extern const stringval_tyBM *fgmtimestring_BM (const char *fmt, time_t ti);
// stringify the strftime, but a .__ is replaced by two decimal digits
extern const stringval_tyBM *flocaltimedblstring_BM (const char *fmt,
double ti);
extern const stringval_tyBM *fgmtimedblstring_BM (const char *fmt,
double ti);
// stringify a raw string, up to its first space character
extern const stringval_tyBM *prefixtofirstspacestring_BM (const char *str);
// stringify the lastgitcommit
extern const stringval_tyBM *lastgitcommitstring_BM (void);
extern int lenstring_BM (const stringval_tyBM *); // length in bytes
extern const char *bytstring_BM (const stringval_tyBM *);
extern void *stringgcproc_BM (struct garbcoll_stBM *gc,
stringval_tyBM * str)
__attribute__((warn_unused_result));
extern void stringgcdestroy_BM (struct garbcoll_stBM *, stringval_tyBM *);
extern void stringgckeep_BM (struct garbcoll_stBM *, stringval_tyBM *);
static inline bool istuple_BM (const value_tyBM v);
static inline const tupleval_tyBM *tuplecast_BM (const value_tyBM);
extern const tupleval_tyBM *maketuple_BM (objectval_tyBM ** arr,
unsigned rawsiz);
extern const tupleval_tyBM *makesizedtuple_BM (unsigned nbargs, ...);
// collect objects or sequences into a tuple
extern const tupleval_tyBM *maketuplecollect_BM (value_tyBM, ...)
__attribute__((sentinel));
#define MAKETUPLECOLLECT_BM(...) maketuplecollect_BM(__VA_ARGS__, NULL)
extern const tupleval_tyBM *makesizedcollecttuple_BM (unsigned nbargs, ...);
extern unsigned tuplesize_BM (const tupleval_tyBM * tup);
extern objectval_tyBM *tuplecompnth_BM (const tupleval_tyBM * tup, int rk);
extern void *tuplegcproc_BM (struct garbcoll_stBM *gc, tupleval_tyBM * tup)
__attribute__((warn_unused_result));
extern void tuplegcdestroy_BM (struct garbcoll_stBM *gc,
tupleval_tyBM * tup);
extern void tuplegckeep_BM (struct garbcoll_stBM *gc, tupleval_tyBM * tup);
static inline bool issequence_BM (const value_tyBM v);
static inline const seqobval_tyBM *sequencecast_BM (const value_tyBM v);
extern unsigned sequencesize_BM (const seqobval_tyBM * sq);
extern objectval_tyBM *sequencenthcomp_BM (const seqobval_tyBM * sq,
int rk);
static inline bool isset_BM (const value_tyBM v);
static inline const setval_tyBM *setcast_BM (const value_tyBM v);
extern const setval_tyBM *makeset_BM (const objectval_tyBM ** arr,
unsigned rawsiz);
extern const setval_tyBM *makesizedset_BM (unsigned nbargs, ...);
// collect objects or sequences into a set
extern const setval_tyBM *makesetcollect_BM (value_tyBM, ...)
__attribute__((sentinel));
#define MAKESETCOLLECT_BM(...) makesetcollect_BM(__VA_ARGS__, NULL)
extern const setval_tyBM *makesizedcollectset_BM (unsigned nbargs, ...);
static inline bool setcontains_BM (const setval_tyBM * setv,
const objectval_tyBM * obelem);
extern const tupleval_tyBM *settonamedsortedtuple_BM (const setval_tyBM *
setv);
/* return the index in setv of element obelem or else -1 */
extern int setelemindex_BM (const setval_tyBM * setv,
const objectval_tyBM * obelem);
extern unsigned setcardinal_BM (const setval_tyBM * setv);
extern objectval_tyBM *setelemnth_BM (const setval_tyBM * set, int rk);
extern void *setgcproc_BM (struct garbcoll_stBM *gc, setval_tyBM * set)
__attribute__((warn_unused_result));
extern void setgcdestroy_BM (struct garbcoll_stBM *gc, setval_tyBM * set);
extern void setgckeep_BM (struct garbcoll_stBM *gc, setval_tyBM * set);
static inline bool istree_BM (const value_tyBM v);
static inline const tree_tyBM *treecast_BM (const value_tyBM);
static inline bool isclosure_BM (const value_tyBM v);
static inline const closure_tyBM *closurecast_BM (const value_tyBM);
static inline bool isnode_BM (const value_tyBM v);
static inline const node_tyBM *nodecast_BM (const value_tyBM);
static inline objectval_tyBM *treeconn_BM (const value_tyBM);
static inline objectval_tyBM *closureconn_BM (const value_tyBM);
static inline objectval_tyBM *nodeconn_BM (const value_tyBM);
static inline unsigned treewidth_BM (const value_tyBM);
static inline unsigned closurewidth_BM (const value_tyBM);
static inline unsigned nodewidth_BM (const value_tyBM);
static inline value_tyBM treenthson_BM (const value_tyBM tr, int rk);
static inline value_tyBM closurenthson_BM (const value_tyBM clo, int rk);
static inline value_tyBM nodenthson_BM (const value_tyBM nod, int rk);
extern void *nodegcproc_BM (struct garbcoll_stBM *gc, node_tyBM * nod,
int depth) __attribute__((warn_unused_result));
extern void nodegcdestroy_BM (struct garbcoll_stBM *gc, node_tyBM * nod);
extern void nodegckeep_BM (struct garbcoll_stBM *gc, node_tyBM * nod);
extern const node_tyBM *makenode_BM (const objectval_tyBM * connob,
unsigned nbval,
const value_tyBM * sonvalarr);
static inline const node_tyBM *makenode0_BM (const objectval_tyBM * connob);
static inline const node_tyBM *makenode1_BM (const objectval_tyBM * connob,
value_tyBM v0);
static inline const node_tyBM *makenode2_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1);
static inline const node_tyBM *makenode3_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2);
static inline const node_tyBM *makenode4_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2, value_tyBM v3);
static inline const node_tyBM *makenode5_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2, value_tyBM v3,
value_tyBM v4);
static inline const node_tyBM *makenode6_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2, value_tyBM v3,
value_tyBM v4, value_tyBM v5);
static inline const node_tyBM *makenode7_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2, value_tyBM v3,
value_tyBM v4, value_tyBM v5,
value_tyBM v6);
static inline const node_tyBM *makenode8_BM (const objectval_tyBM * connob,
value_tyBM v0, value_tyBM v1,
value_tyBM v2, value_tyBM v3,
value_tyBM v4, value_tyBM v5,
value_tyBM v6, value_tyBM v7);
/// make a node from the rest of some tree (node, closure or quasinode) value, with a starting index startix
extern const node_tyBM *makenodetreerest_BM (const objectval_tyBM * connob,
value_tyBM treev, int startix);
extern const node_tyBM *makesizednode_BM (unsigned siz,
const objectval_tyBM * connob,
...);
extern const node_tyBM *makenodevar_BM (const objectval_tyBM * connob, ...)
__attribute__((sentinel));
////////
extern const closure_tyBM *makeclosure_BM (const objectval_tyBM * conn,
unsigned nbclos,
const value_tyBM * closvalarr);
static inline const closure_tyBM *makeclosure0_BM (const objectval_tyBM *
connob);
static inline const closure_tyBM *makeclosure1_BM (const objectval_tyBM *
connob, value_tyBM v0);
static inline const closure_tyBM *makeclosure2_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1);
static inline const closure_tyBM *makeclosure3_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2);
static inline const closure_tyBM *makeclosure4_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2,
value_tyBM v3);
static inline const closure_tyBM *makeclosure5_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2,
value_tyBM v3,
value_tyBM v4);
static inline const closure_tyBM *makeclosure6_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2,
value_tyBM v3,
value_tyBM v4,
value_tyBM v5);
static inline const closure_tyBM *makeclosure7_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2,
value_tyBM v3,
value_tyBM v4,
value_tyBM v5,
value_tyBM v6);
static inline const closure_tyBM *makeclosure8_BM (const objectval_tyBM *
connob, value_tyBM v0,
value_tyBM v1,
value_tyBM v2,
value_tyBM v3,
value_tyBM v4,
value_tyBM v5,
value_tyBM v6,
value_tyBM v7);
extern const closure_tyBM *makesizedclosure_BM (unsigned siz,
const objectval_tyBM *
connob, ...);
extern const closure_tyBM *makeclosurevar_BM (const objectval_tyBM * connob,
...)
__attribute__((sentinel));
extern void *closuregcproc_BM (struct garbcoll_stBM *gc,
closure_tyBM * clos, int depth)
__attribute__((warn_unused_result));
extern void closuregcdestroy_BM (struct garbcoll_stBM *gc,
closure_tyBM * clos);
extern void closuregckeep_BM (struct garbcoll_stBM *gc,
closure_tyBM * clos);
extern void *quasinodegcproc_BM (struct garbcoll_stBM *gc,
quasinode_tyBM * quasi, int depth)
__attribute__((warn_unused_result));
////////////////
// support for boxed doubles
extern void *doublegcproc_BM (struct garbcoll_stBM *gc,
doubleval_tyBM * dbl);
extern void doublegcdestroy_BM (struct garbcoll_stBM *gc,
doubleval_tyBM * dblv);
extern void doublegckeep_BM (struct garbcoll_stBM *gc,
doubleval_tyBM * dblv);
extern value_tyBM makedouble_BM (double x); /* gives the boxed double, or else `nan_double` if it is NaN */
static inline bool isdouble_BM (const value_tyBM val);
static inline const doubleval_tyBM *doublecast_BM (const value_tyBM val);
static inline double getdouble_BM (const value_tyBM val); /* unbox the double or else gives NaN */
// a total order, but x and y cannot be NaN, e.g. because the are from
// a boxed double:
extern int doublecmp_BM (double x, double y); /* in misc_BM.cc */
// the hash of doubles
extern hash_tyBM doublehash_BM (double x); /* in misc_BM.cc */
////////////////
// initialize the GC and mainthreadid_BM
extern void initialize_garbage_collector_BM (void);
extern void initialize_predefined_objects_BM (void);
// cleanup C++ miscellanous data; also dlclose-s modules!
extern void final_miscdata_cleanup_BM (void);
// final cleanup of memory to make valgrind happy
extern void final_cleanup_BM (void);
static inline bool isobject_BM (const value_tyBM v);
static inline objectval_tyBM *objectcast_BM (const value_tyBM v);
static inline hash_tyBM objecthash_BM (const objectval_tyBM *);
/// compare by id
static inline int objectcmp_BM (const objectval_tyBM * ob1,
const objectval_tyBM * ob2);
/// compare by name or id
static inline int objectnamedcmp_BM (const objectval_tyBM * ob1,
const objectval_tyBM * ob2);
extern void sortobjarr_BM (objectval_tyBM ** obarr, size_t arrsiz);
extern void sortnamedobjarr_BM (objectval_tyBM ** obarr, size_t arrsiz);
extern objectval_tyBM *findobjofid_BM (const rawid_tyBM id);
extern objectval_tyBM *findobjofstrid_BM (const char *idstr);
extern objectval_tyBM *lockedfindobjofstrid_BM (const char *idstr);
extern objectval_tyBM *makeobjofid_BM (const rawid_tyBM id);
// from obconst, instance of basiclo_constant_object, retrieves its
// value, whose hash is given
extern value_tyBM constobjvaluehashed_BM (objectval_tyBM * obconst,
hash_tyBM hash);
// find the set of objects of an id prefixed by some prefix of at
// least three characters starting with _ then a digit
extern const setval_tyBM *setobjectsofidprefixed_BM (const char *prefix);
extern objectval_tyBM *makeobj_BM (void);
static inline rawid_tyBM objid_BM (const objectval_tyBM * obj);
static inline double objmtime_BM (const objectval_tyBM * obj);
static inline intptr_t objmtimeY2Kmilli_BM (const objectval_tyBM * obj);
static inline objectval_tyBM *objsignature_BM (const objectval_tyBM * obj);
static inline void *objroutaddr_BM (const objectval_tyBM * obj,
const objectval_tyBM * objsig);
extern objrout_sigBM objrout_placeholder_BM;
extern bool read_sigfd_BM();
static inline void objtouchmtime_BM (objectval_tyBM * obj, double mtime);
static inline void objtouchnow_BM (objectval_tyBM * obj);
// the cleared object has no payload, no components, no attributes, no
// routine, no signature, and becomes a transient instance of BMP_object
extern void objcompletelyclear_BM (objectval_tyBM * obj);
extern void objputspacenum_BM (objectval_tyBM * obj, unsigned spanum);
static inline unsigned objspacenum_BM (const objectval_tyBM * obj);
static inline objectval_tyBM *objclass_BM (const objectval_tyBM * obj);
extern void objputclass_BM (objectval_tyBM * obj,
objectval_tyBM * objclass);
// return true on success
static inline bool objlock_BM (objectval_tyBM * obj);
static inline bool objunlock_BM (objectval_tyBM * obj);
static inline bool objtrylock_BM (objectval_tyBM * obj);
// return true if the object was already locked in the same thread
static inline bool objislocked_BM (objectval_tyBM * obj);
static inline value_tyBM objgetattr_BM (const objectval_tyBM * obj,
const objectval_tyBM * objattr);
static inline unsigned objnbattrs_BM (const objectval_tyBM * obj);
static inline const setval_tyBM *objsetattrs_BM (const objectval_tyBM *
obj);
extern void objputattr_BM (objectval_tyBM * obj,
const objectval_tyBM * objattr,
const value_tyBM valattr);
extern void objremoveattr_BM (objectval_tyBM * obj,
const objectval_tyBM * objattr);
extern void objresetattrs_BM (objectval_tyBM * obj, unsigned nbattrhint);
static inline bool objhasclassinfo_BM (const objectval_tyBM * obj);
// put a fresh classinfo as an object's data
extern void objputclassinfo_BM (objectval_tyBM * obj,
objectval_tyBM * superclass);
static inline objectval_tyBM * //
objgetclassinfosuperclass_BM (const objectval_tyBM * obj);
static inline const closure_tyBM * //
objgetclassinfomethod_BM (const objectval_tyBM * obj, //
const objectval_tyBM * obselector);
extern void
objclassinfoputmethod_BM (objectval_tyBM * obj,
objectval_tyBM * obselector,
const closure_tyBM * clos);
extern void
objclassinforemovemethod_BM (objectval_tyBM * obj,
objectval_tyBM * obselector);
static inline const setval_tyBM * //
objgetclassinfosetofselectors_BM (const objectval_tyBM * obj);
// is obj a subclass of obclass?
extern bool
objclassinfoissubclass_BM (const objectval_tyBM * obj,
const objectval_tyBM * obclass);
// is obj an instance of obclass?
static inline bool
objectisinstance_BM (const objectval_tyBM * obj,
const objectval_tyBM * obclass);
/// raise a failure; see also macro FAILURE_BM
extern void failure_BM (int failcode, const value_tyBM reasonv,
struct stackframe_stBM *stkf)
__attribute__((noreturn));
// see PLAINFAILURE_BM & PLACEDFAILURE_BM macros
extern void failure_at_BM (int failcode, const char *fil, int lineno,
const value_tyBM reasonv,
const value_tyBM placev,
struct stackframe_stBM *stkf)
__attribute__((noreturn));
extern void register_failock_BM (struct failurelockset_stBM *,
objectval_tyBM *);
extern void unregister_failock_BM (struct failurelockset_stBM *,
objectval_tyBM *);
extern void initialize_failurelockset_BM (struct failurelockset_stBM *,
size_t);
extern void destroy_failurelockset_BM (struct failurelockset_stBM *);
/// message sending
extern value_tyBM send0_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf);
extern value_tyBM send1_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1);
extern value_tyBM send2_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2);
extern value_tyBM send3_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3);
extern value_tyBM send4_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3, const value_tyBM arg4);
extern value_tyBM send5_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3, const value_tyBM arg4,
const value_tyBM arg5);
extern value_tyBM send6_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3, const value_tyBM arg4,
const value_tyBM arg5, const value_tyBM arg6);
extern value_tyBM send7_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3, const value_tyBM arg4,
const value_tyBM arg5, const value_tyBM arg6,
const value_tyBM arg7);
extern value_tyBM send8_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
const value_tyBM arg1, const value_tyBM arg2,
const value_tyBM arg3, const value_tyBM arg4,
const value_tyBM arg5, const value_tyBM arg6,
const value_tyBM arg7, const value_tyBM arg8);
static inline value_tyBM sendvar_BM (const value_tyBM recv, const objectval_tyBM * obselector, struct stackframe_stBM *stkf, unsigned nbargs, // no more than MAXAPPLYARGS_BM-1
const value_tyBM * argarr);
extern value_tyBM sendmany_BM (const value_tyBM recv,
const objectval_tyBM * obselector,
struct stackframe_stBM *stkf,
unsigned nbargs, ...);
static inline unsigned objnbcomps_BM (const objectval_tyBM * obj);
static inline value_tyBM *objcompdata_BM (const objectval_tyBM * obj);
static inline value_tyBM objgetcomp_BM (const objectval_tyBM * obj, int rk);
static inline void objputcomp_BM (objectval_tyBM * obj, int rk,
const value_tyBM compval);
static inline void objreservecomps_BM (objectval_tyBM * obj, unsigned gap);
static inline void objremoveonecomp_BM (objectval_tyBM * obj, int rk);
static inline void objinsertonecomp_BM (objectval_tyBM * obj, int rk,
const value_tyBM compval);
static inline void objresetcomps_BM (objectval_tyBM * obj, unsigned len);
static inline void objappendcomp_BM (objectval_tyBM * obj,
value_tyBM compval);
static inline value_tyBM objlastcomp_BM (const objectval_tyBM * obj);
static inline void objpoplastcomp_BM (objectval_tyBM * obj);
static inline void objgrowcomps_BM (objectval_tyBM * obj, unsigned gap);
///
extern void deleteobjectpayload_BM (objectval_tyBM * obj,
extendedval_tyBM payl);
static inline void objclearpayload_BM (objectval_tyBM * obj);
static inline void objputpayload_BM (objectval_tyBM * obj,
extendedval_tyBM payl);
static inline extendedval_tyBM objpayload_BM (const objectval_tyBM * obj);
///
extern const setval_tyBM *setpredefinedobjects_BM (void);
extern void gcmarkpredefinedobjects_BM (struct garbcoll_stBM *gc);
extern void objectinteriorgcmark_BM (struct garbcoll_stBM *gc,
objectval_tyBM * obj);
extern void objectgcdestroy_BM (struct garbcoll_stBM *gc,
objectval_tyBM * obj);
extern void objectgckeep_BM (struct garbcoll_stBM *gc,
objectval_tyBM * obj);
////////////////
/// notice the naming convention objXXXXXpayl_BM for functions dealing
/// with particular payloads in objects.
extern bool objputstrbufferpayl_BM (objectval_tyBM * obj, unsigned maxsize);
static inline bool objhasstrbufferpayl_BM (const objectval_tyBM * obj);
static inline struct strbuffer_stBM *objgetstrbufferpayl_BM (objectval_tyBM
* obj);
extern void objstrbufferreservepayl_BM (objectval_tyBM * obj, unsigned gap);
extern const char *objstrbufferbytespayl_BM (objectval_tyBM * obj);
extern int objstrbufferindentationpayl_BM (objectval_tyBM * obj);
extern void objstrbufferclearindentpayl_BM (objectval_tyBM * obj);
extern void objstrbuffermoreindentpayl_BM (objectval_tyBM * obj);
extern void objstrbuffersetindentpayl_BM (objectval_tyBM * obj, int indent);
extern void objstrbufferlessindentpayl_BM (objectval_tyBM * obj);
extern void objstrbufferappendcstrpayl_BM (objectval_tyBM * obj,
const char *cstr);
extern bool objstrbufferispercentfullpayl_BM (const objectval_tyBM * obj,
int percentage);
extern void objstrbufferresetpayl_BM (objectval_tyBM * obj);
extern unsigned objstrbufferlengthpayl_BM (const objectval_tyBM * obj);
extern unsigned objstrbufferlimitpayl_BM (const objectval_tyBM * obj);
extern unsigned objstrbufferlinecountpayl_BM (const objectval_tyBM * obj);
extern unsigned objstrbuffercolumnpayl_BM (const objectval_tyBM * obj);
// the current last line is invalid as soon as more content is added
// to the buffer.
extern const char *objstrbuffercurrentlastlinepayl_BM (const objectval_tyBM
* obj);
/// raw printf
extern void objstrbufferrawprintfpayl_BM (objectval_tyBM * obj,
const char *fmt, ...)
__attribute__((format (printf, 2, 3)));
extern void objstrbufferspaceornewlinepayl_BM (objectval_tyBM * obj);
/// cooked printf: the tabs become spaces or indented-newlines, the
/// newlines become indented
extern void objstrbufferprintfpayl_BM (objectval_tyBM * obj,
const char *fmt, ...)
__attribute__((format (printf, 2, 3)));
/// indented newline
extern void objstrbuffernewlinepayl_BM (objectval_tyBM * obj);
/// output UTF8 encoded à la JSON
extern void objstrbufferencodedutf8payl_BM (objectval_tyBM * obj,
const char *str,
ssize_t bytelen);
/// output into buffer `obj` the first `len` bytes of string `cstr`
extern void
objstrbufferappendstartstrpayl_BM (objectval_tyBM * obj, const char *cstr,
int len);
/// output into buffer `obj` every line of `lines` with the given
/// `prefix`; could be used to safely emit a C or C++ comment starting
/// with a prefix like //!
extern void
objstrbufferoutputprefixlinespayl_BM (objectval_tyBM * obj,
const char *prefix,
const char *lines);
extern void writefencodedutf8_BM (FILE * fil, const char *str,
ssize_t bytelen);
/// output a double number as precisely as possible, with at least a
/// dot or an E for the exponent, so that it won't be parsed as long
/// integer. Returns true when hexadecimal %#a was used
extern bool objstrbufferoutdoublepayl_BM (objectval_tyBM * obj, double x);
/// output a double, as a local time
extern void objstrbufferencodelocaltimepayl_BM (objectval_tyBM * obj,
double tid);
/// output bytes encoded à la C
extern void objstrbufferencodedcpayl_BM (objectval_tyBM * obj,
const char *str, ssize_t bytelen);
/// output literal string, with the double quotes, à la C
extern void objstrbufferliteralcstringpayl_BM (objectval_tyBM * obj,
const char *str,
ssize_t bytelen);
extern void writefencodedc_BM (FILE * fil, const char *str,
ssize_t bytelen);
/// output bytes encoded à la HTML
extern void objstrbufferencodedhtmlpayl_BM (objectval_tyBM * obj,
const char *str,
ssize_t bytelen);
extern void writefencodedhtml_BM (FILE * fil, const char *str,
ssize_t bytelen);
/// output a JSON value, either indented, or compacted
extern void objstrbufferoutputjsonindentedvaluepayl_BM (objectval_tyBM *
obj, value_tyBM val,
value_tyBM ctx,
struct
stackframe_stBM
*stkf);
extern void objstrbufferoutputjsoncompactedvaluepayl_BM (objectval_tyBM *
obj,
value_tyBM val,
value_tyBM ctx,
struct
stackframe_stBM
*stkf);
/// write the content to a file, if different
extern void objstrbufferwritetofilepayl_BM (objectval_tyBM * obj,
const char *filepath);
/// make a string value from the content of an objstrbuffer, or else
/// NULL:
extern value_tyBM objstrbuffertostringvaluepayl_BM (objectval_tyBM * obj);
///////
extern void strbuffergcmark_BM (struct garbcoll_stBM *gc,
struct strbuffer_stBM *sbuf,
objectval_tyBM * fromob, int depth);
extern void strbuffergcdestroy_BM (struct garbcoll_stBM *gc,
struct strbuffer_stBM *sbuf);
extern void strbuffergckeep_BM (struct garbcoll_stBM *gc,
struct strbuffer_stBM *sbuf);
////////////////
static inline bool isassoc_BM (value_tyBM v);
static inline anyassoc_tyBM *assoccast_BM (value_tyBM v);
extern void *assocgcproc_BM (struct garbcoll_stBM *gc,
anyassoc_tyBM * assoc, objectval_tyBM * fromob,
int depth) __attribute__((warn_unused_result));
extern void *assocpairsgcproc_BM (struct garbcoll_stBM *gc,
struct assocpairs_stBM *apairs,
objectval_tyBM * fromob, int depth)
__attribute__((warn_unused_result));
extern void *assoctablegcproc_BM (struct garbcoll_stBM *gc,
struct assoctable_stBM *atable,
objectval_tyBM * fromob, int depth)
__attribute__((warn_unused_result));
extern void assocpairgcdestroy_BM (struct garbcoll_stBM *gc,
struct assocpairs_stBM *assocpair);
extern void assoctablegcdestroy_BM (struct garbcoll_stBM *gc,
struct assoctable_stBM *assocbuck);
extern void assocpairgckeep_BM (struct garbcoll_stBM *gc,
struct assocpairs_stBM *assocpair);
extern void assoctablegckeep_BM (struct garbcoll_stBM *gc,
struct assoctable_stBM *assocbuck);
extern unsigned assoc_nbkeys_BM (const anyassoc_tyBM * assoc);
extern void assoc_reorganize_BM (anyassoc_tyBM ** passoc, unsigned gap);
static inline anyassoc_tyBM *make_assoc_BM (unsigned ulen);
extern const setval_tyBM *assoc_setattrs_BM (const anyassoc_tyBM * assoc);
extern value_tyBM assoc_getattr_BM (const anyassoc_tyBM * assoc,
const objectval_tyBM * obattr);
extern anyassoc_tyBM *assoc_addattr_BM (anyassoc_tyBM * assoc,
const objectval_tyBM * obattr,
value_tyBM val);
extern anyassoc_tyBM *assoc_removeattr_BM (anyassoc_tyBM * assoc,
const objectval_tyBM * obattr);
//// assoc payload support
extern bool objputassocpayl_BM (objectval_tyBM * obj, unsigned initsize);
static inline bool objhasassocpayl_BM (const objectval_tyBM * obj);
static inline unsigned objassocnbkeyspayl_BM (const objectval_tyBM * obj);
static inline anyassoc_tyBM *objgetassocpayl_BM (objectval_tyBM * obj);
static inline const setval_tyBM *objassocsetattrspayl_BM (objectval_tyBM *
obj);
static inline value_tyBM objassocgetattrpayl_BM (objectval_tyBM * obj,
const objectval_tyBM *
obattr);
static inline void objassocaddattrpayl_BM (objectval_tyBM * obj,
const objectval_tyBM * obattr,
value_tyBM val);
static inline void objassocremoveattrpayl_BM (objectval_tyBM * obj,
const objectval_tyBM *
obattr);
static inline void objassocreorganizepayl_BM (objectval_tyBM * obj,
unsigned gap);
//////////////// hashed and mutable set of objects
extern struct hashsetobj_stBM *hashsetobj_grow_BM (struct hashsetobj_stBM
*hset, unsigned gap);
static inline struct hashsetobj_stBM *hashsetobjcast_BM (const value_tyBM
v);
extern void hashsetgcmark_BM (struct garbcoll_stBM *gc,
struct hashsetobj_stBM *hset,
objectval_tyBM * fromob);
void hashsetgcdestroy_BM (struct garbcoll_stBM *gc,
struct hashsetobj_stBM *hset);
void hashsetgckeep_BM (struct garbcoll_stBM *gc,
struct hashsetobj_stBM *hset);
extern bool hashsetobj_contains_BM (struct hashsetobj_stBM *hset,
const objectval_tyBM * obj);
extern struct hashsetobj_stBM *hashsetobj_add_BM (struct hashsetobj_stBM
*hset,
const objectval_tyBM *
obj);
extern struct hashsetobj_stBM *hashsetobj_remove_BM (struct hashsetobj_stBM
*hset,
const objectval_tyBM *
obj);
// pick some random element, and keep it in the hashset
extern objectval_tyBM *hashsetobj_pick_random_BM (struct hashsetobj_stBM
*hset);
// take some random element, and remove it from the hashset - without reorganizing it
extern objectval_tyBM *hashsetobj_take_random_BM (struct hashsetobj_stBM
*hset);
extern const setval_tyBM *hashsetobj_to_set_BM (struct hashsetobj_stBM
*hset);
static inline unsigned hashsetobj_cardinal_BM (struct hashsetobj_stBM
*hset);
//// obj hashset payload support
extern bool objputhashsetpayl_BM (objectval_tyBM * obj, unsigned inisiz);
static inline struct hashsetobj_stBM *objgethashsetpayl_BM (objectval_tyBM *
obj);
static inline bool objhashashsetpayl_BM (objectval_tyBM * obj);
static inline bool objhashsetcontainspayl_BM (objectval_tyBM * obj,
const objectval_tyBM *
obelem);
static inline void objhashsetaddpayl_BM (objectval_tyBM * obj,
objectval_tyBM * obelem);
static inline void objhashsetremovepayl_BM (objectval_tyBM * obj,
objectval_tyBM * obelem);
static inline void objhashsetgrowpayl_BM (objectval_tyBM * obj,
unsigned gap);
static inline unsigned objhashsetcardinalpayl_BM (objectval_tyBM * obj);
static inline const setval_tyBM *objhashsettosetpayl_BM (objectval_tyBM *
obj);
static inline objectval_tyBM *objhashsetpickrandompayl_BM (objectval_tyBM *
obj);
static inline objectval_tyBM *objhashsettakerandompayl_BM (objectval_tyBM *
obj);
//////////////// mutable data vector of values
static inline unsigned datavectlen_BM (const struct datavectval_stBM *dvec);
static inline const value_tyBM *datavectdata_BM (const struct
datavectval_stBM *dvec);
extern struct datavectval_stBM *datavect_grow_BM (struct datavectval_stBM
*dvec, unsigned gap);
extern struct datavectval_stBM *datavect_reserve_BM (struct datavectval_stBM
*dvec, unsigned gap);
extern struct datavectval_stBM *datavect_append_BM (struct datavectval_stBM
*dvec, value_tyBM val);
extern struct datavectval_stBM *datavect_pop_BM (struct datavectval_stBM
*dvec);
extern struct datavectval_stBM *datavect_insert_BM (struct datavectval_stBM
*dvec, int rk,
value_tyBM * valarr,
unsigned len);
static inline struct datavectval_stBM *datavect_insertone_BM (struct
datavectval_stBM
*dvec, int rk,
value_tyBM
val);
extern struct datavectval_stBM *datavect_remove_BM (struct datavectval_stBM
*dvec, int rk,
unsigned len);
extern struct datavectval_stBM *datavect_removeone_BM (struct
datavectval_stBM
*dvec, int ix);
extern const node_tyBM *datavect_to_node_BM (struct datavectval_stBM *dvec,
const objectval_tyBM * obconn);
extern const tupleval_tyBM *datavect_to_tuple_BM (struct datavectval_stBM
*dvec);
static inline value_tyBM datavectnth_BM (const struct datavectval_stBM
*dvec, int rk);
static inline value_tyBM datavectlast_BM (const struct datavectval_stBM
*dvec);
static inline void datavectputnth_BM (struct datavectval_stBM *dvec, int rk,
const value_tyBM valcomp);
extern void *datavectgcproc_BM (struct garbcoll_stBM *gc,
struct datavectval_stBM *dvec,
objectval_tyBM * fromob, int depth)
__attribute__((warn_unused_result));
extern void datavectgcdestroy_BM (struct garbcoll_stBM *gc,
struct datavectval_stBM *dvec);
extern void datavectgckeep_BM (struct garbcoll_stBM *gc,
struct datavectval_stBM *dvec);
//////////////// obj datavect payload
// return true if ok
extern bool objputdatavectpayl_BM (objectval_tyBM * obj, unsigned inisiz);
static inline struct datavectval_stBM *objgetdatavectpayl_BM //
(objectval_tyBM * obj);
static inline bool objhasdatavectpayl_BM (objectval_tyBM * obj);
static inline unsigned objdatavectlengthpayl_BM (objectval_tyBM * obj);
static inline const value_tyBM *objdatavectdatapayl_BM (objectval_tyBM *
obj);
static inline void objdatavectgrowpayl_BM (objectval_tyBM * obj,
unsigned gap);
static inline void objdatavectreservepayl_BM (objectval_tyBM * obj,
unsigned gap);
static inline void objdatavectappendpayl_BM (objectval_tyBM * obj,
value_tyBM val);
static inline void objdatavectinsertpayl_BM (objectval_tyBM * obj, int rk,
value_tyBM * valarr,
unsigned len);
extern void objdatavectinsertcomponentspayl_BM (objectval_tyBM * obj,
int rk,
objectval_tyBM * obsrc,
int srcrk, unsigned len);
static inline void objdatavectinsertonepayl_BM (objectval_tyBM * obj,
int rk, value_tyBM val);
static inline void objdatavectremovepayl_BM (objectval_tyBM * obj, int rk,
unsigned len);
static inline const node_tyBM *objdatavecttonodepayl_BM //
(objectval_tyBM * obj, const objectval_tyBM * obconn);
static inline const tupleval_tyBM *objdatavecttotuplepayl_BM (objectval_tyBM
* obj);
static inline value_tyBM objdatavectnthpayl_BM (objectval_tyBM * obj,
int rk);
static inline void objdatavectputnthpayl_BM (objectval_tyBM * obj, int rk,
const value_tyBM valcomp);
////////////////////////////////
/// decayed vectors payload, for typayl_decayed_BM
static inline unsigned decayedvectlen_BM (const struct decayedvectpayl_stBM *dvec); // used length
static inline unsigned
decayedvectallocsize_BM (const struct decayedvectpayl_stBM *dvec);
static inline bool isdecayedvect_BM (const value_tyBM v);
static inline bool islivedecayedvect_BM (const value_tyBM v);
static inline const value_tyBM *decayedvectdata_BM (const struct
decayedvectpayl_stBM
*dvec);
/// return 0.0 if non decayedvect
static inline double decayedvectlimitime_BM (const struct
decayedvectpayl_stBM *dvec);
static inline value_tyBM decayedvectnth_BM (const struct
decayedvectpayl_stBM *dvec,
int rk);
static inline value_tyBM decayedvectlast_BM (const struct
decayedvectpayl_stBM *dvec);
static inline bool decayedvectputnth_BM (struct decayedvectpayl_stBM *dvec,
int rk, const value_tyBM valcomp);
static inline bool decayedvectappend_BM (struct decayedvectpayl_stBM *dvec,
const value_tyBM valcomp);
// GC support for decayed vector
extern void decayedvectorgcmark_BM (struct garbcoll_stBM *gc,
struct decayedvectpayl_stBM *dvec,
objectval_tyBM * fromob, int depth);
extern void decayedvectordestroy_BM (struct garbcoll_stBM *gc,
struct decayedvectpayl_stBM *dvec);
extern void decayedvectorgckeep_BM (struct garbcoll_stBM *gc,
struct decayedvectpayl_stBM *dvec);
extern bool objputdecayedvectorpayl_BM (objectval_tyBM * obj, unsigned asiz,
unsigned delayms);
static inline struct decayedvectpayl_stBM
*objgetdecayedvectorpayl_BM (objectval_tyBM * obj);
static inline bool objhasdecayedvectorpayl_BM (objectval_tyBM * obj);
static inline double objdecayedvectorlimitimepayl_BM (objectval_tyBM * obj);
static inline value_tyBM objdecayedvectornthpayl_BM (objectval_tyBM * obj,
int rk);
static inline value_tyBM objdecayedvectorlastpayl_BM (objectval_tyBM * obj);
static inline const value_tyBM *objdecayedvectdatapayl_BM (objectval_tyBM *
obj);
static inline unsigned objdecayedvectlenpayl_BM (objectval_tyBM * obj);
static inline unsigned objdecayedvectallocsizepayl_BM (objectval_tyBM *
obj);
static inline bool objdecayedvectorputnthpayl_BM (objectval_tyBM * obj,
int rk,
const value_tyBM valcomp);
static inline bool objdecayedvectorappendpayl_BM (objectval_tyBM * obj,
const value_tyBM valcomp);
///////////////////////////////
extern struct listtop_stBM *makelist_BM (void);
static inline bool islist_BM (const value_tyBM);
static inline value_tyBM listfirst_BM (const struct listtop_stBM *);
static inline value_tyBM listlast_BM (const struct listtop_stBM *);
static inline unsigned listlength_BM (const struct listtop_stBM *);
extern void listclear_BM (struct listtop_stBM *lis);
extern void listappend_BM (struct listtop_stBM *lis, value_tyBM val);
extern void listprepend_BM (struct listtop_stBM *lis, value_tyBM val);
extern void listpopfirst_BM (struct listtop_stBM *lis);
extern void listpoplast_BM (struct listtop_stBM *lis);
extern void listgcmark_BM (struct garbcoll_stBM *gc,
struct listtop_stBM *lis,
objectval_tyBM * fromob, int depth);
extern void listgcdestroy_BM (struct garbcoll_stBM *gc,
struct listtop_stBM *lis);
extern void listgckeep_BM (struct garbcoll_stBM *gc,
struct listtop_stBM *lis);
// make a node from all components of the list
extern const node_tyBM *list_to_node_BM (const struct listtop_stBM *lis,
const objectval_tyBM * conn);
// make a tuple from the objects in the list
extern const tupleval_tyBM *list_to_tuple_BM (const struct listtop_stBM
*lis);
//////////////// obj list payload
extern bool objputlistpayl_BM (objectval_tyBM * obj);
static inline struct listtop_stBM *objgetlistpayl_BM (objectval_tyBM * obj);
static inline bool objhaslistpayl_BM (objectval_tyBM * obj);
static inline value_tyBM objlistfirstpayl_BM (objectval_tyBM * obj);
static inline value_tyBM objlistlastpayl_BM (objectval_tyBM * obj);
static inline unsigned objlistlengthpayl_BM (objectval_tyBM * obj);
static inline void objlistclearpayl_BM (objectval_tyBM * obj);
static inline void objlistappendpayl_BM (objectval_tyBM * obj,
value_tyBM val);
static inline void objlistprependpayl_BM (objectval_tyBM * obj,
value_tyBM val);