Config-Augeas

 view release on metacpan or  search on metacpan

lib/Config/Augeas.xs  view on Meta::CPAN

 # returns an array ( return value, created ) 
void
aug_defnode(aug, name, expr, value)
      Config_Augeas* aug
      const char* name
      const char* expr
      const char* value
    PREINIT:
      int created ;
      int ret ;
    PPCODE:
      created = 1 ;
      ret = aug_defnode(aug, name, expr, value, &created ) ;
      if (ret >= 0 ) {
        XPUSHs(sv_2mortal(newSVnv(ret)));
        XPUSHs(sv_2mortal(newSVnv(created)));
      }

const char*
aug_get(aug, path)
      Config_Augeas* aug

lib/Config/Augeas.xs  view on Meta::CPAN

      const char *pattern
    PREINIT:
        char** matches;
        char** err_matches;
        const char*  err_string ;
        int i ;
        int ret ;
	int cnt;
	char die_msg[1024] ;
	char tmp_msg[128];
    PPCODE:
    
        cnt = aug_match(aug, pattern, &matches);

        if (cnt == -1) {
	   sprintf(die_msg, "aug_match error with pattern '%s':\n",pattern);
    	   cnt = aug_match(aug,"/augeas//error/descendant-or-self::*",&err_matches);
	   for (i=0; i < cnt; i++) {
               ret = aug_get(aug, err_matches[i], &err_string) ;
	       sprintf(tmp_msg,"%s = %s\n", err_matches[i], err_string );
	       if (strlen(die_msg) + strlen(tmp_msg) < 1024 )



( run in 2.020 seconds using v1.01-cache-2.11-cpan-71847e10f99 )