0

Question. When using external libraries, is there the same pointer! in Rebol2 as there is in Red/System?

If the c declaration were:

void f (int* i);

How would I define the routine!?

f: make routine! [
    "Does Something"
    int [pointer! [integer!]]
    return: [char!]
] lib "f"

I see http://rebol.com/docs/library.html#section-25

"External library functions that are passed pointers, generally expect the pointers to be char or void datatypes. Currently, REBOL routines do not support the void datatype. In most cases, you can safely pass char instead of void. For return values, use long instead of void."

However, just a little confused. What is the correct way to define the routine for f?

4

1 回答 1

2

如链接所述

f: make routine! [
  "Does Something"
  pInt [char*]
  return: [long]
] lib "f"  

几年前为我工作

于 2014-02-03T13:22:10.060 回答