Update logfile.c function parameters

This commit is contained in:
jsteube
2016-10-06 16:25:24 +02:00
parent 662ddec0bb
commit 000534cdbc
5 changed files with 42 additions and 29 deletions

View File

@@ -23,8 +23,10 @@ static int logfile_generate_id ()
return t + n;
}
void logfile_generate_topid (logfile_ctx_t *logfile_ctx)
void logfile_generate_topid (hashcat_ctx_t *hashcat_ctx)
{
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
if (logfile_ctx->enabled == false) return;
const int id = logfile_generate_id ();
@@ -32,8 +34,10 @@ void logfile_generate_topid (logfile_ctx_t *logfile_ctx)
snprintf (logfile_ctx->topid, 1 + 16, "TOP%08x", id);
}
void logfile_generate_subid (logfile_ctx_t *logfile_ctx)
void logfile_generate_subid (hashcat_ctx_t *hashcat_ctx)
{
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
if (logfile_ctx->enabled == false) return;
const int id = logfile_generate_id ();
@@ -41,8 +45,10 @@ void logfile_generate_subid (logfile_ctx_t *logfile_ctx)
snprintf (logfile_ctx->subid, 1 + 16, "SUB%08x", id);
}
void logfile_append (const logfile_ctx_t *logfile_ctx, const char *fmt, ...)
void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
{
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
if (logfile_ctx->enabled == false) return;
FILE *fp = fopen (logfile_ctx->logfile, "ab");
@@ -62,8 +68,12 @@ void logfile_append (const logfile_ctx_t *logfile_ctx, const char *fmt, ...)
fclose (fp);
}
void logfile_init (logfile_ctx_t *logfile_ctx, const user_options_t *user_options, const folder_config_t *folder_config)
void logfile_init (hashcat_ctx_t *hashcat_ctx)
{
folder_config_t *folder_config = hashcat_ctx->folder_config;
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->logfile_disable == true) return;
logfile_ctx->logfile = (char *) mymalloc (HCBUFSIZ_TINY);
@@ -76,8 +86,10 @@ void logfile_init (logfile_ctx_t *logfile_ctx, const user_options_t *user_option
logfile_ctx->enabled = true;
}
void logfile_destroy (logfile_ctx_t *logfile_ctx)
void logfile_destroy (hashcat_ctx_t *hashcat_ctx)
{
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
if (logfile_ctx->enabled == false) return;
myfree (logfile_ctx->logfile);