FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


How to transfer a domain int_List to a Visual Prolog 7.5 in C ++?

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog
View previous topic :: View next topic  
Author Message
alex63




Joined: 11 Mar 2012
Posts: 17

PostPosted: 25 Sep 2017 8:27    Post subject: How to transfer a domain int_List to a Visual Prolog 7.5 in C ++? Reply with quote

How to transfer a domain int_List to a Visual Prolog 7.5 in C ++?

domains
    int_List =node(integer,int_List);nil().
    fnak_addKZ_Robot=(string Kz ,int_list Nodes) -> integer procedure language stdcall.

This structure int_list in C++ not equivalent Visual Prolog 7.5.

typedef struct node {

unsigned char func ;
int val;
struct node *next;
} int_list;

int fnak_addKZ_Robot(wchar_t *kz ,int_list nodes);
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 25 Sep 2017 20:39    Post subject: Reply with quote

See Functor Domain Layout.

There are no functors in the node's and the empty list is represented by the pointer value 1. It can be declared like this:

typedef struct node *int_list;


struct node {
int head;
int_list tail;
};

const int_list empty = (int_list)1;


Also remember the __stdcall in the function declaration:

extern "C" {

int __stdcall fnak_addKZ_Robot(wchar_t *kz, int_list nodes) {
if (empty == nodes) {
...
} else {
...
}
}
}

_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
alex63




Joined: 11 Mar 2012
Posts: 17

PostPosted: 26 Sep 2017 19:37    Post subject: Reply with quote

It helped. Thank you. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum