* bson_recv is the internal receive function for bson. * TODO: This is still relatively untested and is used only in the CREATE TYPE. * This function still needs to be validated and tested */
| 179 | * This function still needs to be validated and tested |
| 180 | */ |
| 181 | Datum |
| 182 | bson_recv(PG_FUNCTION_ARGS) |
| 183 | { |
| 184 | StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); |
| 185 | pgbson *bsonValue = PgbsonInitFromBuffer(buf->data, buf->len); |
| 186 | |
| 187 | /* let caller know we consumed whole buffer */ |
| 188 | buf->cursor = buf->len; |
| 189 | PG_RETURN_POINTER(bsonValue); |
| 190 | } |
| 191 | |
| 192 | |
| 193 | /* |
nothing calls this directly
no test coverage detected