File: Strings_Cstring_Impl.f

package info (click to toggle)
babel 0.10.2-1
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 43,932 kB
  • ctags: 29,707
  • sloc: java: 74,695; ansic: 73,142; cpp: 40,649; sh: 18,411; f90: 10,062; fortran: 6,727; python: 6,406; makefile: 3,866; xml: 118; perl: 48
file content (257 lines) | stat: -rw-r--r-- 6,923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
C       
C       File:          Strings_Cstring_Impl.f
C       Symbol:        Strings.Cstring-v1.1
C       Symbol Type:   class
C       Babel Version: 0.10.2
C       Description:   Server-side implementation for Strings.Cstring
C       
C       WARNING: Automatically generated; only changes within splicers preserved
C       
C       babel-version = 0.10.2
C       


C       
C       Symbol "Strings.Cstring" (version 1.1)
C       
C       Class to allow testing of string passing using every possible mode.
C       


C       DO-NOT-DELETE splicer.begin(_miscellaneous_code_start)
C       Insert extra code here...
C       DO-NOT-DELETE splicer.end(_miscellaneous_code_start)




C       
C       Class constructor called when the class is created.
C       

        subroutine Strings_Cstring__ctor_fi(self)
        implicit none
C       in Strings.Cstring self
        integer*8 self

C       DO-NOT-DELETE splicer.begin(Strings.Cstring._ctor)
C       Insert the implementation here...
C       DO-NOT-DELETE splicer.end(Strings.Cstring._ctor)
        end


C       
C       Class destructor called when the class is deleted.
C       

        subroutine Strings_Cstring__dtor_fi(self)
        implicit none
C       in Strings.Cstring self
        integer*8 self

C       DO-NOT-DELETE splicer.begin(Strings.Cstring._dtor)
C       Insert the implementation here...
C       DO-NOT-DELETE splicer.end(Strings.Cstring._dtor)
        end


C       
C       Static class initializer called exactly once before any user-defined method is dispatched
C       

        subroutine Strings_Cstring__load_fi()
        implicit none

C       DO-NOT-DELETE splicer.begin(Strings.Cstring._load)
C       Insert the implementation here...
C       DO-NOT-DELETE splicer.end(Strings.Cstring._load)
        end


C       
C       If <code>nonNull</code> is <code>true</code>, this will
C       return "Three"; otherwise, it will return a NULL or empty string.
C       

        subroutine Strings_Cstring_returnback_fi(self, nonNull, retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       in bool nonNull
        logical nonNull
C       out string retval
        character*(*) retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.returnback)
        if (nonNull) then
           retval = 'Three'
        else
           retval = ''
        endif
C       DO-NOT-DELETE splicer.end(Strings.Cstring.returnback)
        end


C       
C       This will return <code>true</code> iff <code>c</code> equals "Three".
C       

        subroutine Strings_Cstring_passin_fi(self, c, retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       in string c
        character*(*) c
C       out bool retval
        logical retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.passin)
        retval = (c .eq. 'Three')
C       DO-NOT-DELETE splicer.end(Strings.Cstring.passin)
        end


C       
C       If <code>nonNull</code> is <code>true</code>, this will return
C       "Three" in <code>c</code>; otherwise, it will return a null or
C       empty string. The return value is <code>false</code> iff 
C       the outgoing value of <code>c</code> is <code>null</code>.
C       

        subroutine Strings_Cstring_passout_fi(self, nonNull, c, retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       in bool nonNull
        logical nonNull
C       out string c
        character*(*) c
C       out bool retval
        logical retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.passout)
        if (nonNull) then
           c = 'Three'
           retval = .true.
        else
           c = ''
           retval = .false.
        endif
C       DO-NOT-DELETE splicer.end(Strings.Cstring.passout)
        end


C       
C       Method:  passinout[]
C       

        subroutine Strings_Cstring_passinout_fi(self, c, retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       inout string c
        character*(*) c
C       out bool retval
        logical retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.passinout)
        integer i
        retval = .false.
        if (len(c) .ge. 1) then
           do i = len(c), 1, -1
              if (c(i:i) .ne. ' ') then
                 if (i .lt. len(c)) then
                    c(i+1:i+1) = 's'
                    retval = .true.
                 endif
                 goto 100
              endif
           end do
 100       if (c(1:1) .ge. 'a' .and. c(1:1) .le. 'z') then
              c(1:1) = char(ichar(c(1:1)) - 32)
           else
              if (c(1:1) .ge. 'A' .and. c(1:1) .le. 'Z') then
                 c(1:1) = char(ichar(c(1:1)) + 32)
              endif
           endif
        else
           retval = .false.
        endif
C       DO-NOT-DELETE splicer.end(Strings.Cstring.passinout)
        end


C       
C       Method:  passeverywhere[]
C       

        subroutine Strings_Cstring_passeverywhere_fi(self, c1, c2, c3,
     &     retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       in string c1
        character*(*) c1
C       out string c2
        character*(*) c2
C       inout string c3
        character*(*) c3
C       out string retval
        character*(*) retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.passeverywhere)
        integer i
        c2 = 'Three'
        if (c1 .eq. 'Three') then
           retval = 'Three'
        else
           retval = ''
        endif
        if (len(c3) .ge. 1) then
           do i = len(c3), 1, -1
              if (c3(i:i) .ne. ' ') then
                 c3(i:i) = ' '
                 goto 100
              endif
           end do
 100       if (c3(1:1) .ge. 'a' .and. c3(1:1) .le. 'z') then
              c3(1:1) = char(ichar(c3(1:1)) - 32)
           else
              if (c3(1:1) .ge. 'A' .and. c3(1:1) .le. 'Z') then
                 c3(1:1) = char(ichar(c3(1:1)) + 32)
              endif
           endif
        endif
C       DO-NOT-DELETE splicer.end(Strings.Cstring.passeverywhere)
        end


C       
C       Method:  mixedarguments[]
C       

        subroutine Strings_Cstring_mixedarguments_fi(self, s1, c1, s2,
     &     c2, retval)
        implicit none
C       in Strings.Cstring self
        integer*8 self
C       in string s1
        character*(*) s1
C       in char c1
        character c1
C       in string s2
        character*(*) s2
C       in char c2
        character c2
C       out bool retval
        logical retval

C       DO-NOT-DELETE splicer.begin(Strings.Cstring.mixedarguments)
        retval = ((c1 .eq. c2) .and. (s1 .eq. s2))
C       DO-NOT-DELETE splicer.end(Strings.Cstring.mixedarguments)
        end


C       DO-NOT-DELETE splicer.begin(_miscellaneous_code_end)
C       Insert extra code here...
C       DO-NOT-DELETE splicer.end(_miscellaneous_code_end)