您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CHECK_ARGS函数代码示例

51自学网 2021-06-01 20:00:26
  C++
这篇教程C++ CHECK_ARGS函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

int main(int args, char **argv) {    RegexIsFunny *regexTest = new RegexIsFunny();    float quantity[4];    float price[5];    if (!CHECK_ARGS(args)) {        std::cerr << "NOT ENOUGH ARGS" << std::endl;        exit (84);    }    for (int i = 1; i < 5; ++i) {        quantity[i - 1] = regexTest->checkQuantity(argv[i]);    }    for (int i = 5; i < 10; ++i) {        price[i - 5] = regexTest->checkPrice(argv[i]);    }    Simplex toto(price, quantity);    toto.algorithm();    toto.display_result(price);    delete regexTest;        return 0;}
开发者ID:Ankirama,项目名称:Epitech,代码行数:25,


示例2: process_stdout_read

/**   process_stdout_read : 'process -> buf:string -> pos:int -> len:int -> int   <doc>   Read up to [len] bytes in [buf] starting at [pos] from the process stdout.   Returns the number of bytes readed this way. Raise an exception if this   process stdout is closed and no more data is available for reading.        For hxcpp, the input buffer is in bytes, not characters   </doc>**/static value process_stdout_read( value vp, value str, value pos, value len ) {   CHECK_ARGS();   gc_enter_blocking();#   ifdef NEKO_WINDOWS   {      DWORD nbytes;      if( !ReadFile(p->oread,buffer_data(buf)+val_int(pos),val_int(len),&nbytes,NULL) )      {         gc_exit_blocking();         return alloc_null();      }      gc_exit_blocking();      return alloc_int(nbytes);   }#   else   int nbytes = read(p->oread,buffer_data(buf) + val_int(pos),val_int(len));   if( nbytes <= 0 )   {      gc_exit_blocking();      alloc_null();   }   gc_exit_blocking();   return alloc_int(nbytes);#   endif}
开发者ID:delahee,项目名称:hxlibc,代码行数:35,


示例3: set_counterfile

/* usage: CounterFile path */MODRET set_counterfile(cmd_rec *cmd) {  config_rec *c;  const char *path;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON|CONF_DIR);  path = cmd->argv[1];  if (*path != '/') {    CONF_ERROR(cmd, "must be an absolute path");  }  /* In theory, we could open a filehandle on the configured path right   * here, and fail if the file couldn't be created/opened.  Then we   * could just stash that filehandle in the cmd_rec.  Easy.   *   * However, that would mean that we would have open descriptors for   * vhosts to which the client may not connect.  We would also need to   * use pr_fs_get_usable_fd() so that these filehandles don't use the wrong   * fds.  Instead, then, we wait to open the filehandles in sess_init(),   * where we know vhost to which the client connected.   */  c = add_config_param_str(cmd->argv[0], 1, path);  c->flags |= CF_MERGEDOWN;  return PR_HANDLED(cmd);}
开发者ID:Castaglia,项目名称:proftpd-mod_counter,代码行数:29,


示例4: info_mach_thread_command

static voidinfo_mach_thread_command (char *args, int from_tty){  union  {    struct thread_basic_info basic;  } thread_info_data;  thread_t thread;  kern_return_t result;  unsigned int info_count;  CHECK_ARGS (_("Thread"), args);  sscanf (args, "0x%x", &thread);  printf_unfiltered (_("THREAD_BASIC_INFO/n"));  info_count = THREAD_BASIC_INFO_COUNT;  result = thread_info (thread,			THREAD_BASIC_INFO,			(thread_info_t) & thread_info_data.basic,			&info_count);  MACH_CHECK_ERROR (result);#if 0  PRINT_FIELD (&thread_info_data.basic, user_time);  PRINT_FIELD (&thread_info_data.basic, system_time);#endif  PRINT_FIELD (&thread_info_data.basic, cpu_usage);  PRINT_FIELD (&thread_info_data.basic, run_state);  PRINT_FIELD (&thread_info_data.basic, flags);  PRINT_FIELD (&thread_info_data.basic, suspend_count);  PRINT_FIELD (&thread_info_data.basic, sleep_time);}
开发者ID:kraj,项目名称:binutils-gdb,代码行数:33,


示例5: info_mach_ports_command

static voidinfo_mach_ports_command (char *args, int from_tty){  port_name_array_t port_names_data;  port_type_array_t port_types_data;  unsigned int name_count, type_count;  kern_return_t result;  int index;  task_t task;  CHECK_ARGS ("Task", args);  sscanf (args, "0x%x", &task);  result = port_names (task,                       &port_names_data,                       &name_count, &port_types_data, &type_count);  MACH_CHECK_ERROR (result);  CHECK_FATAL (name_count == type_count);  printf_unfiltered ("Ports for task %#x:/n", task);  for (index = 0; index < name_count; ++index)    {      printf_unfiltered ("port name: %#x, type %#x/n",                         port_names_data[index], port_types_data[index]);    }  vm_deallocate (task_self (), (vm_address_t) port_names_data,                 (name_count * sizeof (mach_port_t)));  vm_deallocate (task_self (), (vm_address_t) port_types_data,                 (type_count * sizeof (mach_port_type_t)));}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:32,


示例6: set_memcacheconnectfailures

/* usage: MemcacheConnectFailures count */MODRET set_memcacheconnectfailures(cmd_rec *cmd) {  char *ptr = NULL;  config_rec *c;  uint64_t count = 0;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);#ifdef HAVE_STRTOULL  count = strtoull(cmd->argv[1], &ptr, 10);#else  count = strtoul(cmd->argv[1], &ptr, 10);#endif /* HAVE_STRTOULL */  if (ptr &&      *ptr) {    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "bad connect failures parameter: ",      cmd->argv[1], NULL));  }  c = add_config_param(cmd->argv[0], 1, NULL);  c->argv[0] = palloc(c->pool, sizeof(uint64_t));  *((uint64_t *) c->argv[0]) = count;  return PR_HANDLED(cmd);}
开发者ID:laoflch,项目名称:proftpd,代码行数:27,


示例7: set_countermaxreaderswriters

/* usage: *  CounterMaxReaders max *  CounterMaxWriters max */MODRET set_countermaxreaderswriters(cmd_rec *cmd) {  int count;  config_rec *c;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON|CONF_DIR);  /* A count of zero means that an unlimited number of readers (or writers),   * as is the default without this module, is in effect.   */  count = atoi(cmd->argv[1]);  if (count < 0 ||      count > INT_MAX) {    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "invalid number: ", cmd->argv[1],      NULL));  }  c = add_config_param(cmd->argv[0], 1, NULL);  c->argv[0] = pcalloc(c->pool, sizeof(int));  *((int *) c->argv[0]) = count;  c->flags |= CF_MERGEDOWN;  return PR_HANDLED(cmd);}
开发者ID:Castaglia,项目名称:proftpd-mod_counter,代码行数:29,


示例8: set_modulepath

/* usage: ModulePath path */MODRET set_modulepath(cmd_rec *cmd) {  int res;  struct stat st;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT);  if (pr_fs_valid_path(cmd->argv[1]) < 0)    CONF_ERROR(cmd, "must be an absolute path");  /* Make sure that the configured path is not world-writeable. */  res = pr_fsio_stat(cmd->argv[1], &st);  if (res < 0)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error checking '",      cmd->argv[1], "': ", strerror(errno), NULL));   if (!S_ISDIR(st.st_mode))    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, cmd->argv[1], " is not a directory",      NULL));  if (st.st_mode & S_IWOTH)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, cmd->argv[1], " is world-writable",      NULL));  if (lt_dlsetsearchpath(cmd->argv[1]) < 0)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error setting module path: ",      lt_dlerror(), NULL));  dso_module_path = pstrdup(dso_pool, cmd->argv[1]);  return PR_HANDLED(cmd);}
开发者ID:Distrotech,项目名称:proftpd,代码行数:32,


示例9: set_modulectrlsacls

/* usage: ModuleControlsACLs actions|all allow|deny user|group list */MODRET set_modulectrlsacls(cmd_rec *cmd) {#ifdef PR_USE_CTRLS  char *bad_action = NULL, **actions = NULL;  CHECK_ARGS(cmd, 4);  CHECK_CONF(cmd, CONF_ROOT);  actions = ctrls_parse_acl(cmd->tmp_pool, cmd->argv[1]);  if (strcmp(cmd->argv[2], "allow") != 0 &&      strcmp(cmd->argv[2], "deny") != 0)    CONF_ERROR(cmd, "second parameter must be 'allow' or 'deny'");  if (strcmp(cmd->argv[3], "user") != 0 &&      strcmp(cmd->argv[3], "group") != 0)    CONF_ERROR(cmd, "third parameter must be 'user' or 'group'");  bad_action = pr_ctrls_set_module_acls(dso_acttab, dso_pool, actions,    cmd->argv[2], cmd->argv[3], cmd->argv[4]);  if (bad_action != NULL)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, ": unknown action: '",      bad_action, "'", NULL));  return PR_HANDLED(cmd);#else  CONF_ERROR(cmd, "requires Controls support (--enable-ctrls)");#endif}
开发者ID:Distrotech,项目名称:proftpd,代码行数:29,


示例10: set_tcpservicename

/* usage: TCPServiceName <name> */MODRET set_tcpservicename(cmd_rec *cmd) {  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);  add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);  return HANDLED(cmd);}
开发者ID:OPSF,项目名称:uClinux,代码行数:8,


示例11: info_mach_task_command

static voidinfo_mach_task_command (char *args, int from_tty){  union  {    struct task_basic_info basic;    struct task_events_info events;    struct task_thread_times_info thread_times;  } task_info_data;  kern_return_t result;  unsigned int info_count;  task_t task;  CHECK_ARGS ("Task", args);  sscanf (args, "0x%x", &task);  printf_unfiltered ("TASK_BASIC_INFO:/n");  info_count = TASK_BASIC_INFO_COUNT;  result = task_info (task,                      TASK_BASIC_INFO,                      (task_info_t) & task_info_data.basic, &info_count);  MACH_CHECK_ERROR (result);  PRINT_FIELD (&task_info_data.basic, suspend_count);  PRINT_FIELD (&task_info_data.basic, virtual_size);  PRINT_FIELD (&task_info_data.basic, resident_size);#if 0  PRINT_FIELD (&task_info_data.basic, user_time);  PRINT_FIELD (&task_info_data.basic, system_time);  printf_unfiltered ("/nTASK_EVENTS_INFO:/n");  info_count = TASK_EVENTS_INFO_COUNT;  result = task_info (task,                      TASK_EVENTS_INFO,                      (task_info_t) & task_info_data.events, &info_count);  MACH_CHECK_ERROR (result);  PRINT_FIELD (&task_info_data.events, faults);  PRINT_FIELD (&task_info_data.events, zero_fills);  PRINT_FIELD (&task_info_data.events, reactivations);  PRINT_FIELD (&task_info_data.events, pageins);  PRINT_FIELD (&task_info_data.events, cow_faults);  PRINT_FIELD (&task_info_data.events, messages_sent);  PRINT_FIELD (&task_info_data.events, messages_received);#endif  printf_unfiltered ("/nTASK_THREAD_TIMES_INFO:/n");  info_count = TASK_THREAD_TIMES_INFO_COUNT;  result = task_info (task,                      TASK_THREAD_TIMES_INFO,                      (task_info_t) & task_info_data.thread_times,                      &info_count);  MACH_CHECK_ERROR (result);#if 0  PRINT_FIELD (&task_info_data.thread_times, user_time);  PRINT_FIELD (&task_info_data.thread_times, system_time);#endif}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:58,


示例12: info_mach_port_command

static voidinfo_mach_port_command (char *args, int from_tty){  task_t task;  mach_port_t port;  CHECK_ARGS ("Task and port", args);  sscanf (args, "0x%x 0x%x", &task, &port);  macosx_debug_port_info (task, port);}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:11,


示例13: set_counterlog

/* usage: CounterLog path|"none" */MODRET set_counterlog(cmd_rec *cmd) {  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);  if (pr_fs_valid_path(cmd->argv[1]) < 0) {    CONF_ERROR(cmd, "must be an absolute path");  }  add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);  return PR_HANDLED(cmd);}
开发者ID:Castaglia,项目名称:proftpd-mod_counter,代码行数:12,


示例14: set_dynmasqrefresh

/* usage: DynMasqRefresh <seconds> */MODRET set_dynmasqrefresh(cmd_rec *cmd) {    CHECK_CONF(cmd, CONF_ROOT);    CHECK_ARGS(cmd, 1);    dynmasq_timer_interval = atoi(cmd->argv[1]);    if (dynmasq_timer_interval < 1)        CONF_ERROR(cmd, pstrcat(cmd->tmp_pool,                                "must be greater than zero: '", cmd->argv[1], "'", NULL));    return PR_HANDLED(cmd);}
开发者ID:predever,项目名称:proftpd,代码行数:12,


示例15: set_loadmodule

/* usage: LoadModule module */MODRET set_loadmodule(cmd_rec *cmd) {  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT);  if (dso_load_module(cmd->argv[1]) < 0)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error loading module '",      cmd->argv[1], "': ", strerror(errno), NULL));  return PR_HANDLED(cmd);}
开发者ID:Distrotech,项目名称:proftpd,代码行数:12,


示例16: set_loadfile

/* usage: LoadFile path */MODRET set_loadfile(cmd_rec *cmd) {  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT);  if (pr_fs_valid_path(cmd->argv[1]) < 0)    CONF_ERROR(cmd, "must be an absolute path");  if (dso_load_file(cmd->argv[1]) < 0)    CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error loading '", cmd->argv[1],      "': ", strerror(errno), NULL));  return PR_HANDLED(cmd);}
开发者ID:Distrotech,项目名称:proftpd,代码行数:15,


示例17: set_lmd_ignore_memcached_down

MODRET set_lmd_ignore_memcached_down(cmd_rec *cmd) {  int ignore = -1;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);  ignore = get_boolean(cmd, 1);  if (ignore == -1)    CONF_ERROR(cmd, "expected Boolean parameter");  if(ignore == TRUE) {      ignore_memcached_down = true;  }  return PR_HANDLED(cmd);}
开发者ID:hiboma,项目名称:proftpd-mod_libmemcached_deny_blacklist,代码行数:16,


示例18: process_stdin_write

/**   process_stdin_write : 'process -> buf:string -> pos:int -> len:int -> int   <doc>   Write up to [len] bytes from [buf] starting at [pos] to the process stdin.   Returns the number of bytes writen this way. Raise an exception if this   process stdin is closed.   </doc>**/static value process_stdin_write( value vp, value str, value pos, value len ) {   CHECK_ARGS();   gc_enter_blocking();#   ifdef NEKO_WINDOWS   DWORD nbytes;   if( !WriteFile(p->iwrite,buffer_data(buf)+val_int(pos),val_int(len),&nbytes,NULL) )#   else   int nbytes = write(p->iwrite,buffer_data(buf)+val_int(pos),val_int(len));   if( nbytes == -1 )#   endif   {      gc_exit_blocking();      return alloc_null();   }   gc_exit_blocking();   return alloc_int(nbytes);}
开发者ID:delahee,项目名称:hxlibc,代码行数:25,


示例19: luaApi_destroyEntity

static int luaApi_destroyEntity(lua_State* L){  int nArgs;  CHECK_ARGS(nArgs, 1, L);  if (lua_islightuserdata(L, 1))  {    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));    entity->destroy();  }  else  {    WRONG_PARAMS;  }  return 0;}
开发者ID:smarmy,项目名称:Metrodu-Engine,代码行数:17,


示例20: luaApi_setIsSolid

static int luaApi_setIsSolid(lua_State* L){  int nArgs;  CHECK_ARGS(nArgs, 1, L);  if (lua_islightuserdata(L, 1))  {    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));    entity->setIsSolid(true);  }  else  {    WRONG_PARAMS;  }  return 0;}
开发者ID:smarmy,项目名称:Metrodu-Engine,代码行数:17,


示例21: set_copyengine

/* usage: CopyEngine on|off */MODRET set_copyengine(cmd_rec *cmd) {  int engine = -1;  config_rec *c;  CHECK_ARGS(cmd, 1);  CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);  engine = get_boolean(cmd, 1);  if (engine == -1) {    CONF_ERROR(cmd, "expected Boolean parameter");  }  c = add_config_param(cmd->argv[0], 1, NULL);  c->argv[0] = palloc(c->pool, sizeof(int));  *((int *) c->argv[0]) = engine;  return PR_HANDLED(cmd);}
开发者ID:laoflch,项目名称:proftpd,代码行数:19,


示例22: luaApi_setBoundingBox

static int luaApi_setBoundingBox(lua_State* L){  int nArgs;  CHECK_ARGS(nArgs, 3, L);  if (lua_islightuserdata(L, 1) && lua_isnumber(L, 2) && lua_isnumber(L, 3))  {    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));    int w = static_cast<int>(lua_tonumber(L, 2));    int h = static_cast<int>(lua_tonumber(L, 3));    entity->setBoundingBox(IBoundingBox(0, 0, w, h));  }  else  {    WRONG_PARAMS;  }  return 0;}
开发者ID:smarmy,项目名称:Metrodu-Engine,代码行数:18,


示例23: luaApi_setPosition

static int luaApi_setPosition(lua_State* L){  int nArgs;  CHECK_ARGS(nArgs, 3, L);  if (lua_islightuserdata(L, 1) && lua_isnumber(L, 2) && lua_isnumber(L, 3))  {    Entity *entity = static_cast<Entity*>(lua_touserdata(L, 1));    int x = static_cast<int>(lua_tonumber(L, 2));    int y = static_cast<int>(lua_tonumber(L, 3));    entity->setPosition(x, y);  }  else  {    WRONG_PARAMS;  }  return 0;}
开发者ID:smarmy,项目名称:Metrodu-Engine,代码行数:19,


示例24: SYSV_sigset

sighandler_t SYSV_sigset(int signum, sighandler_t handler) {    struct sigaction newact, oldact;    sigset_t oldset;    CHECK_ARGS(signum, handler);    memset(&newact, 0, sizeof(newact));    memset(&oldact, 0, sizeof(newact));    if (handler == SIG_HOLD) {        /* SIG_HOLD の
C++ CHECK_ARG_COUNT函数代码示例
C++ CHECK_ALLOCATION函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。