* This routine supplies a pointer to a SparseData derived from an SvecType. * The SvecType is a serialized structure with fixed memory allocations, so * care must be taken not to append to the embedded StringInfo structs * without re-serializing the SparseData into the SvecType. */
| 65 | * without re-serializing the SparseData into the SvecType. |
| 66 | */ |
| 67 | static inline SparseData sdata_from_svec(SvecType *svec) |
| 68 | { |
| 69 | char *sdataptr = SVEC_SDATAPTR(svec); |
| 70 | SparseData sdata = (SparseData)sdataptr; |
| 71 | sdata->vals = (StringInfo)SDATA_DATA_SINFO(sdataptr); |
| 72 | sdata->index = (StringInfo)SDATA_INDEX_SINFO(sdataptr); |
| 73 | sdata->vals->data = SVEC_VALS_PTR(svec); |
| 74 | if (sdata->index->maxlen == 0) |
| 75 | { |
| 76 | sdata->index->data = NULL; |
| 77 | } else |
| 78 | { |
| 79 | sdata->index->data = SVEC_INDEX_PTR(svec); |
| 80 | } |
| 81 | return(sdata); |
| 82 | } |
| 83 | |
| 84 | static inline void printout_svec(SvecType *svec, char *msg, int stop); |
| 85 | static inline void printout_svec(SvecType *svec, char *msg, int stop) |
no outgoing calls
no test coverage detected