tempfile: rename 'template' variables
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
eb78e23f22
commit
ea8ace4ad3
12
tempfile.c
12
tempfile.c
@ -165,11 +165,11 @@ struct tempfile *register_tempfile(const char *path)
|
|||||||
return tempfile;
|
return tempfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tempfile *mks_tempfile_sm(const char *template, int suffixlen, int mode)
|
struct tempfile *mks_tempfile_sm(const char *filename_template, int suffixlen, int mode)
|
||||||
{
|
{
|
||||||
struct tempfile *tempfile = new_tempfile();
|
struct tempfile *tempfile = new_tempfile();
|
||||||
|
|
||||||
strbuf_add_absolute_path(&tempfile->filename, template);
|
strbuf_add_absolute_path(&tempfile->filename, filename_template);
|
||||||
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
|
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
|
||||||
if (tempfile->fd < 0) {
|
if (tempfile->fd < 0) {
|
||||||
deactivate_tempfile(tempfile);
|
deactivate_tempfile(tempfile);
|
||||||
@ -179,7 +179,7 @@ struct tempfile *mks_tempfile_sm(const char *template, int suffixlen, int mode)
|
|||||||
return tempfile;
|
return tempfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
|
struct tempfile *mks_tempfile_tsm(const char *filename_template, int suffixlen, int mode)
|
||||||
{
|
{
|
||||||
struct tempfile *tempfile = new_tempfile();
|
struct tempfile *tempfile = new_tempfile();
|
||||||
const char *tmpdir;
|
const char *tmpdir;
|
||||||
@ -188,7 +188,7 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
|
|||||||
if (!tmpdir)
|
if (!tmpdir)
|
||||||
tmpdir = "/tmp";
|
tmpdir = "/tmp";
|
||||||
|
|
||||||
strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, template);
|
strbuf_addf(&tempfile->filename, "%s/%s", tmpdir, filename_template);
|
||||||
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
|
tempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);
|
||||||
if (tempfile->fd < 0) {
|
if (tempfile->fd < 0) {
|
||||||
deactivate_tempfile(tempfile);
|
deactivate_tempfile(tempfile);
|
||||||
@ -198,12 +198,12 @@ struct tempfile *mks_tempfile_tsm(const char *template, int suffixlen, int mode)
|
|||||||
return tempfile;
|
return tempfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tempfile *xmks_tempfile_m(const char *template, int mode)
|
struct tempfile *xmks_tempfile_m(const char *filename_template, int mode)
|
||||||
{
|
{
|
||||||
struct tempfile *tempfile;
|
struct tempfile *tempfile;
|
||||||
struct strbuf full_template = STRBUF_INIT;
|
struct strbuf full_template = STRBUF_INIT;
|
||||||
|
|
||||||
strbuf_add_absolute_path(&full_template, template);
|
strbuf_add_absolute_path(&full_template, filename_template);
|
||||||
tempfile = mks_tempfile_m(full_template.buf, mode);
|
tempfile = mks_tempfile_m(full_template.buf, mode);
|
||||||
if (!tempfile)
|
if (!tempfile)
|
||||||
die_errno("Unable to create temporary file '%s'",
|
die_errno("Unable to create temporary file '%s'",
|
||||||
|
34
tempfile.h
34
tempfile.h
@ -135,58 +135,58 @@ extern struct tempfile *register_tempfile(const char *path);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
extern struct tempfile *mks_tempfile_sm(const char *template,
|
extern struct tempfile *mks_tempfile_sm(const char *filename_template,
|
||||||
int suffixlen, int mode);
|
int suffixlen, int mode);
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile_s(const char *template,
|
static inline struct tempfile *mks_tempfile_s(const char *filename_template,
|
||||||
int suffixlen)
|
int suffixlen)
|
||||||
{
|
{
|
||||||
return mks_tempfile_sm(template, suffixlen, 0600);
|
return mks_tempfile_sm(filename_template, suffixlen, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile_m(const char *template, int mode)
|
static inline struct tempfile *mks_tempfile_m(const char *filename_template, int mode)
|
||||||
{
|
{
|
||||||
return mks_tempfile_sm(template, 0, mode);
|
return mks_tempfile_sm(filename_template, 0, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile(const char *template)
|
static inline struct tempfile *mks_tempfile(const char *filename_template)
|
||||||
{
|
{
|
||||||
return mks_tempfile_sm(template, 0, 0600);
|
return mks_tempfile_sm(filename_template, 0, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
extern struct tempfile *mks_tempfile_tsm(const char *template,
|
extern struct tempfile *mks_tempfile_tsm(const char *filename_template,
|
||||||
int suffixlen, int mode);
|
int suffixlen, int mode);
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile_ts(const char *template,
|
static inline struct tempfile *mks_tempfile_ts(const char *filename_template,
|
||||||
int suffixlen)
|
int suffixlen)
|
||||||
{
|
{
|
||||||
return mks_tempfile_tsm(template, suffixlen, 0600);
|
return mks_tempfile_tsm(filename_template, suffixlen, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile_tm(const char *template, int mode)
|
static inline struct tempfile *mks_tempfile_tm(const char *filename_template, int mode)
|
||||||
{
|
{
|
||||||
return mks_tempfile_tsm(template, 0, mode);
|
return mks_tempfile_tsm(filename_template, 0, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *mks_tempfile_t(const char *template)
|
static inline struct tempfile *mks_tempfile_t(const char *filename_template)
|
||||||
{
|
{
|
||||||
return mks_tempfile_tsm(template, 0, 0600);
|
return mks_tempfile_tsm(filename_template, 0, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
extern struct tempfile *xmks_tempfile_m(const char *template, int mode);
|
extern struct tempfile *xmks_tempfile_m(const char *filename_template, int mode);
|
||||||
|
|
||||||
/* See "mks_tempfile functions" above. */
|
/* See "mks_tempfile functions" above. */
|
||||||
static inline struct tempfile *xmks_tempfile(const char *template)
|
static inline struct tempfile *xmks_tempfile(const char *filename_template)
|
||||||
{
|
{
|
||||||
return xmks_tempfile_m(template, 0600);
|
return xmks_tempfile_m(filename_template, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user