use a list instead of a string to store the names of installed packages

This commit is contained in:
Axel Kohlmeyer
2018-06-20 17:57:17 -04:00
parent 9f3fae1c47
commit 9f3cb83fb3
2 changed files with 18 additions and 5 deletions

View File

@ -826,7 +826,7 @@ void LAMMPS::help()
print_config(fp);
fprintf(fp,"List of style options included in this LAMMPS executable\n\n");
fprintf(fp,"List of individual style options included in this LAMMPS executable\n\n");
int pos = 80;
fprintf(fp,"* Atom styles:\n");
@ -1060,6 +1060,19 @@ static const char lammps_config_options[]
void LAMMPS::print_config(FILE *fp)
{
const char *pkg;
int ncword, ncline = 0;
fputs(lammps_config_options,fp);
fprintf(fp,"Installed packages:%s\n\n",lammps_installed_packages);
fputs("Installed packages:\n\n",fp);
for (int i = 0; NULL != (pkg = lammps_installed_packages[i]); ++i) {
ncword = strlen(pkg);
if (ncline + ncword > 78) {
ncline = 0;
fputs("\n",fp);
}
fprintf(fp,"%s ",pkg);
ncline += ncword + 1;
}
fputs("\n\n",fp);
}