contrib/git-credential-gnome-keyring.c: add static where applicable

Mark global variable and functions as static. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Sep 23, 2013 at 11:49 UTC 18fe5add3385a5b41e294881992c1980dcf51ffd
1 file changed +9 -9
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+9 -9
@@ -128,7 +128,7 @@ static char* keyring_object(struct credential *c)
128 return object;
129 }
130
131 -int keyring_get(struct credential *c)
131 +static int keyring_get(struct credential *c)
132 {
133 char* object = NULL;
134 GList *entries;
@@ -178,7 +178,7 @@ int keyring_get(struct credential *c)
178 }
179
180
181 -int keyring_store(struct credential *c)
181 +static int keyring_store(struct credential *c)
182 {
183 guint32 item_id;
184 char *object = NULL;
@@ -212,7 +212,7 @@ int keyring_store(struct credential *c)
212 return EXIT_SUCCESS;
213 }
214
215 -int keyring_erase(struct credential *c)
215 +static int keyring_erase(struct credential *c)
216 {
217 char *object = NULL;
218 GList *entries;
@@ -277,7 +277,7 @@ int keyring_erase(struct credential *c)
277 * Table with helper operation callbacks, used by generic
278 * credential helper main function.
279 */
280 -struct credential_operation const credential_helper_ops[] =
280 +static struct credential_operation const credential_helper_ops[] =
281 {
282 { "get", keyring_get },
283 { "store", keyring_store },
@@ -287,12 +287,12 @@ struct credential_operation const credential_helper_ops[] =
287
288 /* ------------------ credential functions ------------------ */
289
290 -void credential_init(struct credential *c)
290 +static void credential_init(struct credential *c)
291 {
292 memset(c, 0, sizeof(*c));
293 }
294
295 -void credential_clear(struct credential *c)
295 +static void credential_clear(struct credential *c)
296 {
297 free(c->protocol);
298 free(c->host);
@@ -303,7 +303,7 @@ void credential_clear(struct credential *c)
303 credential_init(c);
304 }
305
306 -int credential_read(struct credential *c)
306 +static int credential_read(struct credential *c)
307 {
308 char buf[1024];
309 ssize_t line_len = 0;
@@ -358,14 +358,14 @@ int credential_read(struct credential *c)
358 return 0;
359 }
360
361 -void credential_write_item(FILE *fp, const char *key, const char *value)
361 +static void credential_write_item(FILE *fp, const char *key, const char *value)
362 {
363 if (!value)
364 return;
365 fprintf(fp, "%s=%s\n", key, value);
366 }
367
368 -void credential_write(const struct credential *c)
368 +static void credential_write(const struct credential *c)
369 {
370 /* only write username/password, if set */
371 credential_write_item(stdout, "username", c->username);