| 246 | } |
| 247 | |
| 248 | int |
| 249 | deccvint(int in, decimal *np) |
| 250 | { |
| 251 | numeric *nres; |
| 252 | int result = 1; |
| 253 | |
| 254 | rsetnull(CDECIMALTYPE, (char *) np); |
| 255 | if (risnull(CINTTYPE, (char *) &in)) |
| 256 | return 0; |
| 257 | |
| 258 | nres = PGTYPESnumeric_new(); |
| 259 | if (nres == NULL) |
| 260 | return ECPG_INFORMIX_OUT_OF_MEMORY; |
| 261 | |
| 262 | result = PGTYPESnumeric_from_int(in, nres); |
| 263 | if (result == 0) |
| 264 | result = PGTYPESnumeric_to_decimal(nres, np); |
| 265 | |
| 266 | PGTYPESnumeric_free(nres); |
| 267 | return result; |
| 268 | } |
| 269 | |
| 270 | int |
| 271 | deccvlong(long lng, decimal *np) |