Changeset 2162
- Timestamp:
- Mar 28, 2011, 5:55:53 PM (13 years ago)
- Location:
- trunk/builder/scripts/templates
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/builder/scripts/templates/clang.tl
r2153 r2162 22 22 #include "rappture.h" 23 23 24 #include <stdio.h> 24 25 #include <stdlib.h> 25 #include <st dio.h>26 #include <string.h> 26 27 #include <math.h> 27 28 #include <unistd.h> … … 109 110 } 110 111 } 112 input string { 113 decl "const char* $id; /* for $path */" 114 code "\n/* get input value for $path */" 115 code "rpGetString(io,\"$path.current\", &$id);" 116 } 111 117 input * { 112 118 code "\n/* get input value for $path */" … … 149 155 code "rpPutString(io, \"$path.current\", line, RPLIB_OVERWRITE);" 150 156 } 157 output string { 158 decl "char $id\[1024\]; /* for $path */" 159 code "\n/* save output value for $path */" 160 code "rpPutString(io, \"$path.current\", $id, RPLIB_OVERWRITE);" 161 } 151 162 output * { 152 163 code "\n/* save output value for $path */" -
trunk/builder/scripts/templates/fortran77.tl
r2153 r2162 24 24 integer rp_lib, rp_units_convert_dbl 25 25 integer io, ok 26 CHARACTER*255 inFile, strVal26 character*255 inFile, strVal 27 27 28 28 @@DECLARATIONS@@ … … 99 99 } 100 100 } 101 input string { 102 decl "\nc for $path" 103 decl " character*255 $id" 104 code "\nc get input value for $path" 105 code " call rp_lib_get(io,\n + \"$path.current\", $id)" 106 } 101 107 input * { 102 108 code "\nc get input value for $path" … … 147 153 code " call rp_lib_put_str(io,\n + \"$path.current\",strVal,0)" 148 154 } 155 output string { 156 decl "\nc for $path" 157 decl " character*255 $id" 158 code "\nc save output value for $path" 159 code " call rp_lib_put_str(io,\n + \"$path.current\",$id,0)" 160 } 149 161 output * { 150 162 code "\nc save output value for $path" -
trunk/builder/scripts/templates/matlab.tl
r2153 r2162 54 54 code "$id = rpLibGetString(io,'$path.current');" 55 55 } 56 input integer { 57 code "\n% get input value for $path" 58 code "$id = int32(rpLibGetDouble(io,'$path.current'));" 59 } 56 60 input number { 57 61 set units [attr get units] … … 62 66 } else { 63 67 code "\n% get input value for $path" 64 code "str = rpLibGetString(io,'$path.current');" 65 code "$id = str2num(str);" 68 code "$id = rpLibGetDouble(io,'$path.current');" 66 69 } 67 70 } … … 90 93 code "rpLibPutString(io,'$path.current',imdata,0);" 91 94 } 95 output integer { 96 code "\n% save output value for $path" 97 code "rpLibPutString(io,'$path.current',num2str($id),0);" 98 } 99 output number { 100 code "\n% save output value for $path" 101 code "rpLibPutString(io,'$path.current',num2str($id),0);" 102 } 92 103 output * { 93 104 code "\n% save output value for $path" -
trunk/builder/scripts/templates/octave.tl
r2153 r2162 54 54 code "$id = rpLibGetString(io,'$path.current');" 55 55 } 56 input integer { 57 code "\n% get input value for $path" 58 code "$id = int32(rpLibGetDouble(io,'$path.current'));" 59 } 56 60 input number { 57 61 set units [attr get units] … … 62 66 } else { 63 67 code "\n% get input value for $path" 64 code "str = rpLibGetString(io,'$path.current');" 65 code "$id = str2num(str);" 68 code "$id = rpLibGetDouble(io,'$path.current');" 66 69 } 67 70 } … … 90 93 code "rpLibPutString(io,'$path.current',imdata,0);" 91 94 } 95 output integer { 96 code "\n% save output value for $path" 97 code "rpLibPutString(io,'$path.current',num2str($id),0);" 98 } 99 output number { 100 code "\n% save output value for $path" 101 code "rpLibPutString(io,'$path.current',num2str($id),0);" 102 } 92 103 output * { 93 104 code "\n% save output value for $path" -
trunk/builder/scripts/templates/python.tl
r2153 r2162 49 49 code "\n# get input value for $path" 50 50 code "# returns value as string \"yes\" or \"no\"" 51 code "$id = io.get('$path.current') "51 code "$id = io.get('$path.current') == 'yes'" 52 52 } 53 53 input image { … … 55 55 code "# returns base64-encoded image data" 56 56 code "$id = io.get('$path.current')" 57 } 58 input integer { 59 code "\n# get input value for $path" 60 code "$id = int(io.get('$path.current'))" 57 61 } 58 62 input number { … … 64 68 } else { 65 69 code "\n# get input value for $path" 66 code "$id = io.get('$path.current')"70 code "$id = float(io.get('$path.current'))" 67 71 } 68 72 }
Note: See TracChangeset
for help on using the changeset viewer.