author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 10 Sep 2012 10:23:27 +0000 | |
changeset 28 | 6a2e82ddbca1 |
parent 27 | 5a58064b5921 |
child 29 | 91d5e0a30fa4 |
permissions | -rw-r--r-- |
22 | 1 |
"{ Package: 'cvut:fel/cface' }" |
2 |
||
3 |
"{ NameSpace: Cface }" |
|
4 |
||
5 |
TypeMapping subclass:#Libgit2Mapping |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Cface-Mappings' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!Libgit2Mapping methodsFor:'accessing'! |
|
14 |
||
15 |
smalltalkNameForEnumValue:cEnumFieldType |
|
16 |
|cairoName| |
|
17 |
||
18 |
cairoName := cEnumFieldType cName. |
|
19 |
(cairoName startsWith:'GIT_') ifTrue:[ |
|
20 |
cairoName := cairoName copyFrom:5 |
|
21 |
]. |
|
22 |
^ cairoName asSymbol |
|
23 |
||
24 |
" |
|
25 |
Cface::CairoMapping new |
|
26 |
smalltalkNameForEnumValue:(Cface::CEnumValueNode new cName:'CAIRO_FONT_TYPE_TOY') |
|
27 |
||
28 |
" |
|
29 |
||
30 |
"Created: / 04-07-2008 / 11:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
31 |
"Modified: / 04-09-2012 / 16:02:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
32 |
! |
|
33 |
||
34 |
smalltalkPackage |
|
35 |
||
36 |
^#'stx:libgit' |
|
37 |
||
38 |
"Created: / 03-07-2008 / 21:14:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
39 |
"Modified: / 04-09-2012 / 16:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
40 |
! ! |
|
41 |
||
24 | 42 |
!Libgit2Mapping methodsFor:'mapping - categories'! |
43 |
||
26 | 44 |
smalltalkCategoryForDerivedType:cType |
45 |
| className class | |
|
24 | 46 |
|
26 | 47 |
className := cType smalltalkName asSymbol. |
48 |
(className notNil and:[(class := Smalltalk at: className) notNil]) ifTrue:[ |
|
49 |
^class category |
|
50 |
]. |
|
51 |
^'Git-Support-libgit2' |
|
24 | 52 |
|
53 |
"Created: / 05-09-2012 / 11:15:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
54 |
! ! |
|
55 |
||
26 | 56 |
!Libgit2Mapping methodsFor:'mapping - class names'! |
57 |
||
28
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
58 |
smalltalkClassNameForEnum:cEnum |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
59 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
60 |
cEnum cName = 'git_otype' ifTrue:[ |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
61 |
^#GitObjectType |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
62 |
]. |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
63 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
64 |
cEnum cName = 'git_error_t' ifTrue:[ |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
65 |
^#GitErrorCode |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
66 |
]. |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
67 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
68 |
^ self smalltalkClassNameForDerivedType:cEnum |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
69 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
70 |
"Answers class which should contain function call" |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
71 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
72 |
"Created: / 10-09-2012 / 09:30:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
73 |
! |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
74 |
|
26 | 75 |
smalltalkClassNameForFunction:cFunction |
76 |
"Answers class which should contain function call" |
|
77 |
||
78 |
^#GitPrimitives |
|
79 |
||
80 |
"Created: / 07-09-2012 / 15:04:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
28
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
81 |
! |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
82 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
83 |
smalltalkClassNameForStruct:cStruct |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
84 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
85 |
"Make GitOid a pure byte array to reduce stress on GC" |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
86 |
cStruct cName = '_git_oid' ifTrue:[ |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
87 |
cStruct ffiPointerTypeSymbol:#charPointer. |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
88 |
]. |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
89 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
90 |
^ self smalltalkClassNameForDerivedType:cStruct |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
91 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
92 |
"Answers class which should contain function call" |
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
93 |
|
6a2e82ddbca1
- Updates to latest GCC XML that apparently reports structure sizes in bits instead of bytes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
94 |
"Created: / 10-09-2012 / 10:31:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
26 | 95 |
! ! |
96 |
||
27 | 97 |
!Libgit2Mapping methodsFor:'mapping - selectors'! |
98 |
||
99 |
smalltalkSelectorForFunction:cFunction |
|
100 |
| selector | |
|
101 |
||
102 |
selector := String streamContents:[:s| |
|
103 |
s nextPutAll: '_'. |
|
104 |
s nextPutAll: cFunction cName. |
|
105 |
||
106 |
cFunction arguments size > 0 ifTrue: |
|
107 |
[s nextPut:$:]. |
|
108 |
cFunction arguments size > 1 ifTrue: |
|
109 |
[(cFunction arguments copyFrom:2) do: |
|
110 |
[:argument| |
|
111 |
s |
|
112 |
nextPutAll: ("self smalltalkize: "argument cName); |
|
113 |
nextPut:$:]]]. |
|
114 |
||
115 |
^selector asSymbol |
|
116 |
||
117 |
"Created: / 07-09-2012 / 23:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! ! |
|
119 |
||
22 | 120 |
!Libgit2Mapping class methodsFor:'documentation'! |
121 |
||
122 |
version_SVN |
|
123 |
^ '$Id:: $' |
|
124 |
! ! |