| 2097 | // |
| 2098 | |
| 2099 | static void gen_get_segment( const act* action, int column) |
| 2100 | { |
| 2101 | blb* blob; |
| 2102 | PAT args; |
| 2103 | const ref* into; |
| 2104 | const TEXT *pattern1 = |
| 2105 | "%IFgds__status[2] := %ENGDS__GET_SEGMENT (%V1, %BH, %I1, %S1 (%I2), %RF%I2);"; |
| 2106 | |
| 2107 | if (action->act_error && (action->act_type != ACT_blob_for)) |
| 2108 | begin(column); |
| 2109 | |
| 2110 | if (action->act_flags & ACT_sql) |
| 2111 | blob = (blb*) action->act_request->req_blobs; |
| 2112 | else |
| 2113 | blob = (blb*) action->act_object; |
| 2114 | |
| 2115 | args.pat_blob = blob; |
| 2116 | args.pat_vector1 = status_vector(action); |
| 2117 | args.pat_condition = true; |
| 2118 | args.pat_ident1 = blob->blb_len_ident; |
| 2119 | args.pat_ident2 = blob->blb_buff_ident; |
| 2120 | args.pat_string1 = SIZEOF; |
| 2121 | PATTERN_expand(column, pattern1, &args); |
| 2122 | |
| 2123 | if (action->act_flags & ACT_sql) |
| 2124 | { |
| 2125 | into = action->act_object; |
| 2126 | set_sqlcode(action, column); |
| 2127 | printa(column, "if (SQLCODE = 0) or (SQLCODE = 101) then"); |
| 2128 | column += INDENT; |
| 2129 | begin(column); |
| 2130 | align(column); |
| 2131 | fprintf(gpreGlob.out_file, "gds__ftof (gds__%d, gds__%d, %s, gds__%d);", |
| 2132 | blob->blb_buff_ident, blob->blb_len_ident, |
| 2133 | into->ref_value, blob->blb_len_ident); |
| 2134 | if (into->ref_null_value) |
| 2135 | { |
| 2136 | align(column); |
| 2137 | fprintf(gpreGlob.out_file, "%s := gds__%d;", into->ref_null_value, blob->blb_len_ident); |
| 2138 | } |
| 2139 | endp(column); |
| 2140 | column -= INDENT; |
| 2141 | } |
| 2142 | } |
| 2143 | |
| 2144 | |
| 2145 | //____________________________________________________________ |
no test coverage detected