Display nspr version info. by default.

This commit is contained in:
srinivas%netscape.com 1999-02-09 03:34:09 +00:00
Родитель a7122489b6
Коммит d681340296
1 изменённых файлов: 38 добавлений и 37 удалений

Просмотреть файл

@ -32,6 +32,8 @@ PRIntn main(PRIntn argc, char **argv)
PRLibrary *runtime = NULL;
const char *library_name = NULL;
const PRVersionDescription *version_info;
char buffer[100];
PRExplodedTime exploded;
PLOptState *opt = PL_CreateOptState(argc, argv, "d");
PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
@ -54,22 +56,24 @@ PRIntn main(PRIntn argc, char **argv)
}
PL_DestroyOptState(opt);
if (NULL == library_name)
PR_fprintf(err, "Usage: version [-d] {fully qualified library name}\n");
else
if (NULL != library_name)
{
runtime = PR_LoadLibrary(library_name);
if (NULL == runtime) PL_FPrintError(err, "PR_LoadLibrary");
else
{
if (NULL == runtime) {
PL_FPrintError(err, "PR_LoadLibrary");
return 3;
} else {
versionEntryPointType versionPoint = (versionEntryPointType)
PR_FindSymbol(runtime, "libVersionPoint");
if (NULL == versionPoint) PL_FPrintError(err, "PR_FindSymbol");
else
{
char buffer[100];
PRExplodedTime exploded;
if (NULL == versionPoint) {
PL_FPrintError(err, "PR_FindSymbol");
return 4;
}
version_info = versionPoint();
}
} else
version_info = libVersionPoint(); /* NSPR's version info */
(void)PR_fprintf(err, "Runtime library version information\n");
PR_ExplodeTime(
version_info->buildTime, PR_GMTParameters, &exploded);
@ -92,9 +96,6 @@ PRIntn main(PRIntn argc, char **argv)
(void)PR_fprintf(err, " copyright: %s\n", version_info->copyright);
(void)PR_fprintf(err, " comment: %s\n", version_info->comment);
rv = 0;
}
}
}
return rv;
}