#include <stdio.h>
#include <string.h>
-#include <stdarg.h>
#include <stdlib.h>
#include <glib.h>
#include <gnome-keyring.h>
#define CREDENTIAL_OP_END \
{ NULL,NULL }
-/* ---------------- common helper functions ----------------- */
-
-static inline void warning(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- fprintf(stderr, "warning: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n" );
- va_end(ap);
-}
-
-static inline void error(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- fprintf(stderr, "error: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n" );
- va_end(ap);
-}
-
/* ----------------- GNOME Keyring functions ----------------- */
/* create a special keyring option string, if path is given */
return EXIT_SUCCESS;
if (result != GNOME_KEYRING_RESULT_OK) {
- error("%s",gnome_keyring_result_to_message(result));
+ g_critical("%s", gnome_keyring_result_to_message(result));
return EXIT_FAILURE;
}
if (result != GNOME_KEYRING_RESULT_OK)
{
- error("%s",gnome_keyring_result_to_message(result));
+ g_critical("%s", gnome_keyring_result_to_message(result));
return EXIT_FAILURE;
}
if (result != GNOME_KEYRING_RESULT_OK)
{
- error("%s",gnome_keyring_result_to_message(result));
+ g_critical("%s", gnome_keyring_result_to_message(result));
return EXIT_FAILURE;
}
value = strchr(buf,'=');
if (!value) {
- warning("invalid credential line: %s", key);
+ g_warning("invalid credential line: %s", key);
gnome_keyring_memory_free(buf);
return -1;
}