poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Added struct functionality on pk-val


From: Konstantinos Chasialis
Subject: Re: [PATCH] Added struct functionality on pk-val
Date: Fri, 29 May 2020 19:04:26 +0300
User-agent: SquirrelMail/1.4.23 [email.uoa.gr]

Hello Jose.

I've made the changes in ChangeLog and libpoke.h.

About the struct methods, I believe we need their interface in order to
build pk_mi_val_to_json. That is, because when we build a struct json
object we need to have access to its methods in order to correctly build
the json_object.


I've added all functions on ChangeLog, I hope you dont find it unnecessary.

diff --git a/ChangeLog b/ChangeLog
index 7a865d01..d2fbb99b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2020-05-28  Kostas Chasialis <sdi1600195@di.uoa.gr>
+       * libpoke/libpoke.h (pk_make_struct): Prototype.
+       (pk_struct_nfields): Likewise.
+       (pk_struct_nmethods): Likewise.
+       (pk_struct_field_boffset): Likewise.
+       (pk_struct_set_field_boffset): Likewise.
+       (pk_struct_field_name): Likewise.
+       (pk_struct_set_field_name): Likewise.
+       (pk_struct_field_value): Likewise.
+       (pk_struct_set_field_value): Likewise.
+       (pk_struct_method_name): Likewise.
+       (pk_struct_set_method_name): Likewise.
+       (pk_struct_method_value): Likewise.
+       (pk_struct_set_method_value): Likewise.
+
+       * libpoke/pk-val.c (pk_make_struct): Define.
+       (pk_struct_nfields): Likewise.
+       (pk_struct_nmethods): Likewise.
+       (pk_struct_field_boffset): Likewise.
+       (pk_struct_set_field_boffset): Likewise.
+       (pk_struct_field_name): Likewise.
+       (pk_struct_set_field_name): Likewise.
+       (pk_struct_field_value): Likewise.
+       (pk_struct_set_field_value): Likewise.
+       (pk_struct_method_name): Likewise.
+       (pk_struct_set_method_name): Likewise.
+       (pk_struct_method_value): Likewise.
+       (pk_struct_set_method_value): Likewise.
+


Also the changes on libpoke.h (PVM to PK)

diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
index 8df50625..d149dd39 100644
--- a/libpoke/libpoke.h
+++ b/libpoke/libpoke.h
@@ -490,16 +490,16 @@ pk_val pk_offset_unit (pk_val val);
 /* Structs. */

 /* Build and return a poke struct.
-   NFIELDS is an ulong<64> PVM value specifying the number of fields
-   in the struct.  This can be ulong<64>0 for an empty struct.
+   NFIELDS is an uint<64> PK value specifying the number of fields
+   in the struct.  This can be uint<64>0 for an empty struct.

-   NMETHODS is an ulong<64> PVM vlaue specifying the number of methods
+   NMETHODS is an uint<64> PK value specifying the number of methods
    in the struct.

-   TYPE is a type PVM value specifying the type of the array.
+   TYPE is a type PK value specifying the type of the array.

    The fields and methods in the created struct are initialized to
-   PVM_NULL.*/
+   PK_NULL.*/

 pk_val pk_make_struct (pk_val nfields, pk_val nmethods, pk_val type);

@@ -588,7 +588,7 @@ pk_val pk_struct_method_value (pk_val sct, uint64_t idx);

    SCT is the struct value.
    IDX is the index of the method in the struct.
-   VALUE is a PVM closure. */
+   VALUE is a PK closure. */






reply via email to

[Prev in Thread] Current Thread [Next in Thread]