Lines Matching refs:cpe
171 static void freeCpeArray(ClassPathEntry* cpe);
504 static void dumpClassPath(const ClassPathEntry* cpe) in dumpClassPath() argument
508 while (cpe->kind != kCpeLastEntry) { in dumpClassPath()
511 switch (cpe->kind) { in dumpClassPath()
517 LOGI(" %2d: type=%s %s %p", idx, kindStr, cpe->fileName, cpe->ptr); in dumpClassPath()
518 if (CALC_CACHE_STATS && cpe->kind == kCpeJar) { in dumpClassPath()
519 JarFile* pJarFile = (JarFile*) cpe->ptr; in dumpClassPath()
524 cpe++; in dumpClassPath()
540 bool dvmClassPathContains(const ClassPathEntry* cpe, const char* path) in dvmClassPathContains() argument
542 while (cpe->kind != kCpeLastEntry) { in dvmClassPathContains()
543 if (strcmp(cpe->fileName, path) == 0) in dvmClassPathContains()
546 cpe++; in dvmClassPathContains()
556 static void freeCpeArray(ClassPathEntry* cpe) in freeCpeArray() argument
558 ClassPathEntry* cpeStart = cpe; in freeCpeArray()
560 if (cpe == NULL) in freeCpeArray()
563 while (cpe->kind != kCpeLastEntry) { in freeCpeArray()
564 switch (cpe->kind) { in freeCpeArray()
567 dvmJarFileFree((JarFile*) cpe->ptr); in freeCpeArray()
571 dvmRawDexFileFree((RawDexFile*) cpe->ptr); in freeCpeArray()
578 free(cpe->fileName); in freeCpeArray()
579 cpe++; in freeCpeArray()
603 static bool prepareCpe(ClassPathEntry* cpe, bool isBootstrap) in prepareCpe() argument
607 if (stat(cpe->fileName, &sb) < 0) { in prepareCpe()
608 LOGD("Unable to stat classpath element '%s'", cpe->fileName); in prepareCpe()
612 LOGE("Directory classpath elements are not supported: %s", cpe->fileName); in prepareCpe()
617 getFileNameSuffix(cpe->fileName, suffix, sizeof(suffix)); in prepareCpe()
622 if (dvmJarFileOpen(cpe->fileName, NULL, &pJarFile, isBootstrap) == 0) { in prepareCpe()
623 cpe->kind = kCpeJar; in prepareCpe()
624 cpe->ptr = pJarFile; in prepareCpe()
629 if (dvmRawDexFileOpen(cpe->fileName, NULL, &pRawDexFile, isBootstrap) == 0) { in prepareCpe()
630 cpe->kind = kCpeDex; in prepareCpe()
631 cpe->ptr = pRawDexFile; in prepareCpe()
638 LOGD("Unable to process classpath element '%s'", cpe->fileName); in prepareCpe()
656 ClassPathEntry* cpe = NULL; in processClassPath() local
685 cpe = (ClassPathEntry*) calloc(count+1, sizeof(ClassPathEntry)); in processClassPath()
690 gDvm.bootClassPath = cpe; in processClassPath()
704 free(cpe); in processClassPath()
705 cpe = NULL; in processClassPath()
718 cpe[idx].kind = kCpeLastEntry; in processClassPath()
719 cpe[idx].fileName = NULL; in processClassPath()
720 cpe[idx].ptr = NULL; in processClassPath()
727 cpe[idx] = tmp; in processClassPath()
748 cpe[idx].kind = kCpeLastEntry; in processClassPath()
749 cpe[idx].fileName = NULL; in processClassPath()
750 cpe[idx].ptr = NULL; in processClassPath()
756 gDvm.bootClassPath = cpe; in processClassPath()
757 return cpe; in processClassPath()
770 const ClassPathEntry* cpe = gDvm.bootClassPath; in searchBootPathForClass() local
777 while (cpe->kind != kCpeLastEntry) { in searchBootPathForClass()
780 switch (cpe->kind) { in searchBootPathForClass()
783 JarFile* pJarFile = (JarFile*) cpe->ptr; in searchBootPathForClass()
799 RawDexFile* pRawDexFile = (RawDexFile*) cpe->ptr; in searchBootPathForClass()
814 LOGE("Unknown kind %d", cpe->kind); in searchBootPathForClass()
819 cpe++; in searchBootPathForClass()
865 const ClassPathEntry* cpe = gDvm.bootClassPath; in dvmGetBootPathSize() local
867 while (cpe->kind != kCpeLastEntry) in dvmGetBootPathSize()
868 cpe++; in dvmGetBootPathSize()
870 return cpe - gDvm.bootClassPath; in dvmGetBootPathSize()
887 const ClassPathEntry* cpe = gDvm.bootClassPath; in dvmGetBootPathResource() local
891 name, idx, cpe[idx].fileName); in dvmGetBootPathResource()
894 while (idx-- && cpe->kind != kCpeLastEntry) in dvmGetBootPathResource()
895 cpe++; in dvmGetBootPathResource()
896 if (cpe->kind == kCpeLastEntry) { in dvmGetBootPathResource()
901 char urlBuf[strlen(name) + strlen(cpe->fileName) + kUrlOverhead +1]; in dvmGetBootPathResource()
903 switch (cpe->kind) { in dvmGetBootPathResource()
906 JarFile* pJarFile = (JarFile*) cpe->ptr; in dvmGetBootPathResource()
909 sprintf(urlBuf, "jar:file://%s!/%s", cpe->fileName, name); in dvmGetBootPathResource()