| 130 | } |
| 131 | |
| 132 | static inline void rh_cleanup(RProj *lp, cbm_store_t *store) { |
| 133 | if (store) |
| 134 | cbm_store_close(store); |
| 135 | if (lp->srv) { |
| 136 | cbm_mcp_server_free(lp->srv); |
| 137 | lp->srv = NULL; |
| 138 | } |
| 139 | free(lp->project); |
| 140 | lp->project = NULL; |
| 141 | th_rmtree(lp->tmpdir); |
| 142 | th_rmtree(lp->cachedir); |
| 143 | if (lp->dbpath[0]) { |
| 144 | unlink(lp->dbpath); |
| 145 | char wal[600], shm[600]; |
| 146 | snprintf(wal, sizeof(wal), "%s-wal", lp->dbpath); |
| 147 | unlink(wal); |
| 148 | snprintf(shm, sizeof(shm), "%s-shm", lp->dbpath); |
| 149 | unlink(shm); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | /* Count edges of a given type in the project graph. Returns -1 on query error. */ |
| 154 | static inline int rh_count_edges(cbm_store_t *store, const char *project, const char *edge) { |
no test coverage detected