public void CheckObjList(CM_SRC cm_src, TObj tobj) { TObj objlist[] = tobj.getTObjList(); if (objlist == null) return; for (int i = 0; i < objlist.length; i++) { TObj tmpobj = objlist[i]; CheckObjList(cm_src, tmpobj); String objname = tmpobj.getName(); String fullobjname = tmpobj.getName(); int idx; if ((idx = objname.indexOf('(')) > 0) { objname = objname.substring(0, idx).trim(); } if (tmpobj.getType() == C_FUNCTION_OBJECT) { tmpobj.setKeyValidation(100); if (objname.equals("main")) { mainflag = true; } else if (extern_main_flag(objname, fullobjname) == true) { mainflag = true; log.debug("extern find main", tmpobj.getName()); } else if (fullobjname.indexOf("(TPSVCINFO") > 0) { submainflag = true; if (!hsubmainname.containsKey(objname)) { Integer val = new Integer(0); hsubmainname.put(objname, val); } log.debug("find sub main", tmpobj.getName()); } else if (extern_sub_flag(objname, fullobjname) == true) { submainflag = true; if (!hsubmainname.containsKey(objname)) { Integer val = new Integer(0); hsubmainname.put(objname, val); } log.debug("extern find sub main", tmpobj.getName()); } else { if (!hfunname.containsKey(objname)) { // log.debug("push hash", objname); Integer val = new Integer(0); hfunname.put(objname, val); } } } if (tmpobj.getType() == C_FUNCTION_DECARE || tmpobj.getType() == C_FUNCTION_OBJECT) { TMeta mt[] = tmpobj.getTMetaList(); for (int k = 0; k < mt.length; k++) { if (mt[k].getName().equals("5100410")) { if (mt[k].getValue().startsWith("static ")) { hStaticfun.put(objname, objname); } } } } } }
public long generateGID(String prefix, TObj tobj) { String obj_name = tobj.getName(); if (tobj.getType() == C_FUNCTION_OBJECT) { if (obj_name.indexOf('(') > 0) { obj_name = obj_name.substring(0, obj_name.indexOf('(')).trim(); } obj_name = obj_name.trim(); int cnt = 0; if (hfunname.containsKey(obj_name)) { Integer val = (Integer) hfunname.get(obj_name); cnt = val.intValue(); } if (mainflag) { // || cnt > 0) { String str = new String(); str = filestr + "." + obj_name; tobj.setGID(str); return FileUtil.getGID("<EC>", str); } else if (submainflag) { // || cnt > 0) { String str = new String(); if (hsubmainname.containsKey(obj_name)) { str = obj_name; tobj.setGID(str); return FileUtil.getGID("<EC>", str); } else { str = filestr + "." + obj_name; tobj.setGID(str); return FileUtil.getGID("<EC>", str); } } else { String str = new String(); if (hStaticfun.containsKey(obj_name)) { str = filestr + "." + obj_name; } else str = obj_name; tobj.setGID(str); return FileUtil.getGID("<EC>", str); } } return 0L; }