문제

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?

도움이 되었습니까?

해결책

as the link states

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

worked for me a few years ago

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top