|
7 | 7 | -- |
8 | 8 | -- Copyright (c) 1994, Regents of the University of California |
9 | 9 | -- |
10 | | --- $Id: complex.source,v 1.10 2001/10/03 20:54:22 tgl Exp $ |
| 10 | +-- $Id: complex.source,v 1.11 2001/10/26 20:45:33 tgl Exp $ |
11 | 11 | -- |
12 | 12 | --------------------------------------------------------------------------- |
13 | 13 |
|
|
18 | 18 | --called 'complex' which represents complex numbers. |
19 | 19 | ----------------------------- |
20 | 20 |
|
21 | | --- Assume the user defined functions are in _OBJWD_/complex_DLSUFFIX_ |
| 21 | +-- Assume the user defined functions are in _OBJWD_/complex$DLSUFFIX |
| 22 | +-- (we do not want to assume this is in the dynamic loader search path) |
22 | 23 | -- Look at $PWD/complex.c for the source. |
23 | 24 |
|
24 | 25 | -- the input function 'complex_in' takes a null-terminated string (the |
|
28 | 29 |
|
29 | 30 | CREATE FUNCTION complex_in(opaque) |
30 | 31 | RETURNS complex |
31 | | - AS '_OBJWD_/complex_DLSUFFIX_' |
| 32 | + AS '_OBJWD_/complex' |
32 | 33 | LANGUAGE 'c'; |
33 | 34 |
|
34 | 35 | -- the output function 'complex_out' takes the internal representation and |
35 | 36 | -- converts it into the textual representation. |
36 | 37 |
|
37 | 38 | CREATE FUNCTION complex_out(opaque) |
38 | 39 | RETURNS opaque |
39 | | - AS '_OBJWD_/complex_DLSUFFIX_' |
| 40 | + AS '_OBJWD_/complex' |
40 | 41 | LANGUAGE 'c'; |
41 | 42 |
|
42 | 43 | -- now, we can create the type. The internallength specifies the size of the |
@@ -80,7 +81,7 @@ SELECT * FROM test_complex; |
80 | 81 | -- first, define a function complex_add (also in complex.c) |
81 | 82 | CREATE FUNCTION complex_add(complex, complex) |
82 | 83 | RETURNS complex |
83 | | - AS '_OBJWD_/complex_DLSUFFIX_' |
| 84 | + AS '_OBJWD_/complex' |
84 | 85 | LANGUAGE 'c'; |
85 | 86 |
|
86 | 87 | -- we can now define the operator. We show a binary operator here but you |
@@ -138,15 +139,15 @@ SELECT 'READ ABOVE!' AS STOP; |
138 | 139 |
|
139 | 140 | -- first, define the required operators |
140 | 141 | CREATE FUNCTION complex_abs_lt(complex, complex) RETURNS bool |
141 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 142 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
142 | 143 | CREATE FUNCTION complex_abs_le(complex, complex) RETURNS bool |
143 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 144 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
144 | 145 | CREATE FUNCTION complex_abs_eq(complex, complex) RETURNS bool |
145 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 146 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
146 | 147 | CREATE FUNCTION complex_abs_ge(complex, complex) RETURNS bool |
147 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 148 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
148 | 149 | CREATE FUNCTION complex_abs_gt(complex, complex) RETURNS bool |
149 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 150 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
150 | 151 |
|
151 | 152 | CREATE OPERATOR < ( |
152 | 153 | leftarg = complex, rightarg = complex, procedure = complex_abs_lt, |
@@ -231,7 +232,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr) |
231 | 232 |
|
232 | 233 | -- |
233 | 234 | CREATE FUNCTION complex_abs_cmp(complex, complex) RETURNS int4 |
234 | | - AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c'; |
| 235 | + AS '_OBJWD_/complex' LANGUAGE 'c'; |
235 | 236 |
|
236 | 237 | SELECT oid, proname FROM pg_proc WHERE proname = 'complex_abs_cmp'; |
237 | 238 |
|
|