memmove documentation?

I am trying to update a 10 years old RB project and so far everything works nicely, except for an older PDF library, but just under macOS 64 Bit.
I found it uses an old Carbon declare: “BlockMove”, and the replacement for that should be kernel‘s memmove.

Which gives me a segmentation fault when I try to invoke it. This method is undocumented in a way that I cannot tell who‘s target and who‘s destination:

void * memmove(void *, const void *, size_t);

Anyone got more information on this?

BTW, I am simply amazed a RB app from 2008 can be converted so easily. HiDPI was simply the switch of a button, and if it were not for the PDF library (which I would not like to replace because of all the hand-encoded reports building on it), 64 Bit would have been too.
Therefore, clearly the right decision to kill the Xojo framework in favour of API 2.0. Although I liked it – updating an old project to it meant much more work.

I know it’s not what you asked, but when faced with the same choice, we opted to replace our in-house PDF plugin by generating our reports in Word using a library originally written by @Jeremy Cowgar (which I think is now public), then “printing” that to pdf via the command line. That actually simplified our report creation process.


Did you try “man memmove” in terminal?

MEMMOVE(3)               BSD Library Functions Manual               MEMMOVE(3)

     memmove -- copy byte string

     Standard C Library (libc, -lc)

     #include <string.h>

     void *
     memmove(void *dst, const void *src, size_t len);

     The memmove() function copies len bytes from string src to string dst.
     The two strings may overlap; the copy is always done in a non-destructive

     The memmove() function returns the original value of dst.

     bcopy(3), memccpy(3), memcpy(3), strcpy(3), wmemmove(3)

     The memmove() function conforms to ISO/IEC 9899:1990 (``ISO C90'').

BSD                              June 4, 1993                              BSD

that translate to

declare sub memmove Lib "system" (ByRef dst as CString, ByRef src as CString, slen as integer)

I don’t think you can do a lot of good things with BlockMove/memmove declare.

If your pointers/ parameters are wrong, it’ll crash the app.
In Xojo you better use memory blocks.

Thanks all!
@Christian: It is part of the old PDF classes by Asher Urden which were modernized by Bob Keeney. They use a Memoryblock for fast string handling in combination with memory move declares targeting this mb (for all 3 desktop platforms).
According to the notes written 2003 by Charles Yeomans.
I‘d really love to use DynaPDF but there‘s simply too many reports which I do not want to modify, at least for now. I will do on a later iteration.

I had to change the internal pointer handling and am pretty amazed it now runs. At least on Windows and macOS which is enough for this purpose (did not test Linux). I‘ll forward the results to Bob in case someone should run into the same problem.

Then for using with MemoryBlock better you change the declare as:

declare function memmove Lib "system" (dst as Ptr, src as Ptr, slen as integer) as Ptr