version 1.24, 2005/08/10 16:01:27 |
version 1.25, 2005/09/11 14:16:48 |
|
|
* the result to the cache for future hits. |
* the result to the cache for future hits. |
*/ |
*/ |
static TAILQ_HEAD(, cvsroot) cvs_rcache = TAILQ_HEAD_INITIALIZER(cvs_rcache); |
static TAILQ_HEAD(, cvsroot) cvs_rcache = TAILQ_HEAD_INITIALIZER(cvs_rcache); |
|
static void cvsroot_free(struct cvsroot *); |
|
|
/* |
/* |
* cvsroot_parse() |
* cvsroot_parse() |
|
|
return (root); |
return (root); |
} |
} |
|
|
|
|
/* |
/* |
* cvsroot_free() |
* cvsroot_remove() |
* |
* |
* Free a CVSROOT structure previously allocated and returned by |
* Remove a CVSROOT structure from the cache, and free it. |
* cvsroot_parse(). |
|
*/ |
*/ |
void |
void |
cvsroot_free(struct cvsroot *root) |
cvsroot_remove(struct cvsroot *root) |
{ |
{ |
root->cr_ref--; |
root->cr_ref--; |
if (root->cr_ref == 0) { |
if (root->cr_ref == 0) { |
TAILQ_REMOVE(&cvs_rcache, root, root_cache); |
TAILQ_REMOVE(&cvs_rcache, root, root_cache); |
if (root->cr_str != NULL) |
cvsroot_free(root); |
free(root->cr_str); |
|
if (root->cr_buf != NULL) |
|
free(root->cr_buf); |
|
if (root->cr_version != NULL) |
|
free(root->cr_version); |
|
free(root); |
|
} |
} |
} |
} |
|
|
|
/* |
|
* cvsroot_free() |
|
* |
|
* Free a CVSROOT structure previously allocated and returned by |
|
* cvsroot_parse(). |
|
*/ |
|
static void |
|
cvsroot_free(struct cvsroot *root) |
|
{ |
|
if (root->cr_str != NULL) |
|
free(root->cr_str); |
|
if (root->cr_buf != NULL) |
|
free(root->cr_buf); |
|
if (root->cr_version != NULL) |
|
free(root->cr_version); |
|
free(root); |
|
} |
|
|
/* |
/* |
* cvsroot_get() |
* cvsroot_get() |