Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement and test hash types #56

Open
spk121 opened this issue Sep 3, 2019 · 3 comments
Open

Implement and test hash types #56

spk121 opened this issue Sep 3, 2019 · 3 comments

Comments

@spk121
Copy link
Owner

spk121 commented Sep 3, 2019

Implement scheme-to-GHashTable conversion functions and ensure that all the libmarshall tests pass for hash tables.

@spk121
Copy link
Owner Author

spk121 commented Sep 16, 2019

So it appears that in the GIR and Typelib files, all of the GHashTable constructors are marked as not introspectable, so there is no way to construct a GHashTable via introspected methods. However, the type itself and many methods are introspectable.
Thus, any GHashTable constructors will need to be supplied by this project.

@spk121
Copy link
Owner Author

spk121 commented Nov 15, 2019

I've implemented a minimal interface. It is primitive, but, it provides the minimum functionality and tracks the C API. I'm not sure about what higher-level API would be appropriate, since so much depends on interpreting the pointers that GHashTables use as their keys and values.

@spk121 spk121 closed this as completed Nov 15, 2019
@spk121 spk121 reopened this Nov 15, 2019
spk121 added a commit that referenced this issue Nov 24, 2019
The type conventions for GHashTable are all reverse
engineered by making the libmarshall test suite pass.
Hopefully the test suite is correct.
@spk121
Copy link
Owner Author

spk121 commented Nov 26, 2019

These patches always convert a Guile hashtable to a GHashTable and vice versa as required by a function call. OUT and INOUT are handled correctly. The next problem is that a GHashTable can be marked as IN only in a function call, but, the function can still modify the hashtable. (see g_hash_table_insert)
Two strategies

  • Return a Guile representation of the GHashTable as output, as if it were an INOUT parameter. (But can't use INOUT handling directly because of the extra level of indirection of INOUT parameters)
  • After the function call, modify the Guile hashtable to match the GHashTable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant