version 1.24, 2004/08/06 20:12:15 |
version 1.25, 2004/08/10 14:23:57 |
|
|
* cvs_file_create() |
* cvs_file_create() |
* |
* |
* Create a new file whose path is specified in <path> and of type <type>. |
* Create a new file whose path is specified in <path> and of type <type>. |
|
* Returns the created file on success, or NULL on failure. |
*/ |
*/ |
|
|
CVSFILE* |
CVSFILE* |
|
|
|
|
dp = parent->cf_ddat; |
dp = parent->cf_ddat; |
|
|
/* if the parent doesn't have an entry for that file, create it */ |
|
if ((dp->cd_ent != NULL) && |
|
((ent = cvs_ent_get(dp->cd_ent, file->cf_name)) == NULL)) { |
|
} |
|
|
|
TAILQ_INSERT_TAIL(&(dp->cd_files), file, cf_list); |
TAILQ_INSERT_TAIL(&(dp->cd_files), file, cf_list); |
dp->cd_nfiles++; |
dp->cd_nfiles++; |
file->cf_parent = parent; |
file->cf_parent = parent; |
|
|
} |
} |
} |
} |
|
|
cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDONLY); |
cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDWR); |
} |
} |
|
|
fd = open(cf->cf_path, O_RDONLY); |
fd = open(cf->cf_path, O_RDONLY); |
|
|
} |
} |
} |
} |
} while (ret > 0); |
} while (ret > 0); |
|
|
/* we can now close our Entries file */ |
|
if (cdp->cd_ent != NULL) { |
|
cvs_ent_close(cdp->cd_ent); |
|
cdp->cd_ent = NULL; |
|
} |
|
|
|
if (flags & CF_SORT) { |
if (flags & CF_SORT) { |
cvs_file_sort(&(cdp->cd_files), cdp->cd_nfiles); |
cvs_file_sort(&(cdp->cd_files), cdp->cd_nfiles); |