From 91d5e23f5fa8b9eda5cf07c3aedec46256183550 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 12 Nov 2000 20:38:19 +0000 Subject: [PATCH] template is a reserved word in C++ s/template/tmpl/. Sun Nov 12 15:29:53 2000 Owen Taylor * gfileutils.[ch]: template is a reserved word in C++ s/template/tmpl/. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gfileutils.c | 24 ++++++++++++------------ gfileutils.h | 2 +- glib/gfileutils.c | 24 ++++++++++++------------ glib/gfileutils.h | 2 +- 12 files changed, 66 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0b6cae3b3..200ce8311 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sun Nov 12 15:29:53 2000 Owen Taylor + + * gfileutils.[ch]: template is a reserved word in + C++ s/template/tmpl/. + 2000-11-11 Havoc Pennington * gmarkup.c (g_markup_parse_context_parse): Handle a long stream diff --git a/gfileutils.c b/gfileutils.c index b897e1b0a..e1a870b9d 100644 --- a/gfileutils.c +++ b/gfileutils.c @@ -586,20 +586,20 @@ g_mkstemp (char *tmpl) /** * g_file_open_tmp: - * @template: Template for file name, as in g_mkstemp, basename only + * @tmpl: Template for file name, as in g_mkstemp, basename only * @name_used: location to store actual name used * @error: return location for a #GError * * Opens a file for writing in the preferred directory for temporary * files (as returned by g_get_tmp_dir()). * - * @template should be a string ending with six 'X' characters, as the + * @tmpl should be a string ending with six 'X' characters, as the * parameter to g_mkstemp() (or mkstemp()). However, unlike these * functions, the template should only be a basename, no directory * components are allowed. If template is NULL, a default template is * used. * - * Note that in contrast to g_mkstemp() (and mkstemp()) @template is not + * Note that in contrast to g_mkstemp() (and mkstemp()) @tmpl is not * modified, and might thus be a read-only literal string. * * The actual name used is returned in @name_used if non-NULL. This @@ -610,7 +610,7 @@ g_mkstemp (char *tmpl) * g_mkstemp() is returned. **/ int -g_file_open_tmp (const char *template, +g_file_open_tmp (const char *tmpl, char **name_used, GError **error) { @@ -619,28 +619,28 @@ g_file_open_tmp (const char *template, char *sep; char *fulltemplate; - if (template == NULL) - template = ".XXXXXX"; + if (tmpl == NULL) + tmpl = ".XXXXXX"; - if (strchr (template, G_DIR_SEPARATOR)) + if (strchr (tmpl, G_DIR_SEPARATOR)) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' illegal, should not contain a '%s'"), - template, G_DIR_SEPARATOR_S); + tmpl, G_DIR_SEPARATOR_S); return -1; } - if (strlen (template) < 6 || - strcmp (template + strlen (template) - 6, "XXXXXX") != 0) + if (strlen (tmpl) < 6 || + strcmp (tmpl + strlen (tmpl) - 6, "XXXXXX") != 0) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' doesn end with XXXXXX"), - template); + tmpl); return -1; } @@ -651,7 +651,7 @@ g_file_open_tmp (const char *template, else sep = G_DIR_SEPARATOR_S; - fulltemplate = g_strconcat (tmpdir, sep, template, NULL); + fulltemplate = g_strconcat (tmpdir, sep, tmpl, NULL); retval = g_mkstemp (fulltemplate); diff --git a/gfileutils.h b/gfileutils.h index 0e80543c6..9929ee152 100644 --- a/gfileutils.h +++ b/gfileutils.h @@ -84,7 +84,7 @@ gboolean g_file_get_contents (const gchar *filename, int g_mkstemp (char *tmpl); /* Wrapper for g_mkstemp */ -int g_file_open_tmp (const char *template, +int g_file_open_tmp (const char *tmpl, char **name_used, GError **error); diff --git a/glib/gfileutils.c b/glib/gfileutils.c index b897e1b0a..e1a870b9d 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -586,20 +586,20 @@ g_mkstemp (char *tmpl) /** * g_file_open_tmp: - * @template: Template for file name, as in g_mkstemp, basename only + * @tmpl: Template for file name, as in g_mkstemp, basename only * @name_used: location to store actual name used * @error: return location for a #GError * * Opens a file for writing in the preferred directory for temporary * files (as returned by g_get_tmp_dir()). * - * @template should be a string ending with six 'X' characters, as the + * @tmpl should be a string ending with six 'X' characters, as the * parameter to g_mkstemp() (or mkstemp()). However, unlike these * functions, the template should only be a basename, no directory * components are allowed. If template is NULL, a default template is * used. * - * Note that in contrast to g_mkstemp() (and mkstemp()) @template is not + * Note that in contrast to g_mkstemp() (and mkstemp()) @tmpl is not * modified, and might thus be a read-only literal string. * * The actual name used is returned in @name_used if non-NULL. This @@ -610,7 +610,7 @@ g_mkstemp (char *tmpl) * g_mkstemp() is returned. **/ int -g_file_open_tmp (const char *template, +g_file_open_tmp (const char *tmpl, char **name_used, GError **error) { @@ -619,28 +619,28 @@ g_file_open_tmp (const char *template, char *sep; char *fulltemplate; - if (template == NULL) - template = ".XXXXXX"; + if (tmpl == NULL) + tmpl = ".XXXXXX"; - if (strchr (template, G_DIR_SEPARATOR)) + if (strchr (tmpl, G_DIR_SEPARATOR)) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' illegal, should not contain a '%s'"), - template, G_DIR_SEPARATOR_S); + tmpl, G_DIR_SEPARATOR_S); return -1; } - if (strlen (template) < 6 || - strcmp (template + strlen (template) - 6, "XXXXXX") != 0) + if (strlen (tmpl) < 6 || + strcmp (tmpl + strlen (tmpl) - 6, "XXXXXX") != 0) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Template '%s' doesn end with XXXXXX"), - template); + tmpl); return -1; } @@ -651,7 +651,7 @@ g_file_open_tmp (const char *template, else sep = G_DIR_SEPARATOR_S; - fulltemplate = g_strconcat (tmpdir, sep, template, NULL); + fulltemplate = g_strconcat (tmpdir, sep, tmpl, NULL); retval = g_mkstemp (fulltemplate); diff --git a/glib/gfileutils.h b/glib/gfileutils.h index 0e80543c6..9929ee152 100644 --- a/glib/gfileutils.h +++ b/glib/gfileutils.h @@ -84,7 +84,7 @@ gboolean g_file_get_contents (const gchar *filename, int g_mkstemp (char *tmpl); /* Wrapper for g_mkstemp */ -int g_file_open_tmp (const char *template, +int g_file_open_tmp (const char *tmpl, char **name_used, GError **error);