ExternalFunction.st
changeset 8534 dcb1cbd43198
parent 7665 18f5805b3920
child 8594 272976291af7
--- a/ExternalFunction.st	Fri Sep 10 14:00:17 2004 +0200
+++ b/ExternalFunction.st	Fri Sep 10 14:04:29 2004 +0200
@@ -35,7 +35,7 @@
  * CAVEAT: floats are not allowed.
  */
 INT
-convertST_to_C(stObj) 
+convertST_to_C(stObj)
     OBJ stObj;
 {
 	INT flags, nInst;
@@ -111,7 +111,7 @@
 	return 0;
 }
 
-%}   
+%}
 ! !
 
 !ExternalFunction class methodsFor:'documentation'!
@@ -134,9 +134,9 @@
 "
     Instances of this class represent external (non-Smalltalk) functions.
 
-    Also, the class provides access to custom functions 
-    These custom functions enable you to call c functions 
-    even if no stc compiler is available 
+    Also, the class provides access to custom functions
+    These custom functions enable you to call c functions
+    even if no stc compiler is available
     (they are kind of what user-primitives are in ST-80).
     You can register your own custom C-functions in a private main.c
     and relink ST/X from the binaries.
@@ -145,10 +145,10 @@
     If you have the stc compiler, we recommend using inline primitive
     code: its much easier to enter, compile, debug and maintain.
     (especially, to maintain, since the primitive code is contained
-     in the classes source/object file - while custom functions are 
+     in the classes source/object file - while custom functions are
      external to the classLibraries).
 
-    Non custom externalFunctions are created, when a non-ST shared library is loaded, 
+    Non custom externalFunctions are created, when a non-ST shared library is loaded,
     and returned by the ObjectFileHandles>>getFunction: method.
 
     The C functions contained in that lib are callable (instances of myself)
@@ -176,13 +176,13 @@
 
     Notice, that no doubles can be passed; the reason is that the calling
     conventions (on stack, in registers, in FPU registers etc.) are so different among
-    machines (and even compilers), that a general solution is not possible (difficult) 
+    machines (and even compilers), that a general solution is not possible (difficult)
     to program here. To pass doubles, either use shortFloats, or pack them into a DoubleArray.
     For functions with up to 2 double arguments, specialized call methods are provided.
     Sorry for that inconvenience.
-    
+
 
-    - This is still in construction and NOT yet published for 
+    - This is still in construction and NOT yet published for
       general use. For now, either use inline C-code, or use the customFunction call
       mechanism.
 
@@ -208,7 +208,7 @@
 	f := handle getFunction:'function1'.
 
     call it:
-        
+
 	f callWith:999
 "
 ! !
@@ -245,7 +245,7 @@
 
     "
      ExternalFunction callCustomFunction:0
-     ExternalFunction callCustomFunction:999 
+     ExternalFunction callCustomFunction:999
     "
 
     "Modified: 22.4.1996 / 18:06:52 / cg"
@@ -278,7 +278,7 @@
 callCustomFunction:nr with:arg1 with:arg2 with:arg3
     "call the custom function #nr with three arguments"
 
-    ^ self callCustomFunction:nr 
+    ^ self callCustomFunction:nr
 		withArguments:(Array with:arg1 with:arg2 with:arg3)
 
     "Modified: 22.4.1996 / 18:07:18 / cg"
@@ -385,8 +385,8 @@
     ^ nil
 
     "
-     ExternalFunction indexOfCustomFunctionNamed:'demoFunction0'  
-     ExternalFunction indexOfCustomFunctionNamed:'fooBar' 
+     ExternalFunction indexOfCustomFunctionNamed:'demoFunction0'
+     ExternalFunction indexOfCustomFunctionNamed:'fooBar'
     "
 ! !
 
@@ -420,7 +420,7 @@
 
 call
     "call the underlying C function, passing no argument.
-     The return value is interpreted as an integer 
+     The return value is interpreted as an integer
      (and must be converted to an externalBytes object,
       if it is a pointer to something).
 
@@ -462,7 +462,7 @@
 
 callOWith:arg
     "call the underlying C function, passing a single object argument.
-     The return value must be a valid object. 
+     The return value must be a valid object.
 
      DANGER alert: This is an unprotected low-level entry.
      Not for normal application usage.
@@ -482,7 +482,7 @@
 
 callOWith:arg1 with:arg2
     "call the underlying C function, passing two args.
-     The return value must be a valid object. 
+     The return value must be a valid object.
 
      DANGER alert: This is an unprotected low-level entry.
      Not for normal application usage.
@@ -502,7 +502,7 @@
 
 callOWith:arg1 with:arg2 with:arg3
     "call the underlying C function, passing three args.
-     The return value must be a valid object. 
+     The return value must be a valid object.
 
      DANGER alert: This is an unprotected low-level entry.
      Not for normal application usage.
@@ -524,7 +524,7 @@
     "call the underlying C function, passing a single argument.
      The argument arg is converted to a corresponding C data type,
      as defined in the convertST_to_C() function.
-     The return value is interpreted as an integer 
+     The return value is interpreted as an integer
      (and must be converted to an externalBytes object,
       if it is a pointer to something).
 
@@ -548,7 +548,7 @@
     "call the underlying C function, passing two args.
      The arguments are converted to a corresponding C data type,
      as defined in the convertST_to_C() function.
-     The return value is interpreted as an integer 
+     The return value is interpreted as an integer
      (and must be converted to an externalBytes object,
       if it is a pointer to something).
 
@@ -572,7 +572,7 @@
     "call the underlying C function, passing three args.
      The arguments are converted to a corresponding C data type,
      as defined in the convertST_to_C() function.
-     The return value is interpreted as an integer 
+     The return value is interpreted as an integer
      (and must be converted to an externalBytes object,
       if it is a pointer to something).
 
@@ -596,7 +596,7 @@
     "call the underlying C function, passing up to 10 arguments.
      The arguments are converted to a corresponding C data type,
      as defined in the convertST_to_C() function.
-     The return value is interpreted as an integer 
+     The return value is interpreted as an integer
      (and must be converted to an externalBytes object,
       if it is a pointer to something).
 
@@ -768,7 +768,7 @@
     ].
 
     moduleHandle notNil ifTrue:[
-	aStream nextPutAll:' from: '''; 
+	aStream nextPutAll:' from: ''';
 		nextPutAll:(moduleHandle pathName asFilename baseName);
 		nextPutAll:''''.
     ].
@@ -791,7 +791,7 @@
 !ExternalFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalFunction.st,v 1.20 2003-10-14 10:32:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalFunction.st,v 1.21 2004-09-10 12:04:29 cg Exp $'
 ! !
 
 ExternalFunction initialize!