当前位置: 首页>>代码示例>>C++>>正文


C++ DBG_ERROR函数代码示例

本文整理汇总了C++中DBG_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ DBG_ERROR函数的具体用法?C++ DBG_ERROR怎么用?C++ DBG_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DBG_ERROR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GWEN_Date_fromGregorian

GWEN_DATE *GWEN_Date_fromString(const char *s) {
    int y, m, d;

    if (3==sscanf(s, "%04d%02d%02d", &y, &m, &d)) {
        GWEN_DATE *result = GWEN_Date_fromGregorian(y, m, d);
        if (!result)
            DBG_ERROR(GWEN_LOGDOMAIN, "Bad date string [%s]", s);
        return result;
    }
    else {
        DBG_ERROR(GWEN_LOGDOMAIN, "Bad date string [%s]", s);
        return NULL;
    }
}
开发者ID:aqbanking,项目名称:gwenhywfar,代码行数:14,代码来源:gwendate.c

示例2: AB_SetupDialog_EditAccount

int AB_SetupDialog_EditAccount(GWEN_DIALOG *dlg)
{
  AB_SETUP_DIALOG *xdlg;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, AB_SETUP_DIALOG, dlg);
  assert(xdlg);

  if (xdlg->currentAccountList) {
    uint32_t aid;

    aid=AB_SetupDialog_GetCurrentAccountId(dlg);
    if (aid) {
      AB_ACCOUNT *a;

      a=AB_Account_List_GetByUniqueId(xdlg->currentAccountList, aid);
      if (a) {
        AB_PROVIDER *pro;
        uint32_t flags=0;
        GWEN_DIALOG *dlg2;
        int rv;

        pro=AB_Account_GetProvider(a);
        assert(pro);
        flags=AB_Provider_GetFlags(pro);
        if (flags & AB_PROVIDER_FLAGS_HAS_EDITACCOUNT_DIALOG)
          dlg2=AB_Provider_GetEditAccountDialog(pro, a);
        else
          dlg2=AB_EditAccountDialog_new(pro, a, 1);
        if (dlg2==NULL) {
          DBG_ERROR(AQBANKING_LOGDOMAIN, "Could not create dialog");
          return GWEN_DialogEvent_ResultHandled;
        }

        rv=GWEN_Gui_ExecDialog(dlg2, 0);
        if (rv==0) {
          /* rejected */
          GWEN_Dialog_free(dlg2);
          return GWEN_DialogEvent_ResultHandled;
        }
        GWEN_Dialog_free(dlg2);
        AB_SetupDialog_Reload(dlg);
      } /* if a */
    } /* if aid */
    else {
      DBG_ERROR(AQBANKING_LOGDOMAIN, "No current account");
    }
  } /* if xdlg->currentAccountList */
  return GWEN_DialogEvent_ResultHandled;
}
开发者ID:cstim,项目名称:aqbanking,代码行数:50,代码来源:dlg_setup.c

示例3: upload

static int
upload(CBM_FILE fd, unsigned char drive)
{
    enum cbm_device_type_e driveType;
    const unsigned char *pp_drive_prog = 0;
    unsigned int pp_drive_prog_length = 0;
    unsigned int bytesWritten;

    if (cbm_identify(fd, drive, &driveType, NULL))
        return 1;

    switch (driveType)
    {
    case cbm_dt_cbm1581:
        DBG_ERROR((DBG_PREFIX "1581 not supported!"));
        return 1;

    case cbm_dt_cbm1541:
        DBG_PRINT((DBG_PREFIX "recognized 1541."));
        pp_drive_prog = pp1541_drive_prog;
        pp_drive_prog_length = sizeof(pp1541_drive_prog);
        break;

    case cbm_dt_cbm1570:
    case cbm_dt_cbm1571:
        DBG_PRINT((DBG_PREFIX "recognized 1571."));
        pp_drive_prog = pp1571_drive_prog;
        pp_drive_prog_length = sizeof(pp1571_drive_prog);
        break;

    case cbm_dt_unknown:
        /* FALL THROUGH */

    default:
        DBG_ERROR((DBG_PREFIX "unknown device type!"));
        return 1;
    }

    bytesWritten = cbm_upload(fd, drive, 0x700, pp_drive_prog, pp_drive_prog_length);

    if (bytesWritten != pp_drive_prog_length)
    {
        DBG_ERROR((DBG_PREFIX "wanted to write %u bytes, but only %u "
            "bytes could be written", pp_drive_prog_length, bytesWritten));

        return 1;
    }

    return 0;
}
开发者ID:Flaviowebit,项目名称:openCBM,代码行数:50,代码来源:pp.c

示例4: OH_GetInstituteDialog_HandleActivated

int OH_GetInstituteDialog_HandleActivated(GWEN_DIALOG *dlg, const char *sender)
{
  OH_GETINST_DIALOG *xdlg;

  assert(dlg);
  xdlg=GWEN_INHERIT_GETDATA(GWEN_DIALOG, OH_GETINST_DIALOG, dlg);
  assert(xdlg);

  DBG_ERROR(0, "Activated: %s", sender);
  if (strcasecmp(sender, "listBox")==0) {
    OH_INSTITUTE_SPEC *os;

    os=OH_GetInstituteDialog_DetermineSelectedBankInfo(dlg);
    GWEN_Dialog_SetIntProperty(dlg, "okButton", GWEN_DialogProperty_Enabled, 0, os?1:0, 0);

    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "nameEdit")==0) {
    OH_GetInstituteDialog_UpdateList(dlg);
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "okButton")==0) {
    OH_INSTITUTE_SPEC *os;

    os=OH_GetInstituteDialog_DetermineSelectedBankInfo(dlg);
    if (os) {
      const OH_INSTITUTE_DATA *od;

      od=OfxHome_GetData(xdlg->ofxHome, OH_InstituteSpec_GetId(os));
      if (od) {
        OH_InstituteData_free(xdlg->selectedData);
        xdlg->selectedData=OH_InstituteData_dup(od);
        return GWEN_DialogEvent_ResultAccept;
      }
      else {
        DBG_ERROR(AQOFXCONNECT_LOGDOMAIN, "No institute data for id=%d",
                  OH_InstituteSpec_GetId(os));
      }
    }
    return GWEN_DialogEvent_ResultHandled;
  }
  else if (strcasecmp(sender, "abortButton")==0)
    return GWEN_DialogEvent_ResultReject;
  else if (strcasecmp(sender, "wiz_help_button")==0) {
    /* TODO: open a help dialog */
  }

  return GWEN_DialogEvent_ResultNotHandled;
}
开发者ID:cstim,项目名称:aqbanking,代码行数:49,代码来源:dlg_getinst.c

示例5: DBG_ERROR

char *getHomeDir(char *buffer, unsigned int size) {
  struct passwd *pw;

  pw=getpwuid(getuid());
  if (!pw) {
    DBG_ERROR("No pwent for this user");
    return 0;
  }
  if (size<strlen(pw->pw_dir)) {
    DBG_ERROR("Buffer too small");
    return 0;
  }
  strcpy(buffer, pw->pw_dir);
  return buffer;
}
开发者ID:BackupTheBerlios,项目名称:aqbackup,代码行数:15,代码来源:aqbackup.c

示例6: LC_DDVCard_GetSignKeyVersion0

int LC_DDVCard_GetSignKeyVersion0(LC_CARD *card){
  LC_DDVCARD *ddv;
  LC_CLIENT_RESULT res;
  GWEN_DB_NODE *dbRecord;
  GWEN_BUFFER *mbuf;
  int keyVer;

  assert(card);
  ddv=GWEN_INHERIT_GETDATA(LC_CARD, LC_DDVCARD, card);
  assert(ddv);

  res=LC_Card_SelectEf(card, "EF_KEYD");
  if (res!=LC_Client_ResultOk) {
    DBG_INFO(LC_LOGDOMAIN, "here");
    return -1;
  }

  mbuf=GWEN_Buffer_new(0, 4, 0, 1);
  res=LC_Card_IsoReadRecord(card,
                            LC_CARD_ISO_FLAGS_RECSEL_GIVEN,
                            1 /* should be 2 */,
                            mbuf);
  if (res!=LC_Client_ResultOk) {
    DBG_INFO(LC_LOGDOMAIN, "here");
    GWEN_Buffer_free(mbuf);
    return -1;
  }
  GWEN_Buffer_Rewind(mbuf);
  dbRecord=GWEN_DB_Group_new("autd");
  if (LC_Card_ParseRecord(card,
                          1 /* should be 2, but that doesn't work */,
                          mbuf, dbRecord)) {
    DBG_ERROR(LC_LOGDOMAIN, "Error parsing record");
    GWEN_DB_Group_free(dbRecord);
    GWEN_Buffer_free(mbuf);
    return -1;
  }
  GWEN_Buffer_free(mbuf);

  keyVer=GWEN_DB_GetIntValue(dbRecord, "keyVersion", 0, -1);
  GWEN_DB_Group_free(dbRecord);

  if (keyVer==-1) {
    DBG_ERROR(LC_LOGDOMAIN, "No keyVersion in record 2 of EF_KEYD");
  }

  return keyVer;
}
开发者ID:aqbanking,项目名称:libchipcard,代码行数:48,代码来源:ddvcard.c

示例7: setColumnValueFromCombo

static int setColumnValueFromCombo(GWEN_DIALOG *dlg,
                                   GWEN_DB_NODE *db,
                                   const char *varName,
                                   const char *comboBoxName,
                                   const char **strings)
{
  int i;
  int j;

  /* count number of string entries */
  for (j=0; ; j+=2) {
    if (strings[j]==NULL)
      break;
  }
  j>>=1;

  i=GWEN_Dialog_GetIntProperty(dlg, comboBoxName, GWEN_DialogProperty_Value, 0, -1);
  if (i<0 || i>=j) {
    DBG_ERROR(AQBANKING_LOGDOMAIN, "Index %d of %s out of range (%d)", i, comboBoxName, j);
    return GWEN_ERROR_INVALID;
  }
  if (i!=0)
    GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, varName, strings[i*2]);
  return 0;
}
开发者ID:cstim,项目名称:aqbanking,代码行数:25,代码来源:csv_editprofile.c

示例8: AB_Banking_SaveUser

int AB_Banking_SaveUser(AB_BANKING *ab, AB_USER *u) {
  GWEN_DB_NODE *db;
  GWEN_DB_NODE *dbP;
  int rv;

  db=GWEN_DB_Group_new("user");
  AB_User_toDb(u, db);
  dbP=GWEN_DB_GetGroup(db, GWEN_DB_FLAGS_DEFAULT,
		       "data/backend");
  rv=AB_Provider_ExtendUser(AB_User_GetProvider(u), u,
			    AB_ProviderExtendMode_Save,
			    dbP);
  if (rv) {
    DBG_INFO(AQBANKING_LOGDOMAIN, "here (%d)", rv);
    GWEN_DB_Group_free(db);
    return rv;
  }

  /* save group (still locked) */
  rv=GWEN_ConfigMgr_SetGroup(ab->configMgr,
			     AB_CFG_GROUP_USERS,
			     AB_User_GetDbId(u),
			     db);
  if (rv<0) {
    DBG_ERROR(AQBANKING_LOGDOMAIN, "Could not save user group (%d)", rv);
    GWEN_DB_Group_free(db);
    return rv;
  }
  GWEN_DB_Group_free(db);

  return 0;
}
开发者ID:Zauberstuhl,项目名称:aqbanking,代码行数:32,代码来源:banking_cfg.c

示例9: DBG_ENTER

/**
 * et131x_device_alloc
 *
 * Returns pointer to the allocated and initialized net_device struct for
 * this device.
 *
 * Create instances of net_device and wl_private for the new adapter and
 * register the device's entry points in the net_device structure.
 */
struct net_device *et131x_device_alloc(void)
{
	struct net_device *netdev;

	DBG_ENTER(et131x_dbginfo);

	/* Alloc net_device and adapter structs */
	netdev = alloc_etherdev(sizeof(struct et131x_adapter));

	if (netdev == NULL) {
		DBG_ERROR(et131x_dbginfo,
			  "Alloc of net_device struct failed\n");
		DBG_LEAVE(et131x_dbginfo);
		return NULL;
	}

	/* Setup the function registration table (and other data) for a
	 * net_device
	 */
	//netdev->init               = &et131x_init;
	//netdev->set_config = &et131x_config;
	netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
	netdev->netdev_ops = &et131x_netdev_ops;

	//netdev->ethtool_ops        = &et131x_ethtool_ops;

	// Poll?
	//netdev->poll               = &et131x_poll;
	//netdev->poll_controller    = &et131x_poll_controller;

	DBG_LEAVE(et131x_dbginfo);
	return netdev;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:42,代码来源:et131x_netdev.c

示例10: LC_DDVCard_GetKeyVersion1

int LC_DDVCard_GetKeyVersion1(LC_CARD *card, int keyNumber){
  LC_DDVCARD *ddv;
  GWEN_DB_NODE *dbReq;
  GWEN_DB_NODE *dbResp;
  LC_CLIENT_RESULT res;
  int keyVersion;

  assert(card);
  ddv=GWEN_INHERIT_GETDATA(LC_CARD, LC_DDVCARD, card);
  assert(ddv);

  dbReq=GWEN_DB_Group_new("GetKeyInfo");
  dbResp=GWEN_DB_Group_new("response");
  GWEN_DB_SetIntValue(dbReq, GWEN_DB_FLAGS_DEFAULT,
                      "keyNumber", keyNumber);
  res=LC_Card_ExecCommand(card, "GetKeyInfo", dbReq, dbResp);
  if (res!=LC_Client_ResultOk) {
    GWEN_DB_Group_free(dbReq);
    GWEN_DB_Group_free(dbResp);
    return -1;
  }

  keyVersion=GWEN_DB_GetIntValue(dbResp,
                                 "response/keyVersion", 0, -1);
  if (keyVersion==-1) {
    DBG_ERROR(LC_LOGDOMAIN, "No keyversion returned by command");
  }
  GWEN_DB_Group_free(dbReq);
  GWEN_DB_Group_free(dbResp);
  return keyVersion;
}
开发者ID:aqbanking,项目名称:libchipcard,代码行数:31,代码来源:ddvcard.c

示例11: AH_Msg_DecryptRdh

int AH_Msg_DecryptRdh(AH_MSG *hmsg, GWEN_DB_NODE *gr){
  AB_USER *u;
  int rv;

  assert(hmsg);
  u=AH_Dialog_GetDialogOwner(hmsg->dialog);

  switch(AH_User_GetRdhType(u)) {
  case 0:
  case 1:
    rv=AH_Msg_DecryptRdh1(hmsg, gr);
    break;
  case 2:
    rv=AH_Msg_DecryptRdh2(hmsg, gr);
    break;
  case 3:
    rv=AH_Msg_DecryptRdh3(hmsg, gr);
    break;
  case 5:
    rv=AH_Msg_DecryptRdh5(hmsg, gr);
    break;
  case 9:
    rv=AH_Msg_DecryptRdh9(hmsg, gr);
    break;
  case 10:
    rv=AH_Msg_DecryptRdh10(hmsg, gr);
    break;
  default:
    DBG_ERROR(AQHBCI_LOGDOMAIN, "RDH %d not supported", AH_User_GetRdhType(u));
    rv=GWEN_ERROR_INVALID;
  }

  return rv;
}
开发者ID:aqbanking,项目名称:aqbanking,代码行数:34,代码来源:msgcrypt_rdh.c

示例12: wl_adapter_attach

/*******************************************************************************
 *	wl_adapter_attach()
 *******************************************************************************
 *
 *  DESCRIPTION:
 *
 *      Creates an instance of the driver, allocating local data structures for
 *  one device. The device is registered with Card Services.
 *
 *  PARAMETERS:
 *
 *      none
 *
 *  RETURNS:
 *
 *      pointer to an allocated dev_link_t structure
 *      NULL on failure
 *
 ******************************************************************************/
static int wl_adapter_attach(struct pcmcia_device *link)
{
	struct net_device   *dev;
	struct wl_private   *lp;
	/*--------------------------------------------------------------------*/

	DBG_FUNC("wl_adapter_attach");
	DBG_ENTER(DbgInfo);

	dev = wl_device_alloc();
	if (dev == NULL) {
		DBG_ERROR(DbgInfo, "wl_device_alloc returned NULL\n");
		return -ENOMEM;
	}

	link->resource[0]->end  = HCF_NUM_IO_PORTS;
	link->resource[0]->flags= IO_DATA_PATH_WIDTH_16;
	link->config_flags     |= CONF_ENABLE_IRQ;
	link->config_index      = 5;
	link->config_regs       = PRESENT_OPTION;

	link->priv = dev;
	lp = wl_priv(dev);
	lp->link = link;

	wl_adapter_insert(link);

	DBG_LEAVE(DbgInfo);
	return 0;
} /* wl_adapter_attach */
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:49,代码来源:wl_cs.c

示例13: switch

GWEN_DATE *GWEN_Date_GetThisMonthEnd(const GWEN_DATE *dt) {
  int day;

  switch(GWEN_Date_GetMonth(dt)) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 8:
  case 10:
  case 12:
    day=31;
    break;
  case 2:
    if (GWEN_Date_IsLeapYear(GWEN_Date_GetYear(dt)))
      day=29;
    else
      day=28;
    break;

  case 4:
  case 6:
  case 9:
  case 11:
    day=30;
    break;

  default:
    DBG_ERROR(GWEN_LOGDOMAIN, "Invalid month (%d)", GWEN_Date_GetMonth(dt));
    abort();
    break;
  }
  return GWEN_Date_fromGregorian(GWEN_Date_GetYear(dt), GWEN_Date_GetMonth(dt), day);
}
开发者ID:Zauberstuhl,项目名称:gwenhywfar,代码行数:34,代码来源:gwendate.c

示例14: wl_adapter_attach

static int wl_adapter_attach(struct pcmcia_device *link)
{
    struct net_device   *dev;
    struct wl_private	*lp;
    /*------------------------------------------------------------------------*/

    DBG_FUNC( "wl_adapter_attach" );
    DBG_ENTER( DbgInfo );

    dev = wl_device_alloc();
    if(dev == NULL) {
        DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n");
	return -ENOMEM;
    }

    link->io.NumPorts1      = HCF_NUM_IO_PORTS;
    link->io.Attributes1    = IO_DATA_PATH_WIDTH_16;
    link->io.IOAddrLines    = 6;
    link->conf.Attributes   = CONF_ENABLE_IRQ;
    link->conf.IntType      = INT_MEMORY_AND_IO;
    link->conf.ConfigIndex  = 5;
    link->conf.Present      = PRESENT_OPTION;

    link->priv = dev;
    lp = wl_priv(dev);
    lp->link = link;

    wl_adapter_insert(link);

    DBG_LEAVE( DbgInfo );
    return 0;
} // wl_adapter_attach
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:32,代码来源:wl_cs.c

示例15: AH_Job_SepaStandingOrdersGet_Exchange

/* --------------------------------------------------------------- FUNCTION */
int AH_Job_SepaStandingOrdersGet_Exchange(AH_JOB *j, AB_JOB *bj,
                                          AH_JOB_EXCHANGE_MODE m,
                                          AB_IMEXPORTER_CONTEXT *ctx){
  DBG_INFO(AQHBCI_LOGDOMAIN, "Exchanging (%d)", m);

  assert(j);

  if (AB_Job_GetType(bj)!=AB_Job_TypeSepaGetStandingOrders) {
    DBG_ERROR(AQHBCI_LOGDOMAIN, "Not a GetStandingOrders job");
    return GWEN_ERROR_INVALID;
  }

  switch(m) {
  case AH_Job_ExchangeModeParams:
    return 0;

  case AH_Job_ExchangeModeArgs:
    return 0;

  case AH_Job_ExchangeModeResults:
    return 0;

  default:
    DBG_NOTICE(AQHBCI_LOGDOMAIN, "Unsupported exchange mode");
    return GWEN_ERROR_NOT_SUPPORTED;
  } /* switch */
}
开发者ID:aqbanking,项目名称:aqbanking,代码行数:28,代码来源:jobsepastandingorderget.c


注:本文中的DBG_ERROR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。