Skip to content

Commit fa1aab9

Browse files
committed
More informative logs sent to output
1 parent 4fbdd16 commit fa1aab9

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

graphpass.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,28 @@ int main (int argc, char *argv[]) {
129129
printf ("%s ", argv[optind++]);
130130
putchar ('\n');
131131
}
132+
OUTPUT = OUTPUT ? OUTPUT : "OUT/";
132133
PERCENT = PERCENT ? PERCENT : 0.01;
133134
METHODS = METHODS ? METHODS : "d";
134135
DIRECTORY = DIRECTORY ? DIRECTORY : "assets/";
135136
FILENAME = FILENAME ? FILENAME : "miserables.graphml";
136137
char path[strlen(DIRECTORY)+1];
137138
strncpy(path, DIRECTORY, strlen(DIRECTORY)+1);
138-
printf("path: %s \nDIRECTORY: %s \nSIZEOF DIRECTORY: %li \nSTRLEN PATH: %li \n", path, DIRECTORY, sizeof(DIRECTORY), strlen(path));
139+
printf(">>>>>>> GRAPHPASSING >>>>>>>> \n");
140+
printf("DIRECTORY: %s \nSTRLEN PATH: %li \n", DIRECTORY, strlen(path));
141+
printf("OUTPUT DIRECTORY: %s\nPERCENTAGE: %f\n", OUTPUT, PERCENT);
142+
printf("FILE: %s\nMETHODS STRING: %s\n", FILENAME, METHODS);
143+
printf("QUICKRUN: %i\nREPORT: %i\nSAVE: %i\n", QUICKRUN, REPORT, SAVE);
139144
if (FILENAME[0] == '/' && DIRECTORY[strlen(DIRECTORY)] == '/' ){
140145
printf("Removing redundant slashes from filename.\n");
141146
path[strlen(path)+1] = '\0';
142147
}
143148
else if (FILENAME[0] != '/' && DIRECTORY[(sizeof(DIRECTORY)/sizeof(DIRECTORY[0])-2)] != '/') {
144149
printf("Adding slash separator.\n");
145150
strncat(path, "/", 1);
146-
path[sizeof(path)/sizeof(path[0])-1] = '\0';
147151
printf ("Current path: %s.\n", path);
148152
}
149-
int sizeOfPath = (sizeof(path) / sizeof(path[0]));
153+
int sizeOfPath = (strlen(path)+1);
150154
int sizeOfFile = (strlen(FILENAME)+1);
151155
int filepathsize = sizeOfPath + sizeOfFile;
152156

@@ -155,5 +159,6 @@ int main (int argc, char *argv[]) {
155159
printf("Running graphpass on file: %s\n", FILEPATH);
156160
load_graph(FILEPATH);
157161
filter_graph();
162+
printf(">>>> SUCCESS! - Files output to %s\n", OUTPUT);
158163
return 0;
159164
}

include/analyze.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Graphpass -- Network Graph Utilities mode: C -*- */
22
/*
3-
/* Copyright [2018] [Ryan Deschamps]
3+
Copyright [2018] [Ryan Deschamps]
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

include/reports.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Graphpass -- Network Graph Utilities mode: C -*- */
22
/*
3-
/* Copyright [2018] [Ryan Deschamps]
3+
Copyright [2018] [Ryan Deschamps]
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)