]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/alien/syntax/syntax-docs.factor
rename current string-mangling "char*" to "c-string". char* is now just a boring...
[factor.git] / basis / alien / syntax / syntax-docs.factor
index 8ec67d2f65682cbdb009d09470083f89c6bc4bc6..3d1c757035658b79a07cc58bc669ae88a1c1bb23 100644 (file)
@@ -40,11 +40,11 @@ $nl
 }
 "You can define a word for invoking it:"
 { $unchecked-example
-    "LIBRARY: foo\nFUNCTION: void the_answer ( char* question, int value ) ;"
-    "USE: compiler"
+    "LIBRARY: foo\nFUNCTION: void the_answer ( c-string question, int value ) ;"
     "\"the question\" 42 the_answer"
     "The answer to the question is 42."
 } }
+"Using the " { $link c-string } " type instead of " { $snippet "char*" } " causes the FFI to automatically convert Factor strings to C strings. See " { $link "c-strings" } " for more information on using strings with the FFI."
 { $notes "Note that the parentheses and commas are only syntax sugar and can be omitted; they serve no purpose other than to make the declaration slightly easier to read:"
 { $code
     "FUNCTION: void glHint ( GLenum target, GLenum mode ) ;"