version 1.21, 2004/08/06 12:09:25 |
version 1.22, 2004/08/06 14:12:56 |
|
|
if (cfp == NULL) |
if (cfp == NULL) |
return (NULL); |
return (NULL); |
cfp->cf_type = type; |
cfp->cf_type = type; |
|
cfp->cf_mode = mode; |
|
|
if (type == DT_DIR) { |
if (type == DT_DIR) { |
if (mkdir(path, mode) == -1) { |
if (mkdir(path, mode) == -1) { |
|
|
|
|
|
|
/* |
/* |
|
* cvs_file_attach() |
|
* |
|
* Attach the file <file> as one of the children of parent <parent>, which |
|
* has to be a file of type DT_DIR. |
|
* Returns 0 on success, or -1 on failure. |
|
*/ |
|
|
|
int |
|
cvs_file_attach(CVSFILE *parent, CVSFILE *file) |
|
{ |
|
|
|
if (parent->cf_type != DT_DIR) |
|
return (-1); |
|
|
|
TAILQ_INSERT_HEAD(&(parent->cf_ddat->cd_files), file, cf_list); |
|
parent->cf_ddat->cd_nfiles++; |
|
file->cf_parent = parent; |
|
|
|
return (0); |
|
} |
|
|
|
|
|
/* |
* cvs_file_getdir() |
* cvs_file_getdir() |
* |
* |
* Get a cvs directory structure for the directory whose path is <dir>. |
* Get a cvs directory structure for the directory whose path is <dir>. |
|
|
* cvs_file_lget() |
* cvs_file_lget() |
* |
* |
* Get the file and link it with the parent right away. |
* Get the file and link it with the parent right away. |
|
* Returns a pointer to the created file structure on success, or NULL on |
|
* failure. |
*/ |
*/ |
|
|
static CVSFILE* |
static CVSFILE* |
|
|
return (NULL); |
return (NULL); |
} |
} |
cfp->cf_parent = parent; |
cfp->cf_parent = parent; |
|
cfp->cf_mode = st.st_mode & ACCESSPERMS; |
|
cfp->cf_mtime = st.st_mtime; |
|
|
if ((parent != NULL) && (CVS_DIR_ENTRIES(parent) != NULL)) { |
if ((parent != NULL) && (CVS_DIR_ENTRIES(parent) != NULL)) { |
ent = cvs_ent_get(CVS_DIR_ENTRIES(parent), cfp->cf_name); |
ent = cvs_ent_get(CVS_DIR_ENTRIES(parent), cfp->cf_name); |