/* * Build a machine dependent library name out of a path and file name. */ void dbgsysBuildLibName(char *holder, int holderlen, const char *pname, const char *fname) { const int pnamelen = pname ? (int)strlen(pname) : 0; *holder = '\0'; /* Quietly truncates on buffer overflow. Should be an error. */ if (pnamelen + (int)strlen(fname) + 10 > holderlen) { return; } if (pnamelen == 0) { sprintf(holder, "%s.dll", fname); } else { dll_build_name(holder, holderlen, pname, fname); } }
/* * create a string for the dynamic lib open call by adding the * appropriate pre and extensions to a filename and the path */ void dbgsysBuildLibName(char *holder, int holderlen, char *pname, char *fname) { const int pnamelen = pname ? strlen(pname) : 0; *holder = '\0'; /* Quietly truncate on buffer overflow. Should be an error. */ if (pnamelen + (int)strlen(fname) + 10 > holderlen) { return; } if (pnamelen == 0) { (void)snprintf(holder, holderlen, "lib%s." LIB_SUFFIX, fname); } else { dll_build_name(holder, holderlen, pname, fname); } }
/* Build a machine dependent library name out of a path and file name. */ void md_build_library_name(char *holder, int holderlen, const char *pname, const char *fname) { int pnamelen; pnamelen = pname ? (int)strlen(pname) : 0; *holder = '\0'; /* Quietly truncates on buffer overflow. Should be an error. */ if (pnamelen + strlen(fname) + 10 > (unsigned int)holderlen) { return; } if (pnamelen == 0) { sprintf(holder, "%s.dll", fname); } else { dll_build_name(holder, holderlen, pname, fname); } }
/* Create the actual fill filename for a dynamic library. */ void md_build_library_name(char *holder, int holderlen, const char *pname, const char *fname) { int pnamelen; /* Length of options directory location. */ pnamelen = pname ? strlen(pname) : 0; *holder = '\0'; /* Quietly truncate on buffer overflow. Should be an error. */ if (pnamelen + (int)strlen(fname) + 10 > holderlen) { return; } /* Construct path to library */ if (pnamelen == 0) { (void)snprintf(holder, holderlen, "lib%s" JNI_LIB_SUFFIX, fname); } else { dll_build_name(holder, holderlen, pname, fname); } }