- Cface::SmalltalkXGenerator
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 17 Sep 2012 20:24:44 +0000
changeset 29 91d5e0a30fa4
parent 28 6a2e82ddbca1
child 30 00a634ebfc34
- Cface::SmalltalkXGenerator changed: #visitCEnumNode: #visitCStructuredNode: - Cface::Libgit2Mapping added: #smalltalkCategoryForEnum: #smalltalkCategoryForStruct: changed: #smalltalkCategoryForDerivedType: #smalltalkClassNameForEnum: #smalltalkClassNameForStruct: - extensions ...
Cface__Libgit2Mapping.st
Cface__SmalltalkXGenerator.st
bmake.bat
cface.rc
lccmake.bat
mingwmake.bat
vcmake.bat
--- a/Cface__Libgit2Mapping.st	Mon Sep 10 10:23:27 2012 +0000
+++ b/Cface__Libgit2Mapping.st	Mon Sep 17 20:24:44 2012 +0000
@@ -48,24 +48,51 @@
     (className notNil and:[(class := Smalltalk at: className) notNil]) ifTrue:[
         ^class category
     ].
-    ^'Git-Support-libgit2'
+    ^'Git-Internal-Handles'
 
     "Created: / 05-09-2012 / 11:15:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalltalkCategoryForEnum: enum
+    ^'Git-Internal-Constants'
+
+    "Created: / 17-09-2012 / 19:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+smalltalkCategoryForStruct:struct 
+
+    ^struct cByteSize == 0 ifTrue:[
+        'Git-Internal-Handles'
+    ] ifFalse:[
+        'Git-Internal-Structures'
+    ]
+
+    "Created: / 17-09-2012 / 19:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !Libgit2Mapping methodsFor:'mapping - class names'!
 
 smalltalkClassNameForEnum:cEnum
 
+    | baseName |
     cEnum cName = 'git_otype' ifTrue:[
         ^#GitObjectType
     ].
 
     cEnum cName = 'git_error_t' ifTrue:[
-        ^#GitErrorCode
+        ^#GitErrorKlass
     ].
 
-    ^ self smalltalkClassNameForDerivedType:cEnum
+    baseName := self smalltalkClassNameForDerivedType:cEnum.
+    baseName last = $T ifTrue:[
+        baseName := baseName allButLast.
+    ].
+    (baseName endsWith: 'Type') ifFalse:[
+        baseName := baseName , 'Type'.
+    ].
+    ^baseName
+
+
 
     "Answers class which should contain function call"
 
@@ -81,15 +108,21 @@
 !
 
 smalltalkClassNameForStruct:cStruct
+
+    | baseName |
     
     "Make GitOid a pure byte array to reduce stress on GC"
     cStruct cName = '_git_oid' ifTrue:[
         cStruct ffiPointerTypeSymbol:#charPointer.
     ].
 
-    ^ self smalltalkClassNameForDerivedType:cStruct
+    baseName := self smalltalkClassNameForDerivedType:cStruct.
 
-    "Answers class which should contain function call"
+    ^ cStruct cByteSize == 0 ifTrue:[
+        (baseName , 'Handle') asSymbol
+    ] ifFalse:[
+        (baseName , 'Structure') asSymbol
+    ]
 
     "Created: / 10-09-2012 / 10:31:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
--- a/Cface__SmalltalkXGenerator.st	Mon Sep 10 10:23:27 2012 +0000
+++ b/Cface__SmalltalkXGenerator.st	Mon Sep 17 20:24:44 2012 +0000
@@ -200,7 +200,7 @@
                 cEnumNode values do:
                     [:cEnumValueNode|
                     s 
-                        tab; 
+                        tab4; 
                         nextPutAll: cEnumValueNode smalltalkName;
                         nextPutAll: ' := ';
                         nextPutAll: cEnumValueNode intValue;
@@ -219,11 +219,11 @@
                 (String streamContents:
                     [:s|
                     s nextPutAll: cEnumValueNode smalltalkName; cr; cr.
-                    s tab; nextPut:$^; nextPutAll: cEnumValueNode smalltalkName])]
+                    s tab4; nextPut:$^; nextPutAll: cEnumValueNode smalltalkName])]
 
     "Created: / 03-07-2008 / 20:10:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 22-02-2009 / 15:03:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 30-05-2012 / 21:50:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-09-2012 / 19:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitCFunctionNode:functionNode
@@ -275,7 +275,9 @@
         ifNil:
             [(changeset add: (cdc := ClassDefinitionChange new))
                 superClassName: 
-                    ExternalStructure fullName;
+                    (cStructNode byteSize == 0 
+                        ifTrue:[ExternalAddress fullName]
+                        ifFalse:[ExternalStructure fullName]);
                 nameSpaceName: 
                     cStructNode smalltalkNamespace;
                 className: 
@@ -309,7 +311,7 @@
 
     "Created: / 10-07-2008 / 08:46:12 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 22-02-2009 / 15:05:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 07-09-2012 / 23:15:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-09-2012 / 19:20:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitCTypedefNode: typedefNode
--- a/bmake.bat	Mon Sep 10 10:23:27 2012 +0000
+++ b/bmake.bat	Mon Sep 17 20:24:44 2012 +0000
@@ -1,5 +1,5 @@
 @REM -------
-@REM make using borland bcc
+@REM make using Borland bcc32
 @REM type bmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
--- a/cface.rc	Mon Sep 10 10:23:27 2012 +0000
+++ b/cface.rc	Mon Sep 17 20:24:44 2012 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright 2008 Jan Vrany\0"
       VALUE "ProductName", "CairoGraphics\0"
       VALUE "ProductVersion", "6.2.3.1\0"
-      VALUE "ProductDate", "Mon, 10 Sep 2012 10:23:31 GMT\0"
+      VALUE "ProductDate", "Mon, 17 Sep 2012 20:25:26 GMT\0"
     END
 
   END
--- a/lccmake.bat	Mon Sep 10 10:23:27 2012 +0000
+++ b/lccmake.bat	Mon Sep 17 20:24:44 2012 +0000
@@ -3,6 +3,6 @@
 @REM type lccmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
-make.exe -N -f bc.mak USELCC=1 %1 %2
+make.exe -N -f bc.mak USELCC=1 %*
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mingwmake.bat	Mon Sep 17 20:24:44 2012 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using mingw gnu compiler
+@REM type mingwmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USEMINGW=1 %*
+
+
--- a/vcmake.bat	Mon Sep 10 10:23:27 2012 +0000
+++ b/vcmake.bat	Mon Sep 17 20:24:44 2012 +0000
@@ -1,11 +1,11 @@
 @REM -------
-@REM make using microsoft visual c
+@REM make using Microsoft Visual C compiler
 @REM type vcmake, and wait...
 @REM do not edit - automatically generated from ProjectDefinition
 @REM -------
 
 @if not defined VSINSTALLDIR (
-	call "C:\Program Files\Microsoft Visual Studio 10.0"\VC\bin\vcvars32.bat
+    call ..\..\..\stx\rules\vcsetup.bat
 )
 make.exe -N -f bc.mak -DUSEVC %*