| 116 | } |
| 117 | |
| 118 | static void ncp_cleanup(NcpLangProj *lp, cbm_store_t *store) { |
| 119 | if (store) |
| 120 | cbm_store_close(store); |
| 121 | if (lp->srv) { |
| 122 | cbm_mcp_server_free(lp->srv); |
| 123 | lp->srv = NULL; |
| 124 | } |
| 125 | free(lp->project); |
| 126 | lp->project = NULL; |
| 127 | th_rmtree(lp->tmpdir); |
| 128 | unlink(lp->dbpath); |
| 129 | char wal[600], shm[600]; |
| 130 | snprintf(wal, sizeof(wal), "%s-wal", lp->dbpath); |
| 131 | unlink(wal); |
| 132 | snprintf(shm, sizeof(shm), "%s-shm", lp->dbpath); |
| 133 | unlink(shm); |
| 134 | } |
| 135 | |
| 136 | /* Count nodes with a given label. Returns -1 on error. */ |
| 137 | static int ncp_count_label(cbm_store_t *store, const char *project, const char *label) { |
no test coverage detected