version 1.17, 2006/07/08 09:14:03 |
version 1.18, 2006/08/16 07:39:15 |
|
|
* If <in> starts with a `-', <in> is taken as the description. |
* If <in> starts with a `-', <in> is taken as the description. |
* Otherwise <in> is the name of the file containing the description. |
* Otherwise <in> is the name of the file containing the description. |
* If <in> is NULL, the description is read from stdin. |
* If <in> is NULL, the description is read from stdin. |
|
* Returns 0 on success, -1 on failure, setting errno. |
*/ |
*/ |
void |
int |
rcs_set_description(RCSFILE *file, const char *in) |
rcs_set_description(RCSFILE *file, const char *in) |
{ |
{ |
BUF *bp; |
BUF *bp; |
|
|
|
|
/* Description is in file <in>. */ |
/* Description is in file <in>. */ |
if (in != NULL && *in != '-') { |
if (in != NULL && *in != '-') { |
bp = rcs_buf_load(in, BUF_AUTOEXT); |
if ((bp = rcs_buf_load(in, BUF_AUTOEXT)) == NULL) |
|
return (-1); |
rcs_buf_putc(bp, '\0'); |
rcs_buf_putc(bp, '\0'); |
content = rcs_buf_release(bp); |
content = rcs_buf_release(bp); |
/* Description is in <in>. */ |
/* Description is in <in>. */ |
|
|
|
|
rcs_desc_set(file, content); |
rcs_desc_set(file, content); |
xfree(content); |
xfree(content); |
|
return (0); |
} |
} |
|
|
/* |
/* |