* Creates a pgbson structure from a raw buffer of bytes */
| 1829 | * Creates a pgbson structure from a raw buffer of bytes |
| 1830 | */ |
| 1831 | pgbson * |
| 1832 | CreatePgbsonfromBsonBytes(const uint8_t *rawbytes, uint32_t length) |
| 1833 | { |
| 1834 | int bson_size = length + VARHDRSZ; |
| 1835 | pgbson *pgbsonVal = (pgbson *) palloc(bson_size); |
| 1836 | SET_VARSIZE(pgbsonVal, bson_size); |
| 1837 | memcpy(VARDATA(pgbsonVal), rawbytes, length); |
| 1838 | return pgbsonVal; |
| 1839 | } |
| 1840 | |
| 1841 | |
| 1842 | /* |
no outgoing calls
no test coverage detected