pass a non-standard object from C toTcl

Umesh Singla umeshksingla at macports.org
Thu Aug 24 20:43:17 UTC 2017


Hi

I don't why I got stuck here when the simple solution was to simply
construct the strings in the form of "port_name requested state
+variant1-variant2" while in C and pass it to Tcl. Took a lot of time :/

- Umesh

On Mon, Aug 21, 2017 at 10:27 PM, Bradley Giesbrecht <pixilla at macports.org>
wrote:

> > On Aug 19, 2017, at 7:48 AM, Umesh Singla <umeshksingla at macports.org>
> wrote:
> >
> > 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?
>
> I don’t know, hopefully someone else can provide a better answer soon.
>
> Have you looked how other port functionality accomplishes something
> similar?
>
>
> Regards,
> Bradley Giesbrecht (pixilla)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20170825/725c5395/attachment.html>


More information about the macports-dev mailing list