Beispiel #1
0
Datum
complex_recv(PG_FUNCTION_ARGS)
{
	StringInfo	buf = (StringInfo) PG_GETARG_POINTER(0);
	Complex    *result;

	result = (Complex *) palloc(sizeof(Complex));
	result->x = pq_getmsgfloat8(buf);
	result->y = pq_getmsgfloat8(buf);
	PG_RETURN_POINTER(result);
}
Beispiel #2
0
/*
 *		float8recv			- converts external binary format to float8
 */
Datum
float8recv(PG_FUNCTION_ARGS)
{
	StringInfo	buf = (StringInfo) PG_GETARG_POINTER(0);

	PG_RETURN_FLOAT8(pq_getmsgfloat8(buf));
}
Beispiel #3
0
Datum rotation3d_recv(PG_FUNCTION_ARGS)
{
    StringInfo buf = (StringInfo)PG_GETARG_POINTER(0);
    Rotation3D * result;

    result = (Rotation3D*)palloc(sizeof(Rotation3D));
    result->r11 = pq_getmsgfloat8(buf);
    result->r12 = pq_getmsgfloat8(buf);
    result->r13 = pq_getmsgfloat8(buf);
    result->r21 = pq_getmsgfloat8(buf);
    result->r22 = pq_getmsgfloat8(buf);
    result->r23 = pq_getmsgfloat8(buf);
    result->r31 = pq_getmsgfloat8(buf);
    result->r32 = pq_getmsgfloat8(buf);
    result->r33 = pq_getmsgfloat8(buf);
   PG_RETURN_POINTER(result);
}