[mercury-users] converting char* to terms

ingenuit at at ingenuity-sw.com
Tue Sep 15 03:39:47 AEST 1998


I have a similar problem:  perhaps you can suggest an answer:

How to use a c_code returned char* as a term?

With help from the mailing list, I have linked in a C function
which returns a char* to a (possibly long) string.  The string
is guaranteed to be a correctly formed Mercury term.  

(If I write this
string to a file then io__read will successfully read a ground term.)

The compiler desperately wants this char* to be a string.  
It *is* a compound term with functor and args.  

1) Is there any way to directly to get Mercury to use a 
"C" return of char* as a term and not a string?

2) Is there any way to make Mercury use a string as a buffered stream
so that preds that read from a stream can be used on the string,
instead? 

3) What is the upper size limit on a Mercury string, if any?

Thanks,

Ann Tecklenburg



More information about the users mailing list