libfyaml icon indicating copy to clipboard operation
libfyaml copied to clipboard

Problem: implementing custom comparison methods

Open yrashk opened this issue 1 year ago • 3 comments

While the comparison method to be created would benefit from being able to fall back onto the default implementation, it can't do so as these default methods are private to libfyaml and are not exposed.

Solution: make them available as a public interface

yrashk avatar Jun 09 '23 04:06 yrashk

@pantoniou have you had a chance to look at this, what do you think?

yrashk avatar Jun 18 '23 17:06 yrashk

Actually, I think there's an easier solution: just exposing int fy_token_cmp(struct fy_token *fyt1, struct fy_token *fyt2) in header files. This way, a custom comparator can use it.

I will send a separate PR.

yrashk avatar Jun 18 '23 18:06 yrashk

I sent #87 for this and I've also discovered a bug 🐛 in fy_compare_node_user, see #86

yrashk avatar Jun 19 '23 03:06 yrashk