lbkit 0.5.13__tar.gz → 0.5.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lbkit-0.5.13/lbkit.egg-info → lbkit-0.5.15}/PKG-INFO +1 -1
- lbkit-0.5.15/lbkit/__init__.py +2 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/ctype_defination.py +34 -1
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/idf_interface.py +50 -11
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/client.c.mako +33 -5
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/client.h.mako +14 -8
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/template/conanbase.mako +3 -2
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/template/deploy.mako +24 -3
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/build_manifest.py +1 -0
- {lbkit-0.5.13 → lbkit-0.5.15/lbkit.egg-info}/PKG-INFO +1 -1
- lbkit-0.5.13/lbkit/__init__.py +0 -2
- {lbkit-0.5.13 → lbkit-0.5.15}/AUTHORS +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/LICENSE +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/MANIFEST.in +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/README.md +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/ci_robot/__init__.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/ci_robot/gitee.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/cli.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/__init__.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/codegen.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/renderer.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/interface.c.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/interface.introspect.xml.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/public.c.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/public.h.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/server.c.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/codegen/template/server.h.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/__init__.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/arg_parser.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/build.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/component/test.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/errors.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/helper.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/__init__.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/build_image.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/build_prepare.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/build_rootfs.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/config.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/task.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/integration/template/conanfile.py.mako +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/lbkit.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/log.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/misc.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit/tools.py +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit.egg-info/SOURCES.txt +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit.egg-info/dependency_links.txt +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit.egg-info/entry_points.txt +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit.egg-info/requires.txt +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/lbkit.egg-info/top_level.txt +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/setup.cfg +0 -0
- {lbkit-0.5.13 → lbkit-0.5.15}/setup.py +0 -0
|
@@ -414,12 +414,14 @@ class RefObjArrayValidator(RefObjValidator):
|
|
|
414
414
|
|
|
415
415
|
class CTypeBase(object):
|
|
416
416
|
"""C语言相关的操作函数&类型定义"""
|
|
417
|
-
def __init__(self, declare, free_func, encode_func, decode_func,
|
|
417
|
+
def __init__(self, declare, out_declare, free_func, encode_func, decode_func,
|
|
418
418
|
validator: IdfValidator = None,
|
|
419
419
|
const_declare = None,
|
|
420
420
|
const_free_func = None,
|
|
421
421
|
const_decode_func = None):
|
|
422
422
|
self.declare = declare
|
|
423
|
+
# 作为函数出参时的变量申明
|
|
424
|
+
self.out_declare = out_declare
|
|
423
425
|
self.free_func = free_func
|
|
424
426
|
self.encode_func = encode_func
|
|
425
427
|
self.decode_func = decode_func
|
|
@@ -440,6 +442,7 @@ class CTypeBase(object):
|
|
|
440
442
|
CTYPE_OBJS = {
|
|
441
443
|
"boolean": CTypeBase(
|
|
442
444
|
["gboolean <arg_name>"],
|
|
445
|
+
["gboolean *<arg_name>"],
|
|
443
446
|
[],
|
|
444
447
|
["<arg_out> = g_variant_new_boolean(<arg_name>)"],
|
|
445
448
|
["<arg_in> = g_variant_get_boolean(<arg_name>)"],
|
|
@@ -447,6 +450,7 @@ CTYPE_OBJS = {
|
|
|
447
450
|
),
|
|
448
451
|
"byte": CTypeBase(
|
|
449
452
|
["guint8 <arg_name>"],
|
|
453
|
+
["guint8 *<arg_name>"],
|
|
450
454
|
[],
|
|
451
455
|
["<arg_out> = g_variant_new_byte(<arg_name>)"],
|
|
452
456
|
["<arg_in> = g_variant_get_byte(<arg_name>)"],
|
|
@@ -454,6 +458,7 @@ CTYPE_OBJS = {
|
|
|
454
458
|
),
|
|
455
459
|
"int16": CTypeBase(
|
|
456
460
|
["gint16 <arg_name>"],
|
|
461
|
+
["gint16 *<arg_name>"],
|
|
457
462
|
[],
|
|
458
463
|
["<arg_out> = g_variant_new_int16(<arg_name>)"],
|
|
459
464
|
["<arg_in> = g_variant_get_int16(<arg_name>)"],
|
|
@@ -461,6 +466,7 @@ CTYPE_OBJS = {
|
|
|
461
466
|
),
|
|
462
467
|
"uint16": CTypeBase(
|
|
463
468
|
["guint16 <arg_name>"],
|
|
469
|
+
["guint16 *<arg_name>"],
|
|
464
470
|
[],
|
|
465
471
|
["<arg_out> = g_variant_new_uint16(<arg_name>)"],
|
|
466
472
|
["<arg_in> = g_variant_get_uint16(<arg_name>)"],
|
|
@@ -468,6 +474,7 @@ CTYPE_OBJS = {
|
|
|
468
474
|
),
|
|
469
475
|
"int32": CTypeBase(
|
|
470
476
|
["gint32 <arg_name>"],
|
|
477
|
+
["gint32 *<arg_name>"],
|
|
471
478
|
[],
|
|
472
479
|
["<arg_out> = g_variant_new_int32(<arg_name>)"],
|
|
473
480
|
["<arg_in> = g_variant_get_int32(<arg_name>)"],
|
|
@@ -475,6 +482,7 @@ CTYPE_OBJS = {
|
|
|
475
482
|
),
|
|
476
483
|
"uint32": CTypeBase(
|
|
477
484
|
["guint32 <arg_name>"],
|
|
485
|
+
["guint32 *<arg_name>"],
|
|
478
486
|
[],
|
|
479
487
|
["<arg_out> = g_variant_new_uint32(<arg_name>)"],
|
|
480
488
|
["<arg_in> = g_variant_get_uint32(<arg_name>)"],
|
|
@@ -482,6 +490,7 @@ CTYPE_OBJS = {
|
|
|
482
490
|
),
|
|
483
491
|
"int64": CTypeBase(
|
|
484
492
|
["gint64 <arg_name>"],
|
|
493
|
+
["gint64 *<arg_name>"],
|
|
485
494
|
[],
|
|
486
495
|
["<arg_out> = g_variant_new_int64(<arg_name>)"],
|
|
487
496
|
["<arg_in> = g_variant_get_int64(<arg_name>)"],
|
|
@@ -489,6 +498,7 @@ CTYPE_OBJS = {
|
|
|
489
498
|
),
|
|
490
499
|
"uint64": CTypeBase(
|
|
491
500
|
["guint64 <arg_name>"],
|
|
501
|
+
["guint64 *<arg_name>"],
|
|
492
502
|
[],
|
|
493
503
|
["<arg_out> = g_variant_new_uint64(<arg_name>)"],
|
|
494
504
|
["<arg_in> = g_variant_get_uint64(<arg_name>)"],
|
|
@@ -496,6 +506,7 @@ CTYPE_OBJS = {
|
|
|
496
506
|
),
|
|
497
507
|
"size": CTypeBase(
|
|
498
508
|
["gsize <arg_name>"],
|
|
509
|
+
["gsize *<arg_name>"],
|
|
499
510
|
[],
|
|
500
511
|
["<arg_out> = g_variant_new_uint64(<arg_name>)"],
|
|
501
512
|
["<arg_in> = g_variant_get_uint64(<arg_name>)"],
|
|
@@ -503,6 +514,7 @@ CTYPE_OBJS = {
|
|
|
503
514
|
),
|
|
504
515
|
"ssize": CTypeBase(
|
|
505
516
|
["gssize <arg_name>"],
|
|
517
|
+
["gssize *<arg_name>"],
|
|
506
518
|
[],
|
|
507
519
|
["<arg_out> = g_variant_new_int64(<arg_name>)"],
|
|
508
520
|
["<arg_in> = g_variant_get_int64(<arg_name>)"],
|
|
@@ -510,6 +522,7 @@ CTYPE_OBJS = {
|
|
|
510
522
|
),
|
|
511
523
|
"double": CTypeBase(
|
|
512
524
|
["gdouble <arg_name>"],
|
|
525
|
+
["gdouble *<arg_name>"],
|
|
513
526
|
[],
|
|
514
527
|
["<arg_out> = g_variant_new_double(<arg_name>)"],
|
|
515
528
|
["<arg_in> = g_variant_get_double(<arg_name>)"],
|
|
@@ -517,6 +530,7 @@ CTYPE_OBJS = {
|
|
|
517
530
|
),
|
|
518
531
|
"unixfd": CTypeBase(
|
|
519
532
|
["gint32 <arg_name>"],
|
|
533
|
+
["gint32 *<arg_name>"],
|
|
520
534
|
[],
|
|
521
535
|
["<arg_out> = g_variant_new_handle(<arg_name>)"],
|
|
522
536
|
["<arg_in> = g_variant_get_handle(<arg_name>)"],
|
|
@@ -524,6 +538,7 @@ CTYPE_OBJS = {
|
|
|
524
538
|
),
|
|
525
539
|
"string": CTypeBase(
|
|
526
540
|
["<const>gchar *<arg_name>"],
|
|
541
|
+
["gchar **<arg_name>"],
|
|
527
542
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
528
543
|
["<arg_out> = gcl_string_encode(<arg_name>)"],
|
|
529
544
|
["<arg_in> = g_strdup(g_variant_get_string(<arg_name>, NULL))"],
|
|
@@ -534,6 +549,7 @@ CTYPE_OBJS = {
|
|
|
534
549
|
),
|
|
535
550
|
"object_path": CTypeBase(
|
|
536
551
|
["<const>gchar *<arg_name>"],
|
|
552
|
+
["gchar **<arg_name>"],
|
|
537
553
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
538
554
|
["<arg_out> = gcl_object_path_encode(<arg_name>)"],
|
|
539
555
|
["<arg_in> = g_strdup(g_variant_get_string(<arg_name>, NULL))"],
|
|
@@ -544,6 +560,7 @@ CTYPE_OBJS = {
|
|
|
544
560
|
),
|
|
545
561
|
"signature": CTypeBase(
|
|
546
562
|
["<const>gchar *<arg_name>"],
|
|
563
|
+
["gchar **<arg_name>"],
|
|
547
564
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
548
565
|
["<arg_out> = gcl_signature_encode(<arg_name>)"],
|
|
549
566
|
["<arg_in> = g_strdup(g_variant_get_string(<arg_name>, NULL))"],
|
|
@@ -554,6 +571,7 @@ CTYPE_OBJS = {
|
|
|
554
571
|
),
|
|
555
572
|
"variant": CTypeBase(
|
|
556
573
|
["GVariant *<arg_name>"],
|
|
574
|
+
["GVariant **<arg_name>"],
|
|
557
575
|
["gcl_unref_p((GVariant **)&<arg_name>)"],
|
|
558
576
|
["g_variant_take_ref(<arg_name>)", "<arg_out> = g_variant_new_variant(<arg_name>)"],
|
|
559
577
|
["<arg_in> = g_variant_get_variant(<arg_name>)"],
|
|
@@ -561,6 +579,7 @@ CTYPE_OBJS = {
|
|
|
561
579
|
),
|
|
562
580
|
"array[boolean]": CTypeBase(
|
|
563
581
|
["gsize n_<arg_name>" ,"<const>gboolean *<arg_name>"],
|
|
582
|
+
["gsize *n_<arg_name>" ,"gboolean **<arg_name>"],
|
|
564
583
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
565
584
|
["<arg_out> = gcl_array_boolean_encode(<arg_name>, n_<arg_name>)"],
|
|
566
585
|
["<arg_in> = gcl_array_boolean_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -568,6 +587,7 @@ CTYPE_OBJS = {
|
|
|
568
587
|
),
|
|
569
588
|
"array[byte]": CTypeBase(
|
|
570
589
|
["gsize n_<arg_name>" ,"<const>guint8 *<arg_name>"],
|
|
590
|
+
["gsize *n_<arg_name>" ,"guint8 **<arg_name>"],
|
|
571
591
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
572
592
|
["<arg_out> = gcl_array_byte_encode(<arg_name>, n_<arg_name>)"],
|
|
573
593
|
["<arg_in> = gcl_array_byte_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -575,6 +595,7 @@ CTYPE_OBJS = {
|
|
|
575
595
|
),
|
|
576
596
|
"array[int16]": CTypeBase(
|
|
577
597
|
["gsize n_<arg_name>" ,"<const>gint16 *<arg_name>"],
|
|
598
|
+
["gsize *n_<arg_name>" ,"gint16 **<arg_name>"],
|
|
578
599
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
579
600
|
["<arg_out> = gcl_array_int16_encode(<arg_name>, n_<arg_name>)"],
|
|
580
601
|
["<arg_in> = gcl_array_int16_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -582,6 +603,7 @@ CTYPE_OBJS = {
|
|
|
582
603
|
),
|
|
583
604
|
"array[uint16]": CTypeBase(
|
|
584
605
|
["gsize n_<arg_name>" ,"<const>guint16 *<arg_name>"],
|
|
606
|
+
["gsize *n_<arg_name>" ,"guint16 **<arg_name>"],
|
|
585
607
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
586
608
|
["<arg_out> = gcl_array_uint16_encode(<arg_name>, n_<arg_name>)"],
|
|
587
609
|
["<arg_in> = gcl_array_uint16_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -589,6 +611,7 @@ CTYPE_OBJS = {
|
|
|
589
611
|
),
|
|
590
612
|
"array[int32]": CTypeBase(
|
|
591
613
|
["gsize n_<arg_name>" ,"<const>gint32 *<arg_name>"],
|
|
614
|
+
["gsize *n_<arg_name>" ,"gint32 **<arg_name>"],
|
|
592
615
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
593
616
|
["<arg_out> = gcl_array_int32_encode(<arg_name>, n_<arg_name>)"],
|
|
594
617
|
["<arg_in> = gcl_array_int32_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -596,6 +619,7 @@ CTYPE_OBJS = {
|
|
|
596
619
|
),
|
|
597
620
|
"array[uint32]": CTypeBase(
|
|
598
621
|
["gsize n_<arg_name>" ,"<const>guint32 *<arg_name>"],
|
|
622
|
+
["gsize *n_<arg_name>" ,"guint32 **<arg_name>"],
|
|
599
623
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
600
624
|
["<arg_out> = gcl_array_uint32_encode(<arg_name>, n_<arg_name>)"],
|
|
601
625
|
["<arg_in> = gcl_array_uint32_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -603,6 +627,7 @@ CTYPE_OBJS = {
|
|
|
603
627
|
),
|
|
604
628
|
"array[int64]": CTypeBase(
|
|
605
629
|
["gsize n_<arg_name>" ,"<const>gint64 *<arg_name>"],
|
|
630
|
+
["gsize *n_<arg_name>" ,"gint64 **<arg_name>"],
|
|
606
631
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
607
632
|
["<arg_out> = gcl_array_int64_encode(<arg_name>, n_<arg_name>)"],
|
|
608
633
|
["<arg_in> = gcl_array_int64_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -610,6 +635,7 @@ CTYPE_OBJS = {
|
|
|
610
635
|
),
|
|
611
636
|
"array[uint64]": CTypeBase(
|
|
612
637
|
["gsize n_<arg_name>" ,"<const>guint64 *<arg_name>"],
|
|
638
|
+
["gsize *n_<arg_name>" ,"guint64 **<arg_name>"],
|
|
613
639
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
614
640
|
["<arg_out> = gcl_array_uint64_encode(<arg_name>, n_<arg_name>)"],
|
|
615
641
|
["<arg_in> = gcl_array_uint64_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -617,6 +643,7 @@ CTYPE_OBJS = {
|
|
|
617
643
|
),
|
|
618
644
|
"array[ssize]": CTypeBase(
|
|
619
645
|
["gsize n_<arg_name>" ,"<const>gssize *<arg_name>"],
|
|
646
|
+
["gsize *n_<arg_name>" ,"gssize **<arg_name>"],
|
|
620
647
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
621
648
|
["<arg_out> = gcl_array_int64_encode(<arg_name>, n_<arg_name>)"],
|
|
622
649
|
["<arg_in> = gcl_array_int64_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -624,6 +651,7 @@ CTYPE_OBJS = {
|
|
|
624
651
|
),
|
|
625
652
|
"array[size]": CTypeBase(
|
|
626
653
|
["gsize n_<arg_name>" ,"<const>gsize *<arg_name>"],
|
|
654
|
+
["gsize *n_<arg_name>" ,"gsize **<arg_name>"],
|
|
627
655
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
628
656
|
["<arg_out> = gcl_array_uint64_encode(<arg_name>, n_<arg_name>)"],
|
|
629
657
|
["<arg_in> = gcl_array_uint64_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -631,6 +659,7 @@ CTYPE_OBJS = {
|
|
|
631
659
|
),
|
|
632
660
|
"array[double]": CTypeBase(
|
|
633
661
|
["gsize n_<arg_name>" ,"<const>gdouble *<arg_name>"],
|
|
662
|
+
["gsize *n_<arg_name>" ,"gdouble **<arg_name>"],
|
|
634
663
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
635
664
|
["<arg_out> = gcl_array_double_encode(<arg_name>, n_<arg_name>)"],
|
|
636
665
|
["<arg_in> = gcl_array_double_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -638,6 +667,7 @@ CTYPE_OBJS = {
|
|
|
638
667
|
),
|
|
639
668
|
"array[unixfd]": CTypeBase(
|
|
640
669
|
["gsize n_<arg_name>" ,"<const>gint32 *<arg_name>"],
|
|
670
|
+
["gsize *n_<arg_name>" ,"gint32 **<arg_name>"],
|
|
641
671
|
["gcl_free_p((void **)&<arg_name>)"],
|
|
642
672
|
["<arg_out> = gcl_array_handle_encode(<arg_name>, n_<arg_name>)"],
|
|
643
673
|
["<arg_in> = gcl_array_handle_decode(<arg_name>, &n_<arg_in>)"],
|
|
@@ -645,6 +675,7 @@ CTYPE_OBJS = {
|
|
|
645
675
|
),
|
|
646
676
|
"array[string]": CTypeBase(
|
|
647
677
|
["gchar *<const>*<arg_name>"],
|
|
678
|
+
["gchar ***<arg_name>"],
|
|
648
679
|
["gcl_strfreev_p(&<arg_name>)"],
|
|
649
680
|
["<arg_out> = gcl_array_string_encode(<arg_name>)"],
|
|
650
681
|
["<arg_in> = gcl_array_string_decode(<arg_name>)"],
|
|
@@ -652,6 +683,7 @@ CTYPE_OBJS = {
|
|
|
652
683
|
),
|
|
653
684
|
"array[object_path]": CTypeBase(
|
|
654
685
|
["gchar *<const>*<arg_name>"],
|
|
686
|
+
["gchar ***<arg_name>"],
|
|
655
687
|
["gcl_strfreev_p(&<arg_name>)"],
|
|
656
688
|
["<arg_out> = gcl_array_object_path_encode(<arg_name>)"],
|
|
657
689
|
["<arg_in> = gcl_array_object_path_decode(<arg_name>)"],
|
|
@@ -659,6 +691,7 @@ CTYPE_OBJS = {
|
|
|
659
691
|
),
|
|
660
692
|
"array[signature]": CTypeBase(
|
|
661
693
|
["gchar *<const>*<arg_name>"],
|
|
694
|
+
["gchar ***<arg_name>"],
|
|
662
695
|
["gcl_strfreev_p(&<arg_name>)"],
|
|
663
696
|
["<arg_out> = gcl_array_signature_encode(<arg_name>)"],
|
|
664
697
|
["<arg_in> = gcl_array_signature_decode(<arg_name>)"],
|
|
@@ -245,6 +245,46 @@ class IdfCtypeRender():
|
|
|
245
245
|
}
|
|
246
246
|
return schema
|
|
247
247
|
|
|
248
|
+
def out_declare(self):
|
|
249
|
+
"""输出变量申明,用于结构体(接口类、方法请求和响应、信号消息等)申明"""
|
|
250
|
+
log.debug(f"Get out_declare info, name: {self.name}, ctype: {self.ctype}")
|
|
251
|
+
match = re.match(f"^array\[({CTYPE_BASE_REG})\]$", self.ctype)
|
|
252
|
+
if match:
|
|
253
|
+
ctype_obj = CTYPE_OBJS.get(self.ctype)
|
|
254
|
+
return ctype_obj.out_declare
|
|
255
|
+
match = re.match(f"^({CTYPE_REGEX})$", self.ctype)
|
|
256
|
+
if match:
|
|
257
|
+
ctype_obj = CTYPE_OBJS.get(self.ctype)
|
|
258
|
+
return ctype_obj.out_declare
|
|
259
|
+
# 非基础类型
|
|
260
|
+
is_array = False
|
|
261
|
+
ctype = self.ctype
|
|
262
|
+
match = re.match(f"^array\[(.*)\]$", ctype)
|
|
263
|
+
if match:
|
|
264
|
+
is_array = True
|
|
265
|
+
ctype = match.group(1)
|
|
266
|
+
match = re.match(f"^(struct|enum|dict)\[(.*)\]$", ctype)
|
|
267
|
+
_, stru_name = get_intfname_and_ctype(match.group(2))
|
|
268
|
+
if match.group(1) == "struct":
|
|
269
|
+
if is_array:
|
|
270
|
+
# 结构体数组初始化时为二级空指针,以空指针结束
|
|
271
|
+
return [f"{stru_name} ***<arg_name>"]
|
|
272
|
+
else:
|
|
273
|
+
# 结构体成员初始化时为空结构体,由反序列化时填充内容
|
|
274
|
+
return [f"{stru_name} **<arg_name>"]
|
|
275
|
+
elif match.group(1) == "enum":
|
|
276
|
+
if is_array:
|
|
277
|
+
# 枚举数组初始化时为数组空指针
|
|
278
|
+
return [f"gsize *n_<arg_name>", f"{stru_name} **<arg_name>"]
|
|
279
|
+
else:
|
|
280
|
+
return [f"{stru_name} *<arg_name>"]
|
|
281
|
+
else:
|
|
282
|
+
if is_array:
|
|
283
|
+
# 字典数组初始化为二级空指针,以空指针
|
|
284
|
+
return [f"{stru_name} ***<arg_name>"]
|
|
285
|
+
else:
|
|
286
|
+
return [f"{stru_name} **<arg_name>"]
|
|
287
|
+
|
|
248
288
|
def declare(self):
|
|
249
289
|
"""变量申明,用于结构体(接口类、方法请求和响应、信号消息等)申明"""
|
|
250
290
|
log.debug(f"Get declare info, name: {self.name}, ctype: {self.ctype}")
|
|
@@ -466,7 +506,7 @@ class IdfProperty(IdfCtypeRender):
|
|
|
466
506
|
self.ctype = prop_data.get("type", "")
|
|
467
507
|
super().__init__()
|
|
468
508
|
self.name = prop_data.get("name")
|
|
469
|
-
self.access = "
|
|
509
|
+
self.access = "readwrite"
|
|
470
510
|
self.annotations: list[IdfAnnotation] = []
|
|
471
511
|
self.description = prop_data.get("description", "")
|
|
472
512
|
flags = prop_data.get("flags", "").split(",")
|
|
@@ -485,24 +525,23 @@ class IdfProperty(IdfCtypeRender):
|
|
|
485
525
|
if k in flags:
|
|
486
526
|
self.annotations.append(v)
|
|
487
527
|
|
|
488
|
-
|
|
528
|
+
c_flags = []
|
|
489
529
|
if self.private:
|
|
490
|
-
|
|
530
|
+
c_flags.append("PM_FLAGS_PROPERTY_PRIVATE")
|
|
491
531
|
elif "emits_const" in flags:
|
|
492
|
-
|
|
532
|
+
c_flags.append("PM_FLAGS_PROPERTY_EMIT_CONST")
|
|
493
533
|
elif "emits_false" in flags:
|
|
494
|
-
|
|
534
|
+
c_flags.append("PM_FLAGS_PROPERTY_EMIT_FALSE")
|
|
495
535
|
elif "emits_invalidates" in flags:
|
|
496
|
-
|
|
536
|
+
c_flags.append("PM_FLAGS_PROPERTY_EMIT_INVALIDATES")
|
|
497
537
|
else:
|
|
498
|
-
|
|
538
|
+
c_flags.append("PM_FLAGS_PROPERTY_EMIT_TRUE")
|
|
499
539
|
if self.deprecated:
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if len(flags) == 0:
|
|
540
|
+
c_flags.append("PM_FLAGS_PROPERTY_DEPRECATED")
|
|
541
|
+
if len(c_flags) == 0:
|
|
503
542
|
self.desc_flags = "0"
|
|
504
543
|
else:
|
|
505
|
-
self.desc_flags = " | ".join(
|
|
544
|
+
self.desc_flags = " | ".join(c_flags)
|
|
506
545
|
|
|
507
546
|
|
|
508
547
|
@property
|
|
@@ -11,6 +11,8 @@ static ${intf.alias}_Properties ${properties};
|
|
|
11
11
|
static const ${intf.alias}_Signals *${signal_processer} = NULL;
|
|
12
12
|
|
|
13
13
|
% for prop in intf.properties:
|
|
14
|
+
## 私有属性或者只读属性
|
|
15
|
+
% if not prop.private and prop.access != "read":
|
|
14
16
|
% if prop.deprecated:
|
|
15
17
|
__attribute__((__deprecated__)) gint ${class_name}_set_${prop.name}(const ${class_name} *object,
|
|
16
18
|
${", ".join(prop.declare()).replace("<arg_name>", prop.name).replace("<const>", "const ")}, GError **error)
|
|
@@ -25,22 +27,48 @@ gint ${class_name}_set_${prop.name}(const ${class_name} *object,
|
|
|
25
27
|
% endfor
|
|
26
28
|
return gcl_impl.write_property((GclObject *)object, &${properties}.${prop.name}, tmp, error);
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
% endif
|
|
32
|
+
## 私有或只写属性不允许读
|
|
33
|
+
% if not prop.private and prop.access != "write":
|
|
28
34
|
% if prop.deprecated:
|
|
29
35
|
__attribute__((__deprecated__)) gint ${class_name}_get_${prop.name}(const ${class_name} *object,
|
|
30
|
-
|
|
36
|
+
${", ".join(prop.out_declare()).replace("<arg_name>", "value").replace("<const>", "")}, GError **error)
|
|
31
37
|
% else:
|
|
32
|
-
gint ${class_name}_get_${prop.name}(const ${class_name} *object,
|
|
38
|
+
gint ${class_name}_get_${prop.name}(const ${class_name} *object, ${", ".join(prop.out_declare()).replace("<arg_name>", "value").replace("<const>", "")}, GError **error)
|
|
33
39
|
% endif
|
|
34
40
|
{
|
|
41
|
+
% if "gsize n_" in prop.declare()[0]:
|
|
42
|
+
g_assert(n_value && value);
|
|
43
|
+
% else:
|
|
44
|
+
g_assert(value);
|
|
45
|
+
% endif
|
|
46
|
+
% for line in prop.declare():
|
|
47
|
+
% if "*" in line:
|
|
48
|
+
${line.strip().replace("<arg_name>", "tmp_value").replace("<const>", "")} = NULL;
|
|
49
|
+
% else:
|
|
50
|
+
${line.strip().replace("<arg_name>", "tmp_value").replace("<const>", "")};
|
|
51
|
+
% endif
|
|
52
|
+
% endfor
|
|
35
53
|
GVariant *out = NULL;
|
|
54
|
+
|
|
36
55
|
gint ret = gcl_impl.read_property((GclObject *)object, &${properties}.${prop.name}, &out, error);
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
if (ret == 0 && out) {
|
|
57
|
+
% for line in prop.decode_func():
|
|
58
|
+
${line.replace("<arg_in>", "tmp_value").replace("<arg_name>", "out")};
|
|
59
|
+
% endfor
|
|
60
|
+
*value = tmp_value;
|
|
61
|
+
% if "gsize n_" in prop.declare()[0]:
|
|
62
|
+
*n_value = n_tmp_value;
|
|
63
|
+
% endif
|
|
64
|
+
}
|
|
65
|
+
if (out) {
|
|
40
66
|
g_variant_unref(out);
|
|
41
67
|
}
|
|
42
68
|
return ret;
|
|
43
69
|
}
|
|
70
|
+
|
|
71
|
+
% endif
|
|
44
72
|
% endfor
|
|
45
73
|
|
|
46
74
|
% for method in intf.methods:
|
|
@@ -14,6 +14,7 @@ typedef ${intf.alias} ${class_name};
|
|
|
14
14
|
typedef ${intf.alias}_Properties ${class_name}_Properties;
|
|
15
15
|
|
|
16
16
|
% for prop in intf.properties:
|
|
17
|
+
% if not prop.private:
|
|
17
18
|
/*
|
|
18
19
|
* property: ${prop.name}
|
|
19
20
|
% if len(prop.description.strip()) > 0:
|
|
@@ -25,17 +26,22 @@ typedef ${intf.alias}_Properties ${class_name}_Properties;
|
|
|
25
26
|
% endfor
|
|
26
27
|
% endif
|
|
27
28
|
*/
|
|
29
|
+
## 私有属性或者只读属性不允许写
|
|
30
|
+
% if not prop.private and prop.access != "read":
|
|
28
31
|
% if prop.deprecated:
|
|
29
|
-
__attribute__((__deprecated__)) gint ${class_name}_set_${prop.name}(const ${class_name} *object,
|
|
30
|
-
${", ".join(prop.declare()).replace("<arg_name>", "value").replace("<const>", "const ")},
|
|
31
|
-
GError **error);
|
|
32
|
+
__attribute__((__deprecated__)) gint ${class_name}_set_${prop.name}(const ${class_name} *object, ${", ".join(prop.declare()).replace("<arg_name>", "value").replace("<const>", "const ")}, GError **error);
|
|
32
33
|
% else:
|
|
33
|
-
gint ${class_name}_set_${prop.name}(const ${class_name} *object,
|
|
34
|
-
${", ".join(prop.declare()).replace("<arg_name>", "value").replace("<const>", "const ")},
|
|
35
|
-
GError **error);
|
|
34
|
+
gint ${class_name}_set_${prop.name}(const ${class_name} *object, ${", ".join(prop.declare()).replace("<arg_name>", "value").replace("<const>", "const ")}, GError **error);
|
|
36
35
|
% endif
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
% endif
|
|
37
|
+
% if not prop.private and prop.access != "write":
|
|
38
|
+
% if prop.deprecated:
|
|
39
|
+
__attribute__((__deprecated__)) gint ${class_name}_get_${prop.name}(const ${class_name} *object, ${", ".join(prop.out_declare()).replace("<arg_name>", "value").replace("<const>", "")}, GError **error);
|
|
40
|
+
% else:
|
|
41
|
+
gint ${class_name}_get_${prop.name}(const ${class_name} *object, ${", ".join(prop.out_declare()).replace("<arg_name>", "value").replace("<const>", "")}, GError **error);
|
|
42
|
+
% endif
|
|
43
|
+
% endif
|
|
44
|
+
% endif
|
|
39
45
|
% endfor
|
|
40
46
|
|
|
41
47
|
% for method in intf.methods:
|
|
@@ -123,18 +123,19 @@ class LiteBmcConan(ConanFile):
|
|
|
123
123
|
% endfor
|
|
124
124
|
% endif
|
|
125
125
|
% endfor
|
|
126
|
+
if self.options.test == True:
|
|
126
127
|
<%test_requires=pkg["requires"].get("test", [])%>\
|
|
127
128
|
% if len(test_requires):
|
|
128
129
|
% for conan in test_requires:
|
|
129
130
|
% if conan.get("option") is not None:
|
|
130
131
|
% for k, v in conan.get("option").items():
|
|
131
|
-
|
|
132
|
+
self.options["${conan.get("conan").split("/")[0]}"].${k} = ${("\"" + v + "\"") if isinstance(v, str) else str(v)}
|
|
132
133
|
% endfor
|
|
133
134
|
% endif
|
|
134
135
|
% endfor
|
|
135
136
|
% endif
|
|
136
137
|
% endif
|
|
137
|
-
|
|
138
|
+
pass
|
|
138
139
|
|
|
139
140
|
def _append_default_flags(self):
|
|
140
141
|
flags = []
|
|
@@ -11,6 +11,27 @@ class DeployConan(ConanFile):
|
|
|
11
11
|
package_type = "application"
|
|
12
12
|
version = "0.0.1"
|
|
13
13
|
license = "MulanPSL v2"
|
|
14
|
+
options = {
|
|
15
|
+
"gcov": [False, True],
|
|
16
|
+
"test": [False, True],
|
|
17
|
+
% if len(pkg.get("options", [])) > 0:
|
|
18
|
+
% for op, ctx in pkg["options"].items():
|
|
19
|
+
"${op}": [${", ".join(("\"" + i + "\"") if isinstance(i, str) else str(i) for i in ctx["option"])}],
|
|
20
|
+
% endfor
|
|
21
|
+
% endif
|
|
22
|
+
}
|
|
23
|
+
default_options = {
|
|
24
|
+
% if pkg_type == "library":
|
|
25
|
+
"shared": True,
|
|
26
|
+
% endif
|
|
27
|
+
"gcov": False,
|
|
28
|
+
"test": False,
|
|
29
|
+
% if len(pkg.get("options", [])) > 0:
|
|
30
|
+
% for op, ctx in pkg["options"].items():
|
|
31
|
+
"${op}": ${("\"" + ctx["default"] + "\"") if isinstance(ctx["default"], str) else str(ctx["default"])},
|
|
32
|
+
% endfor
|
|
33
|
+
% endif
|
|
34
|
+
}
|
|
14
35
|
|
|
15
36
|
def requirements(self):
|
|
16
37
|
% for package in packages:
|
|
@@ -27,16 +48,16 @@ class DeployConan(ConanFile):
|
|
|
27
48
|
% endfor
|
|
28
49
|
% endif
|
|
29
50
|
% endfor
|
|
51
|
+
if self.options.test == True:
|
|
30
52
|
<%test_requires=pkg["requires"].get("test", [])%>\
|
|
31
53
|
% if len(test_requires):
|
|
32
54
|
% for conan in test_requires:
|
|
33
55
|
% if conan.get("option") is not None:
|
|
34
56
|
% for k, v in conan.get("option").items():
|
|
35
|
-
|
|
57
|
+
self.options["${conan.get("conan").split("/")[0]}"].${k} = ${("\"" + v + "\"") if isinstance(v, str) else str(v)}
|
|
36
58
|
% endfor
|
|
37
59
|
% endif
|
|
38
60
|
% endfor
|
|
39
61
|
% endif
|
|
40
62
|
% endif
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
pass
|
|
@@ -29,6 +29,7 @@ class BuildManifest(Task):
|
|
|
29
29
|
self.conan_settings = " -s build_type=Release"
|
|
30
30
|
self.common_args = "-r " + self.config.remote
|
|
31
31
|
self.common_args += " -pr:b {} -pr:h {}".format(self.config.profile_build, self.config.profile_host)
|
|
32
|
+
self.common_args += " -o */*:test=False"
|
|
32
33
|
|
|
33
34
|
def deploy(self):
|
|
34
35
|
cmd = f"conan graph info . {self.common_args} --build=missing -f json --filter=ref --filter=package_id"
|
lbkit-0.5.13/lbkit/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|