オブジェクト拡張 (11) オブジェクト拡張 (11) 型の拡張 2 入力関数(外部表現のためのパーサ) complex_in Complex *complex_in(char *str) { double x, y; Complex *result; if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2) { elog(WARN, "complex_in: error in parsing return NULL; } result = (Complex *)palloc(sizeof(Complex)); result->x = x; result->y = y; return (result); }