} data;
};
-/**
+/**
* variable and macros used for the eina_log module
*/
extern int _eet_log_dom_global;
#endif
/**
- * the default module log domain is the eet log domain
+ * the default module log domain is the eet log domain
*/
#define EET_DEFAULT_MODULE_LOG_DOMAIN _eet_log_dom_global
-/* Macros that are used everywhere
+/* Macros that are used everywhere
*
* the first four macros are the general macros for the lib
*/
#ifdef EET_DEFAULT_LOG_COLOR
#undef EET_DEFAULT_LOG_COLOR
#endif
-#define EET_DEFAULT_LOG_COLOR "\033[36m"
+#define EET_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERROR
#undef ERROR
#endif
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
/**
* macros that are used all around the code for message processing
- * four macros are defined ERR, WRN, DGB, INF.
+ * four macros are defined ERR, WRN, DGB, INF.
* EFREET_MODULE_LOG_DOM should be defined individually for each module
*/
goto on_error;
if (!(res = malloc(size))) goto on_error;
- INF("Private Key:\n");
+ INF("Private Key:");
buf[32] = '\0';
for (i = 0; i < 6; i++)
}
if (err) goto on_error;
- INF("\t%s:\n", names[i]);
+ INF("\t%s:", names[i]);
for (j = 0; strlen(res) > j; j += 32)
{
snprintf(buf, 32, "%s", res + j);
- INF("\t\t%s\n", buf);
+ INF("\t\t%s", buf);
}
}
free(res);
if (key->certificate)
{
- INF("Public certificate:\n");
+ INF("Public certificate:");
if (gnutls_x509_crt_print(key->certificate, GNUTLS_X509_CRT_FULL, &data)) goto on_error;
INF("%s", data.data);
gnutls_free(data.data);
rsa = EVP_PKEY_get1_RSA(key->private_key);
if (rsa)
{
- INF("Private key (RSA):\n");
+ INF("Private key (RSA):");
RSA_print_fp(out, rsa, 0);
}
dsa = EVP_PKEY_get1_DSA(key->private_key);
if (dsa)
{
- INF("Private key (DSA):\n");
+ INF("Private key (DSA):");
DSA_print_fp(out, dsa, 0);
}
dh = EVP_PKEY_get1_DH(key->private_key);
if (dh)
{
- INF("Private key (DH):\n");
+ INF("Private key (DH):");
DHparams_print_fp(out, dh);
}
- INF("Public certificate:\n");
+ INF("Public certificate:");
X509_print_fp(out, key->certificate);
# endif
#else
- INF("You need to compile signature support in EET.\n");
+ ERROR("You need to compile signature support in EET.");
#endif
}
#ifdef HAVE_SIGNATURE
if (!certificate || !out || der_length <= 0)
{
- INFO("No certificate provided.\n");
+ ERROR("No certificate provided.");
return ;
}
# ifdef HAVE_GNUTLS
datum.data = NULL;
datum.size = 0;
if (gnutls_x509_crt_print(cert, GNUTLS_X509_CRT_FULL, &datum)) goto on_error;
- INF("Public certificate :\n");
+ INF("Public certificate :");
INF("%s", datum.data);
on_error:
x509 = d2i_X509(NULL, &tmp, der_length);
if (x509 == NULL)
{
- INF("Not a valid certificate.\n");
+ INF("Not a valid certificate.");
return ;
}
- INF("Public certificate :\n");
+ INF("Public certificate :");
X509_print_fp(out, x509);
X509_free(x509);
# endif
#else
- INF("You need to compile signature support in EET.\n");
+ ERROR("You need to compile signature support in EET.");
#endif
}
else if (!strcmp(tok3, "hash")) n->type = EET_G_HASH;
else
{
- ERR("ERROR: group type '%s' invalid.\n", tok3);
+ ERR("ERROR: group type '%s' invalid.", tok3);
}
node = n;
}
}
else
{
- ERR("ERROR: value type '%s' invalid.\n", tok4);
+ ERR("ERROR: value type '%s' invalid.", tok4);
}
}
}
unsigned char ciphered : 1;
};
-
#if 0
/* Version 2 */
/* NB: all int's are stored in network byte order on disk */
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
if (!new_cache)
{
- CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort\n");
+ CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort");
abort();
}
}
new_cache = realloc(new_cache, new_cache_alloc * sizeof(Eet_File *));
if (!new_cache)
{
- CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort\n");
+ CRITICAL("BAD ERROR! Eet realloc of cache list failed. Abort");
abort();
}
}
_eet_log_dom_global = eina_log_domain_register("Eet",EET_DEFAULT_LOG_COLOR);
if(_eet_log_dom_global < 0)
{
- fprintf(stderr,"Eet Can not create a general log domain");
+ EINA_LOG_ERR("Eet Can not create a general log domain.");
goto error_eet_eina_log;
}
return eet_initcount;
eet_clearcache();
eina_log_domain_unregister(_eet_log_dom_global);
+ _eet_log_dom_global = -1;
eina_shutdown();
#ifdef HAVE_GNUTLS
gnutls_global_deinit();
if (eet_test_close(ef->x509_der == NULL, ef)) return NULL;
#else
- ERROR("This file could be signed but you didn't compile the necessary code to check the signature.\n");
+ ERROR("This file could be signed but you didn't compile the necessary code to check the signature.");
#endif
}
int byte_entries;
int i;
- WARN("EET file format of '%s' is deprecated. You should just open it one time with mode == EET_FILE_MODE_READ_WRITE to solve this issue.\n", ef->path);
+ WARN("EET file format of '%s' is deprecated. You should just open it one time with mode == EET_FILE_MODE_READ_WRITE to solve this issue.", ef->path);
/* build header table if read mode */
/* geat header */
strncpy(efn->name, (char *)p + HEADER_SIZE, name_size);
efn->name[name_size] = 0;
- WARN("File: %s is not up to date for key \"%s\" - needs rebuilding sometime\n", ef->path, efn->name);
+ WARN("File: %s is not up to date for key \"%s\" - needs rebuilding sometime", ef->path, efn->name);
}
else
/* The only really usefull peace of code for efn->name (no backward compatibility) */