static void OnQueryClientInfo(ipcClient *client, const ipcMessage *rawMsg) { LOG(("got QUERY_CLIENT_INFO\n")); ipcMessageCast<ipcmMessageQueryClientInfo> msg(rawMsg); ipcClient *result = IPC_GetClientByID(msg->ClientID()); if (result) { char **names = BuildStringArray(result->Names()); nsID **targets = BuildIDArray(result->Targets()); IPC_SendMsg(client, new ipcmMessageClientInfo(result->ID(), msg->RequestIndex(), (const char **) names, (const nsID **) targets)); free(names); free(targets); } else { LOG((" client does not exist\n")); IPC_SendMsg(client, new ipcmMessageError(IPCM_ERROR_CLIENT_NOT_FOUND, msg->RequestIndex())); } }
//---------------------------------------------------------------------------- void ProcessOpenGLBlock(std::ifstream& input, std::ofstream& output, std::string const& version) { std::string line, token; Prototype fnp; std::vector<std::string> pfntypes; std::vector<Prototype> fnprotos; // Start processing after the line "#ifndef version". int const imax = 1024; int i; for (i = 0; i < imax; ++i) { getline(input, line); assert(input.good()); if (line.find(version) != std::string::npos) { break; } } assert(i < imax); // Discard the line "#define version 1". getline(input, line); assert(input.good()); // Get the function pointer types. Stop when "#ifdef GL_GLEXT_PROTOTYPES" // is encountered. for (i = 0; i < imax; ++i) { getline(input, line); assert(input.good()); if (line.find("GL_GLEXT_PROTOTYPES") == std::string::npos) { token = GetFunctionPointerType(line); if (token != "") { pfntypes.push_back(token); } } else { break; } } assert(i < imax); // Get the function prototypes. Stop when "#endif /* version */" is // encountered for (i = 0; i < imax; ++i) { getline(input, line); assert(input.good()); if (line.find(version) == std::string::npos) { fnp = ParseFunctionPrototype(line); if (fnp.returnType != "") { fnprotos.push_back(fnp); } } else { break; } } assert(i < imax); assert(pfntypes.size() == fnprotos.size()); // Generate the source code. std::vector<std::string> preamble, functions, postamble; BuildStringArray(version, pfntypes, fnprotos, preamble, functions, postamble); for (size_t j = 0; j < preamble.size(); ++j) { output << preamble[j] << std::endl; } for (size_t j = 0; j < functions.size(); ++j) { output << functions[j] << std::endl; } for (size_t j = 0; j < postamble.size(); ++j) { output << postamble[j] << std::endl; } }