Re: inspect table object in C interface

Date: Tue, 10 Mar 2009 14:15:27 +0000Message-ID: <1855e77f0903100715m463eaa59t1f46d22bde94b6eb@mail.gmail.com>Subject: Re: [personal kdb+] inspect table object in C interfaceFrom: Attila Vrabecz <attila.vrabecz>To: personal-kdbplus@googlegroups.com kK(tbl->k)[1] is values (column-vectors) AttilaOn Tue, Mar 10, 2009 at 2:15 PM, Attila Vrabecz<attila.vrabecz> wrote:> tbl->k is the dictionary which maps column-names to column-vectors> kK(tbl->k)[0] is keys (column-names)> kK(tbl->k)[0] is values (column-vectors)>> it all becomes a lot easier if you use x for a tablename because then> you can use the shortcuts (xk, xx, xy, etc) defined in k.h> ?Attila>>>> On Tue, Mar 10, 2009 at 1:58 PM, dbtouch wrote:>>>> Dear K programmers,>>>> Please take a look at this simple C interface program. I created table>> object tbl from dict and I tried to inspect tbl using debugger and I>> could not see valid data member in tbl. Can someone tell me in which>> data member of tbl, the table data is saved?>>>> dbtouch>>>> ?#include “k.h”>> #include >> #include >> int main(int argc, char* argv)>> {>> ? ? ? ?K err;>> ? ? ? ?I kdbSocketHandle = khp(argv[1], (short)atoi(argv[2]));>>>> ? ? ? ?if (kdbSocketHandle > 0) {>> ? ? ? ? ? ? ? ?K columns = ktn(KC, 2);>> ? ? ? ? ? ? ? ?kC(columns)[0]=‘a’;>> ? ? ? ? ? ? ? ?kC(columns)[1]=‘b’;>>>> ? ? ? ? ? ? ? ?K data = ktn(KI, 2);>> ? ? ? ? ? ? ? ?kI(data)[0]=1;>> ? ? ? ? ? ? ? ?kI(data)[1]=2;>> ? ? ? ? ? ? ? ?K dict=xD(columns, data);>> ? ? ? ? ? ? ? ?K tbl=xT(dict);>> ? ? ? ? ? ? ? ?K kBoolean=ki(100);>> ? ? ? ? ? ? ? ?return EXIT_SUCCESS;>> ? ? ? ?}>> }>> >>>>></attila.vrabecz></attila.vrabecz>