cpx.h with CPXNODE struct

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

mikro
Atari God
Atari God
Posts: 1305
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

cpx.h with CPXNODE struct

Postby mikro » Wed Nov 30, 2016 12:18 am

Hi,

this is a long shot but I'll try anyway. Didier uses a mysterious include called cpx.h in his CPX sources: http://atariforge.net/gf/project/ctpci/ ... iew=markup ... all structs/fields more or less match except one -- CPXNODE. As far as I can tell, it's a CPX_LIST alias, where CPX_LIST is defined as:

Code: Select all

typedef struct cpxlist
{
        char f_name[14];
        WORD head_ok;
        WORD segm_ok;
        struct
        {
                void *text_seg;
                long len_text;
                void *data_seg;
                long len_data;
                void *bss_seg;
                long len_bss;
        } *segm;
        struct cpxlist *next;
        CPXHEAD header;
} CPX_LIST;

(taken from TOS Magazin's cover disk)

However there's clearly a difference, visible here:

Code: Select all

   register CPXNODE *p;
   p=(CPXNODE *)(*Xcpb->Get_Head_Node)();   /* header 1st CPX */
   do
   {
      if(p->cpxhead.cpx_id==id)
         return(p);
   }
   while(p->vacant && (p=p->next)!=0);      /* no more headers */
   return(0L);

There's no 'vacant' field at all. 'Get_Head_Node' function pointer seems to be 'get_cpx_list':

Code: Select all

typedef struct
{
    WORD    handle;
    WORD    booting;
    WORD    reserved;
    WORD    SkipRshFix;

    CPX_LIST *  cdecl (*get_cpx_list)(void);
    WORD cdecl  (*save_header)(CPX_LIST *header);

    void cdecl  (*rsh_fix)(WORD num_objs,WORD num_frstr,
                    WORD num_frimg, WORD num_tree,
                    OBJECT *rs_object, TEDINFO *rs_tedinfo,
                    char *rs_strings[], ICONBLK *rs_iconblk,
                    BITBLK *rs_bitblk, long *rs_frstr,
                    long *rs_frimg, long *rs_trindex,
                    struct foobar *rs_imdope);

    void cdecl  (*rsh_obfix)(OBJECT *tree, WORD ob);

    WORD cdecl  (*Popup)(char *items[],WORD num,
                WORD def_item,WORD font,
                GRECT *up, GRECT *world);

    void cdecl  (*Sl_size)(OBJECT *tree, WORD base,
                WORD slider, WORD entrys, WORD vis_ent,
                WORD hvflag, WORD min_pix);

    void cdecl  (*Sl_x)(OBJECT *tree, WORD base, WORD slider,
                WORD value, WORD min, WORD max,
                void (*foo)(void));

    void cdecl  (*Sl_y)(OBJECT *tree, WORD base, WORD slider,
                WORD value, WORD min, WORD max,
                void (*foo)(void));

    void cdecl  (*Sl_arrow)(OBJECT *tree, WORD base,
                WORD slider, WORD obj, WORD inc, WORD min,
                WORD max, WORD *value, WORD hvflag,
                void (*foo)(void));

    void cdecl  (*Sl_dragx)(OBJECT *tree, WORD base,
                WORD slider, WORD min, WORD max,
                WORD *value, void (*foo)(void));

    void cdecl  (*Sl_dragy)(OBJECT *tree, WORD base,
                WORD slider, WORD min, WORD max,
                WORD *value, void (*foo)(void));

    WORD cdecl  (*Xform_do)(OBJECT *tree,WORD eobj,
                WORD *msg);

    GRECT * cdecl   (*GetFirstRect)(GRECT *prect);

    GRECT * cdecl   (*GetNextRect)(void);

    void cdecl  (*Set_Evnt_Mask)(WORD mask, MOBLK *m1,
                MOBLK *m2, long time);

    WORD cdecl  (*XGen_Alert)(WORD al);

    WORD cdecl  (*CPX_Save)(void *ptr, long bytes);

    void * cdecl    (*Get_Buffer)(void);

    WORD cdecl  (*getcookie)(long cookie, long *p_value);

    WORD        Country_Code;

    void cdecl  (*MFsave)(WORD flag, MFORM *mf);

} XCPB;

Of course, I can (hopefully) easily change the names but I'm curious, has anybody ever seen the cpx.h header with definitions like that?

gstoll
Atari freak
Atari freak
Posts: 62
Joined: Sun Feb 17, 2008 4:29 pm

Re: cpx.h with CPXNODE struct

Postby gstoll » Sat Dec 10, 2016 12:13 pm

mikro wrote:but I'm curious, has anybody ever seen the cpx.h header with definitions like that?

It looks like that the cpx.h is from the german TOS Magazin 5/1992. At the end of the page you find the disk.

mikro
Atari God
Atari God
Posts: 1305
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: cpx.h with CPXNODE struct

Postby mikro » Sat Dec 10, 2016 12:18 pm

I know, I mention it a few lines above. :) The structure is close but not identical. So I've been wondering whether there isn't any well known cpx header/library by any chance.

User avatar
willy
Atari freak
Atari freak
Posts: 50
Joined: Fri Apr 05, 2013 2:38 pm

Re: cpx.h with CPXNODE struct

Postby willy » Sat Dec 10, 2016 3:05 pm

I took it from here: http://dev-docs.atariforge.org/files/atari_src_fix.zip
(XSTRUCTS.H and CPXDATA.H)
(ref.: viewtopic.php?f=97&t=30806#p307035 )

All the CPX's should 'collaborate' with Xcontrol. Isn't ?

I guess that Didier just took the essential parts of XCONTROL's header files and put them together into one universal file.

Anyway, there were also some 'strange' quirks that i was not able to identify what was used to compile that.
Fx. cdecl keyword was wroten uppercase.

regards
Willy.

gstoll
Atari freak
Atari freak
Posts: 62
Joined: Sun Feb 17, 2008 4:29 pm

Re: cpx.h with CPXNODE struct

Postby gstoll » Sat Dec 10, 2016 5:16 pm

mikro wrote:I know, I mention it a few lines above. :)

Ups, thought you mean a english one.

mikro wrote:The structure is close but not identical. So I've been wondering whether there isn't any well known cpx header/library by any chance.

The next try ;-)
The header which came with the source from COPS.

mikro
Atari God
Atari God
Posts: 1305
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: cpx.h with CPXNODE struct

Postby mikro » Sun Dec 11, 2016 8:01 am

willy wrote:I took it from here: http://dev-docs.atariforge.org/files/atari_src_fix.zip
(XSTRUCTS.H and CPXDATA.H)
(ref.: viewtopic.php?f=97&t=30806#p307035 )

Oops, I guess I should have asked you first. ;) You're right, this is it, XControl source code contains all the names. But gluing it together and reference it as a system header is really a strange thing to do in a public source file. Thanks again!


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests