ThreadContextStubs.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX API support */
40 /* */
41 /* Stub functions for all APIs accessed via the NativeMethodContext */
42 /* */
43 /******************************************************************************/
44 
45 #include "RexxCore.h"
46 #include "ContextApi.hpp"
47 #include "RexxActivity.hpp"
48 #include "StringClass.hpp"
49 #include "IntegerClass.hpp"
50 #include "BufferClass.hpp"
51 #include "SupplierClass.hpp"
52 #include "ArrayClass.hpp"
53 #include "DirectoryClass.hpp"
54 #include "MethodClass.hpp"
55 #include "RoutineClass.hpp"
56 #include "PackageClass.hpp"
57 #include "Interpreter.hpp"
58 #include "InterpreterInstance.hpp"
59 #include "SystemInterpreter.hpp"
60 #include "PointerClass.hpp"
61 #include "ActivityManager.hpp"
62 #include "RexxStartDispatcher.hpp"
63 #include "PackageManager.hpp"
64 #include "MutableBufferClass.hpp"
65 
67 
69 {
70  // we do this one without grabbing the lock because we're going away.
71  ApiContext context(c, false);
72  try
73  {
74  context.activity->detachThread();
75  }
76  catch (RexxNativeActivation *)
77  {
78  }
79 }
80 
81 
82 /**
83  * API stub for raising a halt condition on a thread.
84  */
86 {
87  ApiContext context(c);
88  try
89  {
90  context.activity->halt(OREF_NULL);
91  }
92  catch (RexxNativeActivation *)
93  {
94  }
95 }
96 
97 
99 {
100  ApiContext context(c);
101  try
102  {
103  context.activity->setTrace(setting != 0);
104  }
105  catch (RexxNativeActivation *)
106  {
107  }
108 }
109 
110 
112 {
113  ApiContext context(c);
114  try
115  {
117  return o;
118  }
119  catch (RexxNativeActivation *)
120  {
121  }
122  return NULLOBJECT;
123 }
124 
125 
127 {
128  ApiContext context(c);
129  try
130  {
132  }
133  catch (RexxNativeActivation *)
134  {
135  }
136 }
137 
138 
140 {
141  ApiContext context(c);
142  try
143  {
144  context.context->removeLocalReference((RexxObject *)o);
145  }
146  catch (RexxNativeActivation *)
147  {
148  }
149 }
150 
151 //NB: The name "SendMessage" has a conflict with a Windows API, so this name differs from
152 // the call vector version.
154 {
155  ApiContext context(c);
156  try
157  {
158  RexxString *message = new_upper_string(m);
159  ProtectedObject p(message);
160 
161  return context.ret(((RexxObject *)o)->sendMessage(message, (RexxArray *)a));
162  }
163  catch (RexxNativeActivation *)
164  {
165  }
166  return NULLOBJECT;
167 }
168 
169 
171 {
172  ApiContext context(c);
173  try
174  {
175  RexxString *message = new_upper_string(m);
176  ProtectedObject p(message);
177  return context.ret(((RexxObject *)o)->sendMessage(message));
178  }
179  catch (RexxNativeActivation *)
180  {
181  }
182  return NULLOBJECT;
183 }
184 
185 
187 {
188  ApiContext context(c);
189  try
190  {
191  RexxString *message = new_upper_string(m);
192  ProtectedObject p(message);
193  return context.ret(((RexxObject *)o)->sendMessage(message, (RexxObject *)a1));
194  }
195  catch (RexxNativeActivation *)
196  {
197  }
198  return NULLOBJECT;
199 }
200 
202 {
203  ApiContext context(c);
204  try
205  {
206  RexxString *message = new_upper_string(m);
207  ProtectedObject p(message);
208  return context.ret(((RexxObject *)o)->sendMessage(message, (RexxObject *)a1, (RexxObject *)a2));
209  }
210  catch (RexxNativeActivation *)
211  {
212  }
213  return NULLOBJECT;
214 }
215 
217 {
218  ApiContext context(c);
219  try
220  {
221  return (RexxDirectoryObject)context.activity->getLocal();
222  }
223  catch (RexxNativeActivation *)
224  {
225  }
226  return NULLOBJECT;
227 }
228 
230 {
231  ApiContext context(c);
232  try
233  {
235  }
236  catch (RexxNativeActivation *)
237  {
238 
239  }
240  return NULLOBJECT;
241 }
242 
244 {
245  ApiContext context(c);
246  try
247  {
248  return ((RexxObject *)o)->isInstanceOf((RexxClass *)cl);
249  }
250  catch (RexxNativeActivation *)
251  {
252  }
253  return 0;
254 }
255 
257 {
258  ApiContext context(c);
259  try
260  {
261  // convert the name to a string instance, and get the class object from
262  // our current context
263  RexxString *name = new_upper_string(cn);
264  ProtectedObject p(name);
265  RexxClass *classObject = context.context->findClass(name);
266  // if not found, this is always false
267  if (classObject == OREF_NULL)
268  {
269  return false;
270  }
271  return ((RexxObject *)o)->isInstanceOf(classObject);
272  }
273  catch (RexxNativeActivation *)
274  {
275  }
276  return 0;
277 }
278 
279 
281 {
282  ApiContext context(c);
283  try
284  {
285  RexxString *name = new_upper_string(n);
286  ProtectedObject p(name);
287  // convert the name to a string instance, and check the environments.
288  return ((RexxObject *)o)->hasMethod(name) == TheTrueObject;
289 
290  }
291  catch (RexxNativeActivation *)
292  {
293  }
294  return 0;
295 }
296 
297 
299 {
300  ApiContext context(c);
301  try
302  {
303  RexxString *name = new_string(n);
304  ProtectedObject p(name);
305  RexxString *resolvedName = context.activity->getInstance()->resolveProgramName(name, OREF_NULL, OREF_NULL);
306 
307  // convert the name to a string instance, and check the environments.
308  return (RexxPackageObject)context.ret(context.activity->getInstance()->loadRequires(context.activity, name, resolvedName));
309  }
310  catch (RexxNativeActivation *)
311  {
312  }
313  return NULLOBJECT;
314 }
315 
316 
318 {
319  ApiContext context(c);
320  try
321  {
322  RexxString *name = new_string(n);
323  ProtectedObject p(name);
324  return (RexxPackageObject)context.ret(context.activity->getInstance()->loadRequires(context.activity, name, d, l));
325  }
326  catch (RexxNativeActivation *)
327  {
328  }
329  return NULLOBJECT;
330 }
331 
332 
334 {
335  ApiContext context(c);
336  try
337  {
338  RexxString *name = new_string(n);
339  ProtectedObject p(name);
340 
341  // convert the name to a string instance, and check the environments.
342  return PackageManager::loadLibrary(name) != OREF_NULL;
343  }
344  catch (RexxNativeActivation *)
345  {
346  }
347  return false;
348 }
349 
350 
352 {
353  ApiContext context(c);
354  try
355  {
356  RexxString *name = new_string(n);
357  ProtectedObject p(name);
358 
359  // convert the name to a string instance, and check the environments.
360  return PackageManager::registerPackage(name, e);
361  }
362  catch (RexxNativeActivation *)
363  {
364  }
365  return false;
366 }
367 
368 
370 {
371  ApiContext context(c);
372  try
373  {
374  // convert the name to a string instance, and check the environments.
375  RexxString *name = new_upper_string(n);
376  ProtectedObject p(name);
377  return (RexxClassObject)context.ret(context.context->findClass(name));
378 
379  }
380  catch (RexxNativeActivation *)
381  {
382  }
383  return NULLOBJECT;
384 }
385 
386 
388 {
389  ApiContext context(c);
390  try
391  {
392  // convert the name to a string instance, and check the environments.
393  RexxString *name = new_upper_string(n);
394  ProtectedObject p(name);
395  return (RexxClassObject)context.ret(((PackageClass *)m)->findClass(name));
396 
397  }
398  catch (RexxNativeActivation *)
399  {
400  }
401  return NULLOBJECT;
402 }
403 
404 
406 {
407  ApiContext context(c);
408  try
409  {
410  return (RexxDirectoryObject)context.ret(((PackageClass *)m)->getRoutines());
411  }
412  catch (RexxNativeActivation *)
413  {
414  }
415  return NULLOBJECT;
416 }
417 
418 
420 {
421  ApiContext context(c);
422  try
423  {
424  return (RexxDirectoryObject)context.ret(((PackageClass *)m)->getPublicRoutines());
425  }
426  catch (RexxNativeActivation *)
427  {
428  }
429  return NULLOBJECT;
430 }
431 
433 {
434  ApiContext context(c);
435  try
436  {
437  return (RexxDirectoryObject)context.ret(((PackageClass *)m)->getClasses());
438  }
439  catch (RexxNativeActivation *)
440  {
441  }
442  return NULLOBJECT;
443 }
444 
446 {
447  ApiContext context(c);
448  try
449  {
450  return (RexxDirectoryObject)context.ret(((PackageClass *)m)->getPublicClasses());
451  }
452  catch (RexxNativeActivation *)
453  {
454  }
455  return NULLOBJECT;
456 }
457 
459 {
460  ApiContext context(c);
461  try
462  {
463  return (RexxDirectoryObject)context.ret(((PackageClass *)m)->getClasses());
464  }
465  catch (RexxNativeActivation *)
466  {
467  }
468  return NULLOBJECT;
469 }
470 
471 
473 {
474  ApiContext context(c);
475  try
476  {
477  CallRoutineDispatcher dispatcher((RoutineClass *)r, (RexxArray *)a);
478  context.activity->run(dispatcher);
479  return (RexxObjectPtr)context.ret(dispatcher.result);
480  }
481  catch (RexxNativeActivation *)
482  {
483  }
484  return NULLOBJECT;
485 }
486 
487 
489 {
490  ApiContext context(c);
491  try
492  {
493  CallProgramDispatcher dispatcher(p, (RexxArray *)a);
494  context.activity->run(dispatcher);
495  return (RexxObjectPtr)context.ret(dispatcher.result);
496  }
497  catch (RexxNativeActivation *)
498  {
499  }
500  return NULLOBJECT;
501 }
502 
503 
505 {
506  ApiContext context(c);
507  try
508  {
509  RexxString *name = new_string(n);
510  ProtectedObject p(name);
511  // convert the name to a string instance, and check the environments.
512  return (RexxMethodObject)context.ret(new RexxMethod(new_string(n), source, length));
513  }
514  catch (RexxNativeActivation *)
515  {
516  }
517  return NULLOBJECT;
518 }
519 
520 
522 {
523  ApiContext context(c);
524  try
525  {
526  RexxString *name = new_string(n);
527  ProtectedObject p(name);
528  // convert the name to a string instance, and check the environments.
529  return (RexxRoutineObject)context.ret(new RoutineClass(name, source, length));
530  }
531  catch (RexxNativeActivation *)
532  {
533  }
534  return NULLOBJECT;
535 }
536 
537 
539 {
540  ApiContext context(c);
541  try
542  {
543  // convert the name to a string instance, and check the environments.
544  return (logical_t)((RexxObject *)o)->isInstanceOf(TheRoutineClass);
545  }
546  catch (RexxNativeActivation *)
547  {
548  }
549  return false;
550 }
551 
552 
554 {
555  ApiContext context(c);
556  try
557  {
558  // convert the name to a string instance, and check the environments.
559  return (logical_t)((RexxObject *)o)->isInstanceOf(TheMethodClass);
560  }
561  catch (RexxNativeActivation *)
562  {
563  }
564  return false;
565 }
566 
567 
569 {
570  ApiContext context(c);
571  try
572  {
573  // convert the name to a string instance, and check the environments.
574  return (RexxPackageObject)context.ret(((RoutineClass *)o)->getPackage());
575  }
576  catch (RexxNativeActivation *)
577  {
578  }
579  return NULLOBJECT;
580 }
581 
582 
584 {
585  ApiContext context(c);
586  try
587  {
588  // convert the name to a string instance, and check the environments.
589  return (RexxPackageObject)context.ret(((RexxMethod *)o)->getPackage());
590  }
591  catch (RexxNativeActivation *)
592  {
593  }
594  return NULLOBJECT;
595 }
596 
597 
599 {
600  ApiContext context(c);
601  try
602  {
603  // ask the object to figure this out
604  return ((RexxObject *)o)->getCSelf();
605  }
606  catch (RexxNativeActivation *)
607  {
608  }
609  return NULL;
610 }
611 
612 
614 {
615  ApiContext context(c);
616  try
617  {
618  // ask the object to figure this out
619  return ((RexxObject *)o)->getCSelf((RexxObject *)s);
620  }
621  catch (RexxNativeActivation *)
622  {
623  }
624  return NULL;
625 }
626 
627 
629 {
630  ApiContext context(c);
631  try
632  {
633  return context.ret(Numerics::wholenumberToObject((wholenumber_t)n));
634  }
635  catch (RexxNativeActivation *)
636  {
637  }
638  return NULLOBJECT;
639 }
640 
642 {
643  ApiContext context(c);
644  try
645  {
646  return context.ret(Numerics::uintptrToObject(n));
647  }
648  catch (RexxNativeActivation *)
649  {
650  }
651  return NULLOBJECT;
652 }
653 
655 {
656  ApiContext context(c);
657  try
658  {
659  return context.ret(Numerics::intptrToObject(n));
660  }
661  catch (RexxNativeActivation *)
662  {
663  }
664  return NULLOBJECT;
665 }
666 
667 
669 {
670  ApiContext context(c);
671  try
672  {
673  return (RexxObjectPtr)context.ret(context.context->valueToObject(d));
674  }
675  catch (RexxNativeActivation *)
676  {
678  }
679  return NULLOBJECT;
680 }
681 
682 
684 {
685  ApiContext context(c);
686  try
687  {
688  return (RexxArrayObject)context.ret(context.context->valuesToObject(d, count));
689  }
690  catch (RexxNativeActivation *)
691  {
693  }
694  return NULLOBJECT;
695 }
696 
697 
699 {
700  ApiContext context(c);
701  try
702  {
703  return context.context->objectToValue((RexxObject *)o, d);
704  }
705  catch (RexxNativeActivation *)
706  {
707  // some conversion failures result in an exception...cancel that, and
708  // just return FALSE;
710  }
711  return false;
712 }
713 
715 {
716  ApiContext context(c);
717  try
718  {
719  return context.ret(Numerics::stringsizeToObject((stringsize_t)n));
720  }
721  catch (RexxNativeActivation *)
722  {
723  }
724  return NULLOBJECT;
725 }
726 
727 
729 {
730  ApiContext context(c);
731  try
732  {
733  wholenumber_t temp;
734  // this uses the entire value range
735  // NB: SSIZE_MIN appears to be defined as 0 for some bizarre reason on some platforms,
736  // so we'll make things relative to SIZE_MAX.
738  {
739  *n = (wholenumber_t)temp;
740  return true;
741  }
742  return false;
743  }
744  catch (RexxNativeActivation *)
745  {
746  }
747  return 0;
748 }
749 
750 
752 {
753  ApiContext context(c);
754  try
755  {
756  return context.ret(Numerics::wholenumberToObject((wholenumber_t)n));
757  }
758  catch (RexxNativeActivation *)
759  {
760  }
761  return NULLOBJECT;
762 }
763 
764 
766 {
767  ApiContext context(c);
768  try
769  {
770  return context.ret(Numerics::stringsizeToObject((uint32_t)n));
771  }
772  catch (RexxNativeActivation *)
773  {
774  }
775  return NULLOBJECT;
776 }
777 
778 
780 {
781  ApiContext context(c);
782  try
783  {
784  stringsize_t temp;
785  // this uses the entire value range
787  {
788  *n = (stringsize_t)temp;
789  return true;
790  }
791  return false;
792  }
793  catch (RexxNativeActivation *)
794  {
795  }
796  return 0;
797 }
798 
799 
801 {
802  ApiContext context(c);
803  try
804  {
805  ssize_t temp;
806  // this uses the entire value range
807  // NB: SSIZE_MIN appears to be defined as 0 for some bizarre reason on some platforms,
808  // so we'll make things relative to SIZE_MAX.
810  {
811  *n = (int32_t)temp;
812  return true;
813  }
814  return false;
815  }
816  catch (RexxNativeActivation *)
817  {
818  }
819  return 0;
820 }
821 
822 
824 {
825  ApiContext context(c);
826  try
827  {
828  size_t temp;
829  // this uses the entire value range
831  {
832  *n = (uint32_t)temp;
833  return true;
834  }
835  return false;
836  }
837  catch (RexxNativeActivation *)
838  {
839  }
840  return 0;
841 }
842 
843 
845 {
846  ApiContext context(c);
847  try
848  {
849  return context.ret(Numerics::int64ToObject(n));
850  }
851  catch (RexxNativeActivation *)
852  {
853  }
854  return NULLOBJECT;
855 }
856 
858 {
859  ApiContext context(c);
860  try
861  {
862  return context.ret(Numerics::uint64ToObject(n));
863  }
864  catch (RexxNativeActivation *)
865  {
866  }
867  return NULLOBJECT;
868 }
869 
871 {
872  ApiContext context(c);
873  try
874  {
875  // this uses the entire value range
876  return Numerics::objectToInt64((RexxObject *)o, *n);
877  }
878  catch (RexxNativeActivation *)
879  {
880  }
881  return 0;
882 }
883 
885 {
886  ApiContext context(c);
887  try
888  {
889  // this uses the entire value range
891  }
892  catch (RexxNativeActivation *)
893  {
894  }
895  return 0;
896 }
897 
899 {
900  ApiContext context(c);
901  try
902  {
903  // this uses the entire value range
904  return Numerics::objectToUintptr((RexxObject *)o, *n);
905  }
906  catch (RexxNativeActivation *)
907  {
908  }
909  return 0;
910 }
911 
913 {
914  ApiContext context(c);
915  try
916  {
917  // this uses the entire value range
918  return Numerics::objectToIntptr((RexxObject *)o, *n);
919  }
920  catch (RexxNativeActivation *)
921  {
922  }
923  return 0;
924 }
925 
927 {
928  ApiContext context(c);
929  try
930  {
931  // this uses the entire value range
932  return ((RexxObject *)o)->logicalValue(*n);
933  }
934  catch (RexxNativeActivation *)
935  {
936  }
937  return 0;
938 }
939 
941 {
942  ApiContext context(c);
943  try
944  {
946  }
947  catch (RexxNativeActivation *)
948  {
949  }
950  return NULLOBJECT;
951 }
952 
954 {
955  ApiContext context(c);
956  try
957  {
958  return context.ret(new_numberstringFromDouble(n));
959  }
960  catch (RexxNativeActivation *)
961  {
962  }
963  return NULLOBJECT;
964 }
965 
967 {
968  ApiContext context(c);
969  try
970  {
971  return context.ret(new_numberstringFromDouble(n, precision));
972  }
973  catch (RexxNativeActivation *)
974  {
975  }
976  return NULLOBJECT;
977 }
978 
980 {
981  ApiContext context(c);
982  try
983  {
984  return ((RexxObject *)o)->doubleValue(*n);
985  }
986  catch (RexxNativeActivation *)
987  {
988  }
989  return 0;
990 }
991 
993 {
994  ApiContext context(c);
995  try
996  {
997  return (RexxStringObject)context.ret(REQUEST_STRING((RexxObject *)o));
998  }
999  catch (RexxNativeActivation *)
1000  {
1001  }
1002  return NULLOBJECT;
1003 }
1004 
1006 {
1007  ApiContext context(c);
1008  try
1009  {
1010  RexxString *temp = REQUEST_STRING((RexxObject *)o);
1011  context.ret(temp);
1012  return (CSTRING)temp->getStringData();
1013  }
1014  catch (RexxNativeActivation *)
1015  {
1016  }
1017  return NULL;
1018 }
1019 
1020 size_t RexxEntry StringGet(RexxThreadContext *c, RexxStringObject s, size_t o, POINTER r, size_t l)
1021 {
1022  ApiContext context(c);
1023  try
1024  {
1025  RexxString *temp = (RexxString *)s;
1026  return size_v(temp->copyData(o - 1, (char *)r, l)); // todo m17n : propagate strong type ?
1027  }
1028  catch (RexxNativeActivation *)
1029  {
1030  }
1031  return 0;
1032 }
1033 
1035 {
1036  ApiContext context(c);
1037  try
1038  {
1039  RexxString *temp = (RexxString *)s;
1040  return size_v(temp->getBLength()); // todo m17n : replace StringLength by StringBLength and StringCLength
1041  }
1042  catch (RexxNativeActivation *)
1043  {
1044  }
1045  return 0;
1046 }
1047 
1049 {
1050  ApiContext context(c);
1051  try
1052  {
1053  RexxString *temp = (RexxString *)s;
1054  return (CSTRING)temp->getStringData();
1055  }
1056  catch (RexxNativeActivation *)
1057  {
1058  }
1059  return NULL;
1060 }
1061 
1063 {
1064  ApiContext context(c);
1065  try
1066  {
1067  return (RexxStringObject)context.ret(new_string(s, l));
1068  }
1069  catch (RexxNativeActivation *)
1070  {
1071  }
1072  return NULLOBJECT;
1073 }
1074 
1076 {
1077  ApiContext context(c);
1078  try
1079  {
1080  return (RexxStringObject)context.ret(new_string((const char *)s));
1081  }
1082  catch (RexxNativeActivation *)
1083  {
1084  }
1085  return NULLOBJECT;
1086 }
1087 
1089 {
1090  ApiContext context(c);
1091  try
1092  {
1093  RexxString *temp = (RexxString *)s;
1094  return (RexxStringObject)context.ret(temp->upper());
1095  }
1096  catch (RexxNativeActivation *)
1097  {
1098  }
1099  return NULLOBJECT;
1100 }
1101 
1103 {
1104  ApiContext context(c);
1105  try
1106  {
1107  RexxString *temp = (RexxString *)s;
1108  return (RexxStringObject)context.ret(temp->lower());
1109  }
1110  catch (RexxNativeActivation *)
1111  {
1112  }
1113  return NULLOBJECT;
1114 }
1115 
1117 {
1118  ApiContext context(c);
1119  try
1120  {
1121  return isString((RexxObject *)o);
1122  }
1123  catch (RexxNativeActivation *)
1124  {
1125  }
1126  return 0;
1127 }
1128 
1130 {
1131  ApiContext context(c);
1132  try
1133  {
1134  return (RexxBufferStringObject)context.ret(raw_string(l));
1135  }
1136  catch (RexxNativeActivation *)
1137  {
1138  }
1139  return NULLOBJECT;
1140 }
1141 
1143 {
1144  ApiContext context(c);
1145  try
1146  {
1147  RexxString *temp = (RexxString *)s;
1148  return size_v(temp->getBLength()); // todo m17n : replace BufferStringLength by BufferStringBLength and BufferStringCLength
1149  }
1150  catch (RexxNativeActivation *)
1151  {
1152  }
1153  return 0;
1154 }
1155 
1157 {
1158  ApiContext context(c);
1159  try
1160  {
1161  RexxString *temp = (RexxString *)s;
1162  return (POINTER)temp->getWritableData();
1163  }
1164  catch (RexxNativeActivation *)
1165  {
1166  }
1167  return NULL;
1168 }
1169 
1171 {
1172  ApiContext context(c);
1173  try
1174  {
1175  RexxString *temp = (RexxString *)s;
1176  temp->finish(l);
1177  return s;
1178  }
1179  catch (RexxNativeActivation *)
1180  {
1181  }
1182  return NULL;
1183 }
1184 
1186 {
1187  ApiContext context(c);
1188  try
1189  {
1190  RexxString *index = new_string(i);
1191  ProtectedObject p(index);
1192  ((RexxDirectory *)t)->put((RexxObject *)o, index);
1193  }
1194  catch (RexxNativeActivation *)
1195  {
1196  }
1197 }
1198 
1200 {
1201  ApiContext context(c);
1202  try
1203  {
1204  RexxString *index = new_string(i);
1205  ProtectedObject p(index);
1206  return context.ret(((RexxDirectory *)t)->at(index));
1207  }
1208  catch (RexxNativeActivation *)
1209  {
1210  }
1211  return OREF_NULL;
1212 }
1213 
1215 {
1216  ApiContext context(c);
1217  try
1218  {
1219  RexxString *index = new_string(i);
1220  ProtectedObject p(index);
1221  return context.ret(((RexxDirectory *)t)->remove(index));
1222  }
1223  catch (RexxNativeActivation *)
1224  {
1225  }
1226  return OREF_NULL;
1227 }
1228 
1230 {
1231  ApiContext context(c);
1232  try
1233  {
1234  return (RexxDirectoryObject)context.ret(new_directory());
1235  }
1236  catch (RexxNativeActivation *)
1237  {
1238  }
1239  return OREF_NULL;
1240 }
1241 
1243 {
1244  ApiContext context(c);
1245  try
1246  {
1247  return isOfClass(Directory, (RexxObject *)o);
1248  }
1249  catch (RexxNativeActivation *)
1250  {
1251  }
1252  return false;
1253 }
1254 
1256 {
1257  ApiContext context(c);
1258  try
1259  {
1260  if (i == 0)
1261  {
1262  reportException(Error_Incorrect_method_positive, OREF_positional, 1);
1263  }
1264  return (RexxObjectPtr)context.ret(((RexxArray *)a)->getApi(i));
1265  }
1266  catch (RexxNativeActivation *)
1267  {
1268  }
1269  return OREF_NULL;
1270 }
1271 
1272 
1274 {
1275  ApiContext context(c);
1276  try
1277  {
1278  if (i == 0)
1279  {
1280  reportException(Error_Incorrect_method_positive, OREF_positional, 2);
1281  }
1282  ((RexxArray *)a)->putApi((RexxObject *)o, i);
1283  }
1284  catch (RexxNativeActivation *)
1285  {
1286  }
1287 }
1288 
1289 
1291 {
1292  ApiContext context(c);
1293  try
1294  {
1295  return ((RexxArray *)a)->append((RexxObject *)o);
1296  }
1297  catch (RexxNativeActivation *)
1298  {
1299  return 0;
1300  }
1301 }
1302 
1303 
1305 {
1306  ApiContext context(c);
1307  try
1308  {
1309  RexxString *str = new_string(s, l);
1310  ProtectedObject p(str);
1311  return ((RexxArray *)a)->append(str);
1312  }
1313  catch (RexxNativeActivation *)
1314  {
1315  return 0;
1316  }
1317 }
1318 
1319 
1321 {
1322  ApiContext context(c);
1323  try
1324  {
1325  return ((RexxArray *)a)->size();
1326  }
1327  catch (RexxNativeActivation *)
1328  {
1329  }
1330  return 0;
1331 }
1332 
1333 
1335 {
1336  ApiContext context(c);
1337  try
1338  {
1339  return ((RexxArray *)a)->items();
1340  }
1341  catch (RexxNativeActivation *)
1342  {
1343  }
1344  return 0;
1345 }
1346 
1348 {
1349  ApiContext context(c);
1350  try
1351  {
1352  return ((RexxArray *)a)->getDimension();
1353  }
1354  catch (RexxNativeActivation *)
1355  {
1356  }
1357  return 0;
1358 }
1359 
1361 {
1362  ApiContext context(c);
1363  try
1364  {
1365  return (RexxArrayObject)context.ret(new_array(s));
1366  }
1367  catch (RexxNativeActivation *)
1368  {
1369  }
1370  return NULLOBJECT;
1371 }
1372 
1374 {
1375  ApiContext context(c);
1376  try
1377  {
1378  return (RexxArrayObject)context.ret(new_array((RexxObject *)o));
1379  }
1380  catch (RexxNativeActivation *)
1381  {
1382  }
1383  return NULLOBJECT;
1384 }
1385 
1387 {
1388  ApiContext context(c);
1389  try
1390  {
1391  return (RexxArrayObject)context.ret(new_array((RexxObject *)o1, (RexxObject *)o2));
1392  }
1393  catch (RexxNativeActivation *)
1394  {
1395  }
1396  return NULLOBJECT;
1397 }
1398 
1400 {
1401  ApiContext context(c);
1402  try
1403  {
1404  return (RexxArrayObject)context.ret(new_array((RexxObject *)o1, (RexxObject *)o2, (RexxObject *)o3));
1405  }
1406  catch (RexxNativeActivation *)
1407  {
1408  }
1409  return NULLOBJECT;
1410 }
1411 
1413 {
1414  ApiContext context(c);
1415  try
1416  {
1417  return (RexxArrayObject)context.ret(new_array((RexxObject *)o1, (RexxObject *)o2, (RexxObject *)o3, (RexxObject *)o4));
1418  }
1419  catch (RexxNativeActivation *)
1420  {
1421  }
1422  return NULLOBJECT;
1423 }
1424 
1425 
1427 {
1428  ApiContext context(c);
1429  try
1430  {
1431  return (RexxArrayObject)context.ret(new_array((RexxObject *)o1, (RexxObject *)o2, (RexxObject *)o3, (RexxObject *)o4, (RexxObject *)o5));
1432  }
1433  catch (RexxNativeActivation *)
1434  {
1435  }
1436  return NULLOBJECT;
1437 }
1438 
1439 
1441 {
1442  ApiContext context(c);
1443  try
1444  {
1445  return isArray((RexxObject *)o);
1446  }
1447  catch (RexxNativeActivation *)
1448  {
1449  }
1450  return false;
1451 }
1452 
1454 {
1455  ApiContext context(c);
1456  try
1457  {
1458  return (POINTER)((RexxBuffer *)b)->getData();
1459  }
1460  catch (RexxNativeActivation *)
1461  {
1462  }
1463  return NULL;
1464 }
1465 
1467 {
1468  ApiContext context(c);
1469  try
1470  {
1471  return size_v(((RexxBuffer *)b)->getDataLength());
1472  }
1473  catch (RexxNativeActivation *)
1474  {
1475  }
1476  return 0;
1477 }
1478 
1480 {
1481  ApiContext context(c);
1482  try
1483  {
1484  return (RexxBufferObject)context.ret((RexxObject *)new_buffer(l));
1485  }
1486  catch (RexxNativeActivation *)
1487  {
1488  }
1489  return NULLOBJECT;
1490 }
1491 
1493 {
1494  ApiContext context(c);
1495  try
1496  {
1497  return isOfClass(Buffer, (RexxObject *)o);
1498  }
1499  catch (RexxNativeActivation *)
1500  {
1501  }
1502  return false;
1503 }
1504 
1506 {
1507  ApiContext context(c);
1508  try
1509  {
1510  return (POINTER)((RexxPointer *)o)->pointer();
1511  }
1512  catch (RexxNativeActivation *)
1513  {
1514  }
1515  return NULL;
1516 }
1517 
1519 {
1520  ApiContext context(c);
1521  try
1522  {
1523  return (RexxPointerObject)context.ret(new_pointer(p));
1524  }
1525  catch (RexxNativeActivation *)
1526  {
1527  }
1528  return NULLOBJECT;
1529 }
1530 
1532 {
1533  ApiContext context(c);
1534  try
1535  {
1536  return isOfClass(Pointer, (RexxObject *)o);
1537  }
1538  catch (RexxNativeActivation *)
1539  {
1540  }
1541  return false;
1542 }
1543 
1545 {
1546  ApiContext context(c);
1547  try
1548  {
1549  return context.ret(((RexxSupplier *)o)->value());
1550  }
1551  catch (RexxNativeActivation *)
1552  {
1553  }
1554  return NULLOBJECT;
1555 }
1556 
1558 {
1559  ApiContext context(c);
1560  try
1561  {
1562  return context.ret(((RexxSupplier *)o)->index());
1563  }
1564  catch (RexxNativeActivation *)
1565  {
1566  }
1567  return NULLOBJECT;
1568 }
1569 
1571 {
1572  ApiContext context(c);
1573  try
1574  {
1575  return ((RexxSupplier *)o)->available() == TheTrueObject;
1576  }
1577  catch (RexxNativeActivation *)
1578  {
1579  }
1580  return false;
1581 }
1582 
1584 {
1585  ApiContext context(c);
1586  try
1587  {
1588  ((RexxSupplier *)o)->next();
1589  }
1590  catch (RexxNativeActivation *)
1591  {
1592  }
1593 }
1594 
1596 {
1597  ApiContext context(c);
1598  try
1599  {
1600  return (RexxSupplierObject)context.ret(new_supplier((RexxArray *)values, (RexxArray *)names));
1601  }
1602  catch (RexxNativeActivation *)
1603  {
1604  }
1605  return NULLOBJECT;
1606 }
1607 
1609 {
1610  ApiContext context(c);
1611  try
1612  {
1613  if (n == NULL)
1614  {
1615  return (RexxStemObject)context.ret(new RexxStem(OREF_NULL));
1616  }
1617  else
1618  {
1619  RexxString *name = new_string(n);
1620  ProtectedObject p(name);
1621  return (RexxStemObject)context.ret(new RexxStem(name));
1622  }
1623 
1624  }
1625  catch (RexxNativeActivation *)
1626  {
1627  }
1628  return NULLOBJECT;
1629 }
1630 
1632 {
1633  ApiContext context(c);
1634  try
1635  {
1636  ((RexxStem *)s)->setElement(n, (RexxObject *)v);
1637  }
1638  catch (RexxNativeActivation *)
1639  {
1640  }
1641 }
1642 
1644 {
1645  ApiContext context(c);
1646  try
1647  {
1648  return context.ret(((RexxStem *)s)->getElement(n));
1649  }
1650  catch (RexxNativeActivation *)
1651  {
1652  }
1653  return NULLOBJECT;
1654 }
1655 
1657 {
1658  ApiContext context(c);
1659  try
1660  {
1661  ((RexxStem *)s)->dropElement(n);
1662  }
1663  catch (RexxNativeActivation *)
1664  {
1665  }
1666 }
1667 
1669 {
1670  ApiContext context(c);
1671  try
1672  {
1673  ((RexxStem *)s)->setElement((size_t )i, (RexxObject *)v);
1674  }
1675  catch (RexxNativeActivation *)
1676  {
1677  }
1678 }
1679 
1681 {
1682  ApiContext context(c);
1683  try
1684  {
1685  return context.ret(((RexxStem *)s)->getElement((size_t)i));
1686  }
1687  catch (RexxNativeActivation *)
1688  {
1689  }
1690  return NULLOBJECT;
1691 }
1692 
1694 {
1695  ApiContext context(c);
1696  try
1697  {
1698  ((RexxStem *)s)->dropElement((size_t)i);
1699  }
1700  catch (RexxNativeActivation *)
1701  {
1702  }
1703 }
1704 
1706 {
1707  ApiContext context(c);
1708  try
1709  {
1710  return (RexxDirectoryObject)context.ret(((RexxStem *)s)->toDirectory());
1711  }
1712  catch (RexxNativeActivation *)
1713  {
1714  }
1715  return NULLOBJECT;
1716 }
1717 
1719 {
1720  ApiContext context(c);
1721  try
1722  {
1723  return context.ret(((RexxStem *)s)->getStemValue());
1724  }
1725  catch (RexxNativeActivation *)
1726  {
1727  }
1728  return NULLOBJECT;
1729 }
1730 
1732 {
1733  ApiContext context(c);
1734  try
1735  {
1736  return isOfClass(Stem, (RexxObject *)o);
1737  }
1738  catch (RexxNativeActivation *)
1739  {
1740  }
1741  return false;
1742 }
1743 
1745 {
1746  ApiContext context(c);
1747  try
1748  {
1750  }
1751  catch (RexxNativeActivation *)
1752  {
1753  }
1754 }
1755 
1757 {
1758  ApiContext context(c);
1759  try
1760  {
1762  }
1763  catch (RexxNativeActivation *)
1764  {
1765  }
1766 }
1767 
1769 {
1770  ApiContext context(c);
1771  try
1772  {
1774  }
1775  catch (RexxNativeActivation *)
1776  {
1777  }
1778 }
1779 
1781 {
1782  ApiContext context(c);
1783  try
1784  {
1786  }
1787  catch (RexxNativeActivation *)
1788  {
1789  }
1790 }
1791 
1793 {
1794  ApiContext context(c);
1795  try
1796  {
1797  reportException((wholenumber_t)n, (RexxObject *)o1, (RexxObject *)o2, (RexxObject *)o3, (RexxObject *)o4);
1798  }
1799  catch (RexxNativeActivation *)
1800  {
1801  }
1802 }
1803 
1805 {
1806  ApiContext context(c);
1807  try
1808  {
1809  reportException((wholenumber_t)n, (RexxObject *)o1, (RexxObject *)o2, (RexxObject *)o3, (RexxObject *)o4, (RexxObject *)o5);
1810  }
1811  catch (RexxNativeActivation *)
1812  {
1813  }
1814 }
1815 
1817 {
1818  ApiContext context(c);
1819  try
1820  {
1822  }
1823  catch (RexxNativeActivation *)
1824  {
1825  }
1826 }
1827 
1829 {
1830  ApiContext context(c);
1831  try
1832  {
1833  RexxString *name = new_upper_string(n);
1834  ProtectedObject p(name);
1835  context.context->enableConditionTrap();
1836  context.activity->raiseCondition(name, OREF_NULL, (RexxString *)desc, (RexxObject *)add, (RexxObject *)result);
1837  }
1838  catch (RexxNativeActivation *)
1839  {
1840  }
1841 }
1842 
1844 {
1845  ApiContext context(c);
1846  try
1847  {
1848  return context.context->getConditionInfo() != OREF_NULL;
1849  }
1850  catch (RexxNativeActivation *)
1851  {
1852  }
1853  return false;
1854 }
1855 
1857 {
1858  ApiContext context(c);
1859  try
1860  {
1861  return context.activity->displayCondition(context.context->getConditionInfo());
1862  }
1863  catch (RexxNativeActivation *)
1864  {
1865  }
1866  return Error_Interpretation/1000; // this is a default one if something goes wrong
1867 }
1868 
1870 {
1871  ApiContext context(c);
1872  try
1873  {
1874  return (RexxDirectoryObject)context.ret(context.context->getConditionInfo());
1875  }
1876  catch (RexxNativeActivation *)
1877  {
1878  }
1879  return OREF_NULL;
1880 }
1881 
1882 
1884 {
1885  ApiContext context(c);
1886  try
1887  {
1889  }
1890  catch (RexxNativeActivation *)
1891  {
1892  }
1893 }
1894 
1896 {
1897  ApiContext context(c);
1898  try
1899  {
1901  }
1902  catch (RexxNativeActivation *)
1903  {
1904  }
1905 }
1906 
1908 {
1909  ApiContext context(c);
1910  try
1911  {
1912  return (POINTER)((RexxMutableBuffer *)b)->getData();
1913  }
1914  catch (RexxNativeActivation *)
1915  {
1916  }
1917  return NULL;
1918 }
1919 
1921 {
1922  ApiContext context(c);
1923  try
1924  {
1925  return size_v(((RexxMutableBuffer *)b)->getBLength()); // todo m17n : replace MutableBufferLength by MutableBufferBLength and MutableBufferCLength
1926  }
1927  catch (RexxNativeActivation *)
1928  {
1929  }
1930  return 0;
1931 }
1932 
1934 {
1935  ApiContext context(c);
1936  try
1937  {
1938  return size_v(((RexxMutableBuffer *)b)->setDataLength(length)); // todo m17n
1939  }
1940  catch (RexxNativeActivation *)
1941  {
1942  }
1943  return 0;
1944 }
1945 
1947 {
1948  ApiContext context(c);
1949  try
1950  {
1951  return size_v(((RexxMutableBuffer *)b)->getCapacity()); // todo m17n
1952  }
1953  catch (RexxNativeActivation *)
1954  {
1955  }
1956  return 0;
1957 }
1958 
1960 {
1961  ApiContext context(c);
1962  try
1963  {
1964  return (POINTER)((RexxMutableBuffer *)b)->setCapacity(length);
1965  }
1966  catch (RexxNativeActivation *)
1967  {
1968  }
1969  return 0;
1970 }
1971 
1973 {
1974  ApiContext context(c);
1975  try
1976  {
1977  return (RexxMutableBufferObject)context.ret((RexxObject *)new RexxMutableBuffer(l, l));
1978  }
1979  catch (RexxNativeActivation *)
1980  {
1981  }
1982  return NULLOBJECT;
1983 }
1984 
1986 {
1987  ApiContext context(c);
1988  try
1989  {
1990  return isOfClass(MutableBuffer, (RexxObject *)o);
1991  }
1992  catch (RexxNativeActivation *)
1993  {
1994  }
1995  return false;
1996 }
1997 
1998 END_EXTERN_C()
1999 
2000 RexxThreadInterface RexxActivity::threadContextFunctions =
2001 {
2003  DetachThread,
2004  HaltThread,
2009 
2011  SendMessage0,
2012  SendMessage1,
2013  SendMessage2,
2014 
2017 
2018  IsInstanceOf,
2019  IsOfType,
2020  HasMethod,
2021  LoadPackage,
2025  FindClass,
2032  CallRoutine,
2033  CallProgram,
2034 
2035  NewMethod,
2036  NewRoutine,
2037  IsRoutine,
2038  IsMethod,
2041 
2042  ObjectToCSelf,
2046  ValueToObject,
2048  ObjectToValue,
2052  Int64ToObject,
2054  ObjectToInt64,
2056  Int32ToObject,
2058  ObjectToInt32,
2067 
2070  StringGet,
2071  StringLength,
2072  StringData,
2073  NewString,
2075  StringUpper,
2076  StringLower,
2077  IsString,
2078 
2083 
2084  DirectoryPut,
2085  DirectoryAt,
2087  NewDirectory,
2088  IsDirectory,
2089 
2090  ArrayAt,
2091  ArrayPut,
2092  ArrayAppend,
2094  ArraySize,
2095  ArrayItems,
2097  NewArray,
2098  ArrayOfOne,
2099  ArrayOfTwo,
2100  ArrayOfThree,
2101  ArrayOfFour,
2102  ArrayOfFive,
2103  IsArray,
2104 
2105  BufferData,
2106  BufferLength,
2107  NewBuffer,
2108  IsBuffer,
2109 
2110  PointerValue,
2111  NewPointer,
2112  IsPointer,
2113 
2114  SupplierItem,
2115  SupplierIndex,
2117  SupplierNext,
2118  NewSupplier,
2119 
2120  NewStem,
2128  GetStemValue,
2129  IsStem,
2130 
2143 
2144  OREF_NULL,
2145  OREF_NULL,
2146  OREF_NULL,
2147  OREF_NULL,
2157 };
void reportException(wholenumber_t error)
RexxArray * new_array(size_t s)
Definition: ArrayClass.hpp:259
RexxBuffer * new_buffer(sizeB_t s)
RexxDirectory * new_directory()
RexxNumberString * new_numberstringFromDouble(double n)
RexxPointer * new_pointer(void *p)
#define OREF_NULL
Definition: RexxCore.h:60
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:283
#define TheEnvironment
Definition: RexxCore.h:174
bool isString(RexxObject *o)
Definition: RexxCore.h:269
#define TheTrueObject
Definition: RexxCore.h:186
#define isOfClass(t, r)
Definition: RexxCore.h:212
#define TheFalseObject
Definition: RexxCore.h:185
#define TheMethodClass
Definition: RexxCore.h:153
#define TheRoutineClass
Definition: RexxCore.h:154
bool isArray(RexxObject *o)
Definition: RexxCore.h:273
#define Error_Incorrect_method_positive
#define Error_Interpretation
RexxString * new_string(const char *s, stringsizeB_t bl, sizeC_t cl=-1)
RexxString * raw_string(stringsizeB_t bl, stringsizeC_t cl=-1)
RexxString * new_upper_string(const char *s, stringsizeB_t bl, stringsizeC_t cl=-1)
RexxSupplier * new_supplier(RexxArray *c, RexxArray *f)
RexxMutableBufferObject RexxEntry NewMutableBuffer(RexxThreadContext *c, size_t l)
logical_t RexxEntry IsString(RexxThreadContext *c, RexxObjectPtr o)
RexxArrayObject RexxEntry ArrayOfFour(RexxThreadContext *c, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3, RexxObjectPtr o4)
RexxStringObject RexxEntry NewStringFromAsciiz(RexxThreadContext *c, CSTRING s)
RexxObjectPtr RexxEntry UnsignedInt64ToObject(RexxThreadContext *c, uint64_t n)
POINTER RexxEntry SetMutableBufferCapacity(RexxThreadContext *c, RexxMutableBufferObject b, size_t length)
size_t RexxEntry ArrayAppend(RexxThreadContext *c, RexxArrayObject a, RexxObjectPtr o)
RexxArrayObject RexxEntry NewArray(RexxThreadContext *c, size_t s)
void RexxEntry SetThreadTrace(RexxThreadContext *c, logical_t setting)
void RexxEntry DirectoryPut(RexxThreadContext *c, RexxDirectoryObject t, RexxObjectPtr o, CSTRING i)
logical_t RexxEntry ObjectToStringSize(RexxThreadContext *c, RexxObjectPtr o, stringsize_t *n)
RexxObjectPtr RexxEntry StringSizeToObject(RexxThreadContext *c, stringsize_t n)
RexxObjectPtr RexxEntry SupplierIndex(RexxThreadContext *c, RexxSupplierObject o)
void RexxEntry RaiseException4(RexxThreadContext *c, size_t n, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3, RexxObjectPtr o4)
logical_t RexxEntry RegisterLibrary(RexxThreadContext *c, CSTRING n, RexxPackageEntry *e)
POINTER RexxEntry MutableBufferData(RexxThreadContext *c, RexxMutableBufferObject b)
void RexxEntry APIRaiseException(RexxThreadContext *c, size_t n, RexxArrayObject a)
void RexxEntry RaiseException2(RexxThreadContext *c, size_t n, RexxObjectPtr o1, RexxObjectPtr o2)
logical_t RexxEntry IsBuffer(RexxThreadContext *c, RexxObjectPtr o)
RexxDirectoryObject RexxEntry GetPackageRoutines(RexxThreadContext *c, RexxPackageObject m)
logical_t RexxEntry ObjectToUnsignedInt64(RexxThreadContext *c, RexxObjectPtr o, uint64_t *n)
CSTRING RexxEntry StringData(RexxThreadContext *c, RexxStringObject s)
RexxPackageObject RexxEntry LoadPackageFromData(RexxThreadContext *c, CSTRING n, CSTRING d, size_t l)
void RexxEntry ClearCondition(RexxThreadContext *c)
RexxObjectPtr RexxEntry DoubleToObjectWithPrecision(RexxThreadContext *c, double n, size_t precision)
RexxObjectPtr RexxEntry DoubleToObject(RexxThreadContext *c, double n)
void RexxEntry RaiseException5(RexxThreadContext *c, size_t n, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3, RexxObjectPtr o4, RexxObjectPtr o5)
logical_t RexxEntry IsArray(RexxThreadContext *c, RexxObjectPtr o)
RexxArrayObject RexxEntry ArrayOfTwo(RexxThreadContext *c, RexxObjectPtr o1, RexxObjectPtr o2)
RexxArrayObject RexxEntry ArrayOfFive(RexxThreadContext *c, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3, RexxObjectPtr o4, RexxObjectPtr o5)
size_t RexxEntry ArrayDimension(RexxThreadContext *c, RexxArrayObject a)
logical_t RexxEntry IsMethod(RexxThreadContext *c, RexxObjectPtr o)
RexxObjectPtr RexxEntry LogicalToObject(RexxThreadContext *c, logical_t n)
RexxClassObject RexxEntry FindClass(RexxThreadContext *c, CSTRING n)
RexxObjectPtr RexxEntry GetStemElement(RexxThreadContext *c, RexxStemObject s, CSTRING n)
logical_t RexxEntry ObjectToLogical(RexxThreadContext *c, RexxObjectPtr o, logical_t *n)
size_t RexxEntry StringLength(RexxThreadContext *c, RexxStringObject s)
RexxBufferStringObject RexxEntry NewBufferString(RexxThreadContext *c, size_t l)
RexxArrayObject RexxEntry ArrayOfOne(RexxThreadContext *c, RexxObjectPtr o)
RexxStringObject RexxEntry ObjectToString(RexxThreadContext *c, RexxObjectPtr o)
RexxObjectPtr RexxEntry WholeNumberToObject(RexxThreadContext *c, wholenumber_t n)
RexxPackageObject RexxEntry LoadPackage(RexxThreadContext *c, CSTRING n)
logical_t RexxEntry SupplierAvailable(RexxThreadContext *c, RexxSupplierObject o)
logical_t RexxEntry ObjectToValue(RexxThreadContext *c, RexxObjectPtr o, ValueDescriptor *d)
RexxObjectPtr RexxEntry GetStemValue(RexxThreadContext *c, RexxStemObject s)
void RexxEntry DetachThread(RexxThreadContext *c)
void RexxEntry ReleaseGlobalReference(RexxThreadContext *c, RexxObjectPtr o)
void RexxEntry SetStemElement(RexxThreadContext *c, RexxStemObject s, CSTRING n, RexxObjectPtr v)
RexxStringObject RexxEntry FinishBufferString(RexxThreadContext *c, RexxBufferStringObject s, size_t l)
logical_t RexxEntry IsRoutine(RexxThreadContext *c, RexxObjectPtr o)
size_t RexxEntry ArraySize(RexxThreadContext *c, RexxArrayObject a)
void RexxEntry HaltThread(RexxThreadContext *c)
logical_t RexxEntry ObjectToUnsignedInt32(RexxThreadContext *c, RexxObjectPtr o, uint32_t *n)
RexxBufferObject RexxEntry NewBuffer(RexxThreadContext *c, size_t l)
void RexxEntry DropStemArrayElement(RexxThreadContext *c, RexxStemObject s, size_t i)
RexxStemObject RexxEntry NewStem(RexxThreadContext *c, CSTRING n)
void RexxEntry RaiseException0(RexxThreadContext *c, size_t n)
RexxDirectoryObject RexxEntry GetLocalEnvironment(RexxThreadContext *c)
RexxDirectoryObject RexxEntry GetPackagePublicClasses(RexxThreadContext *c, RexxPackageObject m)
RexxObjectPtr RexxEntry CallProgram(RexxThreadContext *c, const char *p, RexxArrayObject a)
size_t RexxEntry StringGet(RexxThreadContext *c, RexxStringObject s, size_t o, POINTER r, size_t l)
RexxObjectPtr RexxEntry SendMessage0(RexxThreadContext *c, RexxObjectPtr o, CSTRING m)
logical_t RexxEntry ObjectToUintptr(RexxThreadContext *c, RexxObjectPtr o, uintptr_t *n)
size_t RexxEntry BufferLength(RexxThreadContext *c, RexxBufferObject b)
RexxSupplierObject RexxEntry NewSupplier(RexxThreadContext *c, RexxArrayObject values, RexxArrayObject names)
void RexxEntry ArrayPut(RexxThreadContext *c, RexxArrayObject a, RexxObjectPtr o, size_t i)
RexxArrayObject RexxEntry ValuesToObject(RexxThreadContext *c, ValueDescriptor *d, size_t count)
RexxObjectPtr RexxEntry GetStemArrayElement(RexxThreadContext *c, RexxStemObject s, size_t i)
logical_t RexxEntry IsOfType(RexxThreadContext *c, RexxObjectPtr o, CSTRING cn)
logical_t RexxEntry CheckCondition(RexxThreadContext *c)
logical_t RexxEntry IsMutableBuffer(RexxThreadContext *c, RexxObjectPtr o)
RexxDirectoryObject RexxEntry GetPackageMethods(RexxThreadContext *c, RexxPackageObject m)
logical_t RexxEntry IsDirectory(RexxThreadContext *c, RexxObjectPtr o)
logical_t RexxEntry LoadLibraryPackage(RexxThreadContext *c, CSTRING n)
RexxObjectPtr RexxEntry Int64ToObject(RexxThreadContext *c, int64_t n)
RexxPackageObject RexxEntry GetRoutinePackage(RexxThreadContext *c, RexxRoutineObject o)
POINTER RexxEntry ObjectToCSelfScoped(RexxThreadContext *c, RexxObjectPtr o, RexxObjectPtr s)
RexxDirectoryObject RexxEntry GetGlobalEnvironment(RexxThreadContext *c)
RexxMethodObject RexxEntry NewMethod(RexxThreadContext *c, CSTRING n, CSTRING source, stringsize_t length)
RexxObjectPtr RexxEntry UintptrToObject(RexxThreadContext *c, uintptr_t n)
RexxRoutineObject RexxEntry NewRoutine(RexxThreadContext *c, CSTRING n, CSTRING source, stringsize_t length)
RexxObjectPtr RexxEntry IntptrToObject(RexxThreadContext *c, intptr_t n)
CSTRING RexxEntry ObjectToStringValue(RexxThreadContext *c, RexxObjectPtr o)
size_t RexxEntry BufferStringLength(RexxThreadContext *c, RexxBufferStringObject s)
RexxDirectoryObject RexxEntry NewDirectory(RexxThreadContext *c)
wholenumber_t RexxEntry DisplayCondition(RexxThreadContext *c)
RexxObjectPtr RexxEntry SendMessage2(RexxThreadContext *c, RexxObjectPtr o, CSTRING m, RexxObjectPtr a1, RexxObjectPtr a2)
logical_t RexxEntry HasMethod(RexxThreadContext *c, RexxObjectPtr o, CSTRING n)
RexxStringObject RexxEntry StringUpper(RexxThreadContext *c, RexxStringObject s)
RexxObjectPtr RexxEntry DirectoryRemove(RexxThreadContext *c, RexxDirectoryObject t, CSTRING i)
logical_t RexxEntry ObjectToInt32(RexxThreadContext *c, RexxObjectPtr o, int32_t *n)
RexxObjectPtr RexxEntry RequestGlobalReference(RexxThreadContext *c, RexxObjectPtr o)
RexxObjectPtr RexxEntry ValueToObject(RexxThreadContext *c, ValueDescriptor *d)
RexxDirectoryObject RexxEntry GetAllStemElements(RexxThreadContext *c, RexxStemObject s)
RexxStringObject RexxEntry NewString(RexxThreadContext *c, CSTRING s, size_t l)
logical_t RexxEntry ObjectToWholeNumber(RexxThreadContext *c, RexxObjectPtr o, wholenumber_t *n)
void RexxEntry RaiseException3(RexxThreadContext *c, size_t n, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3)
size_t RexxEntry ArrayItems(RexxThreadContext *c, RexxArrayObject a)
size_t RexxEntry SetMutableBufferLength(RexxThreadContext *c, RexxMutableBufferObject b, size_t length)
logical_t RexxEntry IsPointer(RexxThreadContext *c, RexxObjectPtr o)
RexxStringObject RexxEntry StringLower(RexxThreadContext *c, RexxStringObject s)
POINTER RexxEntry PointerValue(RexxThreadContext *c, RexxPointerObject o)
void RexxEntry DecodeConditionInfo(RexxThreadContext *c, RexxDirectoryObject d, RexxCondition *cd)
RexxPackageObject RexxEntry GetMethodPackage(RexxThreadContext *c, RexxMethodObject o)
logical_t RexxEntry ObjectToInt64(RexxThreadContext *c, RexxObjectPtr o, int64_t *n)
void RexxEntry SetStemArrayElement(RexxThreadContext *c, RexxStemObject s, size_t i, RexxObjectPtr v)
logical_t RexxEntry ObjectToIntptr(RexxThreadContext *c, RexxObjectPtr o, intptr_t *n)
POINTER RexxEntry BufferData(RexxThreadContext *c, RexxBufferObject b)
POINTER RexxEntry BufferStringData(RexxThreadContext *c, RexxBufferStringObject s)
RexxClassObject RexxEntry FindClassFromPackage(RexxThreadContext *c, RexxPackageObject m, CSTRING n)
void RexxEntry SupplierNext(RexxThreadContext *c, RexxSupplierObject o)
logical_t RexxEntry ObjectToDouble(RexxThreadContext *c, RexxObjectPtr o, double *n)
RexxObjectPtr RexxEntry SupplierItem(RexxThreadContext *c, RexxSupplierObject o)
logical_t RexxEntry IsInstanceOf(RexxThreadContext *c, RexxObjectPtr o, RexxClassObject cl)
void RexxEntry RaiseCondition(RexxThreadContext *c, CSTRING n, RexxStringObject desc, RexxObjectPtr add, RexxObjectPtr result)
void RexxEntry ReleaseLocalReference(RexxThreadContext *c, RexxObjectPtr o)
size_t RexxEntry ArrayAppendString(RexxThreadContext *c, RexxArrayObject a, CSTRING s, size_t l)
RexxDirectoryObject RexxEntry GetPackageClasses(RexxThreadContext *c, RexxPackageObject m)
RexxObjectPtr RexxEntry CallRoutine(RexxThreadContext *c, RexxRoutineObject r, RexxArrayObject a)
void RexxEntry RaiseException1(RexxThreadContext *c, size_t n, RexxObjectPtr o1)
RexxObjectPtr RexxEntry SendMessageArray(RexxThreadContext *c, RexxObjectPtr o, CSTRING m, RexxArrayObject a)
RexxDirectoryObject RexxEntry GetConditionInfo(RexxThreadContext *c)
RexxObjectPtr RexxEntry SendMessage1(RexxThreadContext *c, RexxObjectPtr o, CSTRING m, RexxObjectPtr a1)
RexxObjectPtr RexxEntry ArrayAt(RexxThreadContext *c, RexxArrayObject a, size_t i)
size_t RexxEntry MutableBufferLength(RexxThreadContext *c, RexxMutableBufferObject b)
RexxDirectoryObject RexxEntry GetPackagePublicRoutines(RexxThreadContext *c, RexxPackageObject m)
RexxObjectPtr RexxEntry DirectoryAt(RexxThreadContext *c, RexxDirectoryObject t, CSTRING i)
RexxObjectPtr RexxEntry Int32ToObject(RexxThreadContext *c, int32_t n)
POINTER RexxEntry ObjectToCSelf(RexxThreadContext *c, RexxObjectPtr o)
RexxObjectPtr RexxEntry UnsignedInt32ToObject(RexxThreadContext *c, uint32_t n)
RexxArrayObject RexxEntry ArrayOfThree(RexxThreadContext *c, RexxObjectPtr o1, RexxObjectPtr o2, RexxObjectPtr o3)
RexxPointerObject RexxEntry NewPointer(RexxThreadContext *c, POINTER p)
logical_t RexxEntry IsStem(RexxThreadContext *c, RexxObjectPtr o)
size_t RexxEntry MutableBufferCapacity(RexxThreadContext *c, RexxMutableBufferObject b)
void RexxEntry DropStemElement(RexxThreadContext *c, RexxStemObject s, CSTRING n)
RexxActivity * activity
Definition: ContextApi.hpp:177
RexxNativeActivation * context
Definition: ContextApi.hpp:181
RexxObjectPtr ret(RexxObject *o)
Definition: ContextApi.hpp:168
static void decodeConditionData(RexxDirectory *conditionObj, RexxCondition *condData)
void addGlobalReference(RexxObject *o)
void removeGlobalReference(RexxObject *o)
PackageClass * loadRequires(RexxActivity *activity, RexxString *shortName, const char *data, size_t length)
RexxString * resolveProgramName(RexxString *name, RexxString *dir, RexxString *ext)
static const wholenumber_t MIN_WHOLENUMBER
Definition: Numerics.hpp:63
static bool objectToUintptr(RexxObject *source, uintptr_t &result)
Definition: Numerics.cpp:526
static RexxObject * stringsizeToObject(stringsize_t v)
Definition: Numerics.cpp:203
static const wholenumber_t MAX_WHOLENUMBER
Definition: Numerics.hpp:62
static RexxObject * uintptrToObject(uintptr_t v)
Definition: Numerics.cpp:844
static bool objectToUnsignedInt64(RexxObject *o, uint64_t &result)
Definition: Numerics.cpp:483
static bool objectToUnsignedInteger(RexxObject *o, size_t &result, size_t max)
Definition: Numerics.cpp:361
static bool objectToWholeNumber(RexxObject *o, wholenumber_t &result, wholenumber_t max, wholenumber_t min)
Definition: Numerics.cpp:226
static RexxObject * int64ToObject(int64_t v)
Definition: Numerics.cpp:140
static bool objectToIntptr(RexxObject *source, intptr_t &result)
Definition: Numerics.cpp:549
static RexxObject * wholenumberToObject(wholenumber_t v)
Definition: Numerics.cpp:182
static bool objectToStringSize(RexxObject *o, stringsize_t &result, stringsize_t max)
Definition: Numerics.cpp:312
static bool objectToSignedInteger(RexxObject *o, ssize_t &result, ssize_t max, ssize_t min)
Definition: Numerics.cpp:269
static RexxObject * intptrToObject(intptr_t v)
Definition: Numerics.cpp:866
static bool objectToInt64(RexxObject *o, int64_t &result)
Definition: Numerics.cpp:409
static RexxObject * uint64ToObject(uint64_t v)
Definition: Numerics.cpp:161
static LibraryPackage * loadLibrary(RexxString *name)
static bool registerPackage(RexxString *name, RexxPackageEntry *p)
bool halt(RexxString *)
wholenumber_t displayCondition(RexxDirectory *conditionObject)
InterpreterInstance * getInstance()
RexxDirectory * getLocal()
bool setTrace(bool)
bool raiseCondition(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
bool objectToValue(RexxObject *o, ValueDescriptor *value)
RexxClass * findClass(RexxString *className)
RexxDirectory * getConditionInfo()
RexxObject * valueToObject(ValueDescriptor *value)
void removeLocalReference(RexxObject *objr)
void setConditionInfo(RexxDirectory *info)
RexxArray * valuesToObject(ValueDescriptor *value, size_t count)
bool isInstanceOf(RexxClass *)
const char * getStringData()
char * getWritableData()
RexxString * lower()
sizeB_t copyData(sizeB_t, char *, sizeB_t)
RexxString * upper()
void finish(stringsizeB_t bl, sizeC_t cl=-1)
sizeB_t getBLength()
#define THREAD_INTERFACE_VERSION
Definition: oorexxapi.h:451
#define END_EXTERN_C()
Definition: rexx.h:61
struct _RexxPackageObject * RexxPackageObject
Definition: rexx.h:135
struct _RexxClassObject * RexxClassObject
Definition: rexx.h:136
const char * CSTRING
Definition: rexx.h:78
size_t logical_t
Definition: rexx.h:231
struct _RexxMutableBufferObject * RexxMutableBufferObject
Definition: rexx.h:140
struct _RexxStringObject * RexxStringObject
Definition: rexx.h:128
struct _RexxArrayObject * RexxArrayObject
Definition: rexx.h:130
struct _RexxBufferStringObject * RexxBufferStringObject
Definition: rexx.h:129
struct _RexxObjectPtr * RexxObjectPtr
Definition: rexx.h:127
#define NULLOBJECT
Definition: rexx.h:147
ssize_t wholenumber_t
Definition: rexx.h:230
#define size_v(X)
Definition: rexx.h:237
struct _RexxRoutineObject * RexxRoutineObject
Definition: rexx.h:134
struct _RexxDirectoryObject * RexxDirectoryObject
Definition: rexx.h:137
struct _RexxSupplierObject * RexxSupplierObject
Definition: rexx.h:138
struct _RexxMethodObject * RexxMethodObject
Definition: rexx.h:133
struct _RexxBufferObject * RexxBufferObject
Definition: rexx.h:131
void * POINTER
Definition: rexx.h:79
size_t stringsize_t
Definition: rexx.h:228
struct _RexxPointerObject * RexxPointerObject
Definition: rexx.h:132
#define RexxEntry
Definition: rexx.h:412
struct _RexxStemObject * RexxStemObject
Definition: rexx.h:139
#define BEGIN_EXTERN_C()
Definition: rexx.h:60
Definition: oorexxapi.h:242
#define INT32_MAX
UINT_PTR uintptr_t
int int32_t
signed __int64 int64_t
unsigned int uint32_t
#define INT32_MIN
SSIZE_T ssize_t
INT_PTR intptr_t
#define UINT32_MAX
unsigned __int64 uint64_t