pass a non-standard object from C toTcl

Umesh Singla umeshksingla at macports.org
Sat Aug 19 14:48:41 UTC 2017


Hi

How do I pass "reg_snapshot->ports" below C struct back to Tcl in
macports-base?

typedef struct {
    char* variant_name;
    char* variant_sign;
} variant;

typedef struct {
    char* name;
    int requested;
    char* state;
    variant* variants;
} port;

typedef struct {
    sqlite_int64 id; /* rowid in database */
    char* note;
    port* ports;
    reg_registry* reg; /* associated registry */
    char* proc; /* name of Tcl proc, if using Tcl */
} reg_snapshot;

I fetch the `ports` from a given reg_snapshot->id from SQLite, how can I
pass the resulting ports back to Tcl procedure? Do I need to have `proc` in
them too?

- Umesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20170819/32e5180a/attachment.html>


More information about the macports-dev mailing list