// isRaw and password is for the case that the xml is packed in zip. bool Scriptor::parse_file(const char* fname, const char* password,bool isRaw){ //FileIO* fi = new FileIO(fname,password); //not used,just test under ////////////////////////////////////////////////////////////////////////// do { CCLOG(">REad File Prepare..."); unsigned long filesize; string path; GameManager::sharedGameManager()->fullPathFromRelativePath(fname,path); //未打包 char *buffer = (char *)CCFileUtils::sharedFileUtils()->getFileData(path.c_str(), "rb", &filesize); CC_BREAK_IF(!buffer); CCLOG(">Read over and scc"); re_init(); TiXmlDocument doc; doc.Parse(buffer); initcs = new CCArray(); // mapscps = new CCDictionary(); sn = 0; in = 0; dump_to_nodes(&doc); return true; } while (0); return false; }
int main(int ac, char **av, char **env) { t_shell *shell; char *line; if (ac == 1) { av++; line = NULL; shell = init(env); while (42) { re_init(shell); ft_prompt(shell); if (!shell->hist || (shell->hist->str && *shell->hist->str)) new_hist(shell); else if (shell->hist && shell->hist->str) ft_memdel((void **)&shell->hist->str); line = get_line(shell, 0); if (line && (shell->tree = lexor_and_parsor(shell, &line))) main_execution(&shell); } } ft_putmsg(USAGE, NULL); return (0); }
//! void rev_init(void (* rev_handler_fn)(uint8_t dir, uint8_t vel)) { re_init(rev_handler); rev_handler_user=rev_handler_fn; // init timer rev_init_timer(); }
/* * === FUNCTION ====================================================================== * Name: uri_init_regex * Description: Initilises the regular expresion that is used break up the FQP into a * uri object. This function must be the first function called by the * scheduler when it is initlizing the regular expersion object. * ===================================================================================== */ extern int uri_init_regex( regexpr_t *re) { int err = 0; err = re_init(re, RE_ID); if( err == 0 ) { err = re_comp( re, RE_ID, RE, 0, NULL); } return err; }
/** Create and allocate a new regular expression structure. @param max The size of the array of states in the regular expression. @return A pointer to the newly allocated a structure, or NULL on failure. */ t_regexp2 *re_new(t_nfa_ind max) { TRACE_L("re_new"); // Allocate the structure, and check the allocation t_regexp2 *regexpr = (t_regexp2 *)sysmem_newptr(sizeof(t_regexp2)); if (!regexpr) { return NULL; } // Initialize the structure re_init(regexpr, max); // Test the initialization if (regexpr->err != ERR_NONE) { sysmem_freeptr(regexpr); return NULL; } return regexpr; }
bool Scriptor::parse_string(string line){ do { CC_BREAK_IF(line.size()<1); re_init(); initcs = new CCArray(); mapscps = new CCDictionary(); TiXmlDocument doc; doc.Parse(line.c_str()); sn = 0; in = 0; dump_to_nodes(&doc); return true; } while (0); return false; }
int re_pci_activate(struct device *self, int act) { struct re_pci_softc *psc = (struct re_pci_softc *)self; struct rl_softc *sc = &psc->sc_rl; struct ifnet *ifp = &sc->sc_arpcom.ac_if; switch (act) { case DVACT_SUSPEND: if (ifp->if_flags & IFF_RUNNING) re_stop(ifp); break; case DVACT_RESUME: re_reset(sc); if (ifp->if_flags & IFF_UP) re_init(ifp); break; } return (0); }
int init_fsm_suite() { maildir_init(); re_init(); return 0; }
int init_regexp_suite() { re_init(); return 0; }