/** * Função que recebe o nome do arquivo .class a ser lido. Seguindo o jclasslib. * * @param nome do arquivo ".class" a ser lido. * @return estrutura que representa um classFile. */ classFile* leitorClasse(char * nomeClass){ FILE* file; file = fopen(nomeClass, "rb"); if(file == NULL){ printf("Arquivo não encontrado! Erro ao abrir o arquivo!\n"); return 0; } //Aloca memória para a estrutura do .class classFile* cf = NULL; cf = (classFile*) calloc(sizeof(classFile),1); if(cf == NULL) printf("taNULL"); //Le informações gerais. generalInfo(cf,file); //Le a constant pool constantPool(cf,file); //le informações gerais após a constant pool secondGeneralInfo(cf,file); //liberando ponteiros. fclose(file); //Retorna referencia ao classFile preenchido. return cf; }
bool ClientMonitor::deregisterClient (const std::string& clientId) { IceUtil::Mutex::Lock sync (dataMutex); std::map <const std::string, std::string>::iterator it; if (!exists (clientId)) return false; clientMonitorCallbackMap.erase (clientId); /// If client had checked-out entities notify the backend server for (it = entityToClientMap.begin (); it != entityToClientMap.end (); ++it) { /// If an entity was previously checked-out by the recently de-registered client if ((*it).second == clientId) { frontEndToEntityComm_Prx->clientUpdate (clientId, (*it).first, ENTITY, ALERT, CLIENT_UNREGISTERED); entityToClientMap.erase ((*it).first); } } generalInfo (); return true; }
int main (int argc, char *argv[]) { zoeHMM hmm; /* set the program name */ zoeSetProgramName(argv[0]); zoeSetOption("-durations", 1); zoeSetOption("-general", 0); zoeSetOption("-models", 0); zoeParseOptions(&argc, argv); /* usage */ if (argc != 2) { zoeE("usage: %s <hmm file>\n", argv[0]); zoeM(stderr, 4, "commands:", " -models", " -general", " -durations <length>" ); exit(1); } /* get HMM */ if ((hmm = zoeGetHMM(argv[1])) == NULL) zoeExit("error opening hmm file"); if (zoeOption("-models")) modelInfo(hmm); if (zoeOption("-general")) generalInfo(hmm); if (zoeOption("-durations")) exportDurations(hmm); zoeDeleteHMM(hmm); return 0; }
void ClientMonitor::registerClient (const std::string& clientId, const ClientMonitorCallbackAdapterPtr& callback) { IceUtil::Mutex::Lock sync (dataMutex); FrontEndComm::NewUpdateMsgEventPtr ev; IceUtil::Int64 timestamp; std::map <const std::string, std::string>::iterator it; timestamp = IceUtil::Time::now ().toMilliSeconds (); ev = new FrontEndComm::NewUpdateMsgEvent (timestamp, FRONTEND_SERVER, FRONTEND_SERVER, INFO, REGISTERED); clientMonitorCallbackMap[clientId] = callback; clientMonitorCallbackMap[clientId]->newUpdateMsg (ev); /// Send all entity profiles to each newly registered client for (it = entityBasicPrflMap.begin (); it != entityBasicPrflMap.end (); ++it) { FrontEndComm::NewBasicPrflMsgEventPtr ev; ev = new FrontEndComm::NewBasicPrflMsgEvent (timestamp, (*it).first, ENTITY, (*it).second); clientMonitorCallbackMap[clientId]->newBasicPrflMsg (ev); } generalInfo (); }
void DebugInfo::printGeneralInfo() { print(generalInfo()); }