예제 #1
0
파일: if_pppd.c 프로젝트: pasis/pppoat
static int if_module_pppd_init(struct pppoat_conf *conf, void **userdata)
{
	struct pppd_ctx *ctx;
	const char      *obj;
	int              rc;

	ctx = pppoat_alloc(sizeof(*ctx));
	rc  = ctx == NULL ? P_ERR(-ENOMEM) : 0;
	if (rc == 0) {
		ctx->pc_ip   = NULL;
		ctx->pc_pppd = pppd_find();
		rc = ctx->pc_pppd == NULL ? P_ERR(-ENOENT) : 0;
		if (rc != 0)
			pppoat_free(ctx);
	}

	if (rc == 0) {
		obj = pppoat_conf_get(conf, "server");
		/* XXX make more flexible ip configuration */
		if (obj != NULL && pppoat_conf_obj_is_true(obj))
			ctx->pc_ip = "10.0.0.1:10.0.0.2";
		*userdata = ctx;
	}
	return rc;
}
logical ODE_SearchReplace :: OpenPHs ( )
{
  logical                 term = NO;
BEGINSEQ
  if ( IsValid() )                                   LEAVESEQ
    
  if ( Open(dictionary,"FORM_SearchReplace") )
  {
    P_SDBCERR
    P_ERR(ODABA_ERROR)
  }
  
  search_string.Open(GPH("search_string"));
  replace_string.Open(GPH("replace_string"));
  location.Open(GPH("location"));
  replace.Open(GPH("replace"));
  replace_all.Open(GPH("replace_all"));
  backwards.Open(GPH("backwards"));
  case_sensitive.Open(GPH("case_sensitive"));
  is_regex.Open(GPH("is_regex"));  

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
예제 #3
0
int8 cODCProject :: DoBeforeDataSet ( )
{
  pODE              *ode_ctx    = ODEContext(this);
  char               term    = NO;
BEGINSEQ
  if ( !ode_ctx->IsActionToggled("ProjectSelection") ) LEAVESEQ
  
  pc1_ODC_Project   prop_pc(GetBasePropertyHandle());
  
  if ( !prop_pc.Exist() )                            P_ERR(99)
  if ( !prop_pc.Get(AUTO) )                          P_SDBCERR
    
  if ( !prop_pc.IsImplemented(NO) )                  ERROR
RECOVER
  term = YES;
ENDSEQ
  return(term);
}