tincreased readability on list output - sphere - GPU-based 3D discrete element … | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 8aaf2c7c63ea6ef9644e95b9a5c42ecb8c094faa | |
parent 970d040a2ab68317f919a98202a5f5b45e656d3f | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 9 May 2014 09:50:36 +0200 | |
increased readability on list output | |
Diffstat: | |
M src/sphere_status.c | 11 ++++++++--- | |
1 file changed, 8 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/src/sphere_status.c b/src/sphere_status.c | |
t@@ -28,6 +28,8 @@ int main(int argc, char *argv[]) | |
struct dirent *ent; | |
char outputdir[1000]; | |
char* dotpos; | |
+ char outstring[100]; | |
+ char* p; | |
sprintf(outputdir, "%s/output/", cwd); | |
if ((dir = opendir(outputdir)) != NULL) { | |
puts("Simulations with the following ID's are found in the " | |
t@@ -36,9 +38,12 @@ int main(int argc, char *argv[]) | |
while ((ent = readdir(dir)) != NULL) { | |
if ((dotpos = strstr(ent->d_name, ".status.dat")) != NULL) { | |
*dotpos = '\0'; | |
- printf("\t%s\t(", ent->d_name); | |
+ sprintf(outstring, "%-44s ", ent->d_name); | |
+ for (p = outstring; *p != '\0'; p++) | |
+ if (*p == ' ') *p = '.'; | |
+ printf(" %s ", outstring); | |
(void)open_status_file(cwd, ent->d_name, 1); | |
- puts(")"); | |
+ puts(""); | |
} | |
} | |
t@@ -90,7 +95,7 @@ int open_status_file(char* cwd, char* sim_name, int format) { | |
} | |
if (format == 1) { | |
- printf("%.2f s / %.0f %% / %d", | |
+ printf("%.2fs / %3.0f%% / %5d", | |
time_current, time_percentage, file_nr); | |
} else { | |
printf("Reading %s:\n" |