• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ clear_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: run_remote

static int run_remote(int fd, const char *command)
{
	fflush(stdout);

	if (!ctl_send_chars(fd, command, -1)) {
		printf("\r[%sFAIL%s]\n", c(RED, use_colors), c(CLEAR, use_colors));
		return COMMAND_FAILED;
	}

	struct luadebug_user *readline_user = luadebug_user_readline();
	if (!readline_user) {
		printf(": %ls", clear_error());
		printf("\r[%sFAIL%s]\n", c(RED, use_colors), c(CLEAR, use_colors));
	}

	if (check_status(fd, NULL) == COMMAND_SUCCESS) {
		luadebug_user_remote_server(fd, readline_user);
		if (check_error()) {
			message(HAKA_LOG_FATAL, L"debug", clear_error());
			return COMMAND_FAILED;
		}
		return COMMAND_SUCCESS;
	}
	else {
		return COMMAND_FAILED;
	}
}
开发者ID:Oneiroi,项目名称:haka,代码行数:27,代码来源:commands.c


示例2: opendb

static char *vacuum1_thread_writer(int iTid, void *pArg){
  Error err = {0};                /* Error code and message */
  Sqlite db = {0};                /* SQLite database connection */
  opendb(&err, &db, "test.db", 0);
  i64 i = 0;

  while( !timetostop(&err) ){
    i++;

    /* Insert lots of rows. Then delete some. */
    execsql(&err, &db, 
        "WITH loop(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM loop WHERE i<100) "
        "INSERT INTO t1 SELECT randomblob(50), randomblob(2500) FROM loop"
    );

    /* Delete lots of rows */
    execsql(&err, &db, "DELETE FROM t1 WHERE rowid = :i", &i);
    clear_error(&err, SQLITE_LOCKED);

    /* Select the rows */
    execsql(&err, &db, "SELECT * FROM t1 ORDER BY x");
    clear_error(&err, SQLITE_LOCKED);
  }

  closedb(&err, &db);
  print_and_free_err(&err);
  return sqlite3_mprintf("ok");
}
开发者ID:1018824313,项目名称:sqlite,代码行数:28,代码来源:tt3_vacuum.c


示例3: fcntl

inline int fcntl(int d, long cmd, long arg, boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::fcntl(d, cmd, arg), ec);
    if (result != -1)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:8,代码来源:descriptor_ops.hpp


示例4: open

inline int open(const char* path, int flags, boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::open(path, flags), ec);
    if (result >= 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:8,代码来源:descriptor_ops.hpp


示例5: close

inline int close(int d, boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::close(d), ec);
    if (result == 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:8,代码来源:descriptor_ops.hpp


示例6: ioctl

inline int ioctl(int d, long cmd, ioctl_arg_type* arg,
                 boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::ioctl(d, cmd, arg), ec);
    if (result >= 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:9,代码来源:descriptor_ops.hpp


示例7: scatter_read

inline int scatter_read(int d, buf* bufs, size_t count,
                        boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::readv(d, bufs, static_cast<int>(count)), ec);
    if (result >= 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:9,代码来源:descriptor_ops.hpp


示例8: gather_write

inline int gather_write(int d, const buf* bufs, size_t count,
                        boost::system::error_code& ec)
{
    clear_error(ec);
    int result = error_wrapper(::writev(d, bufs, static_cast<int>(count)), ec);
    if (result >= 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:9,代码来源:descriptor_ops.hpp


示例9: poll_write

inline int poll_write(int d, boost::system::error_code& ec)
{
  clear_error(ec);
  pollfd fds;
  fds.fd = d;
  fds.events = POLLOUT;
  fds.revents = 0;
  clear_error(ec);
  return error_wrapper(::poll(&fds, 1, -1), ec);
}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:10,代码来源:descriptor_ops.hpp


示例10: poll_read

inline int poll_read(int d, boost::system::error_code& ec)
{
    clear_error(ec);
    pollfd fds;
    fds.fd = d;
    fds.events = POLLIN;
    fds.revents = 0;
    clear_error(ec);
    int result = error_wrapper(::poll(&fds, 1, -1), ec);
    if (result >= 0)
        clear_error(ec);
    return result;
}
开发者ID:asadchev,项目名称:asadchev,代码行数:13,代码来源:descriptor_ops.hpp


示例11: clear_error

int
hstcpcli::request_send()
{
  if (error_code < 0) {
    return error_code;
  }
  clear_error();
  if (fd.get() < 0) {
    close();
    return set_error(-1, "write: closed");
  }
  if (num_req_bufd == 0 || num_req_sent > 0 || num_req_rcvd > 0) {
    close();
    return set_error(-1, "request_send: protocol out of sync");
  }
  const size_t wrlen = writebuf.size();
  const ssize_t r = send(fd.get(), writebuf.begin(), wrlen, MSG_NOSIGNAL);
  if (r <= 0) {
    close();
    return set_error(-1, r < 0 ? "write: failed" : "write: eof");
  }
  writebuf.erase_front(r);
  if (static_cast<size_t>(r) != wrlen) {
    close();
    return set_error(-1, "write: incomplete");
  }
  num_req_sent = num_req_bufd;
  num_req_bufd = 0;
  DBG(fprintf(stderr, "REQSEND 0\n"));
  return 0;
}
开发者ID:AllenWeb,项目名称:mariadb,代码行数:31,代码来源:hstcpcli.cpp


示例12: stumpless_new_element

struct stumpless_element *
stumpless_new_element( const char *name ) {
  struct stumpless_element *element;

  clear_error(  );

  if( !name ) {
    raise_argument_empty( "name is NULL" );
    goto fail;
  }

  element = alloc_mem( sizeof( *element ) );
  if( !element ) {
    goto fail;
  }

  element->name = cstring_to_sized_string( name, &( element->name_length ) );
  if( !element->name ) {
    goto fail_name;
  }

  element->params = NULL;
  element->param_count = 0;

  return element;

fail_name:
  free_mem( element );

fail:
  return NULL;
}
开发者ID:goatshriek,项目名称:stumpless,代码行数:32,代码来源:entry.c


示例13: rdef_compile

status_t
rdef_compile(const char *outputFile)
{
	clear_error();

	if (outputFile == NULL || outputFile[0] == '\0') {
		rdef_err = B_BAD_VALUE;
		return rdef_err;
	}

	rsrc_file = outputFile;
	rdef_err = open_output_file();
	if (rdef_err != B_OK)
		return rdef_err;

	for (ptr_iter_t i = input_files.begin(); 
			(i != input_files.end()) && (rdef_err == B_OK); ++i) {
		char *path = (char *)*i;

		AddIncludeDir add(path);
		compile_file(path);
	}

	close_output_file();
	return rdef_err;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:26,代码来源:compile.cpp


示例14: stumpless_add_element

struct stumpless_entry *
stumpless_add_element( struct stumpless_entry *entry,
                       struct stumpless_element *element ) {

  struct stumpless_element **new_elements;
  size_t old_elements_size;
  size_t new_elements_size;

  clear_error(  );

  if( !entry ) {
    raise_argument_empty( "entry is NULL" );
    return NULL;
  }

  if( !element ) {
    raise_argument_empty( "element is NULL" );
    return NULL;
  }
  // todo need to check for duplicates first

  old_elements_size = sizeof( element ) * entry->element_count;
  new_elements_size = old_elements_size + sizeof( element );

  new_elements = realloc_mem( entry->elements, new_elements_size );
  if( !new_elements ) {
    return NULL;
  }

  new_elements[entry->element_count] = element;
  entry->elements = new_elements;
  entry->element_count++;

  return entry;
}
开发者ID:goatshriek,项目名称:stumpless,代码行数:35,代码来源:entry.c


示例15: vstumpless_set_entry_message

struct stumpless_entry *
vstumpless_set_entry_message( struct stumpless_entry *entry,
                              const char *message,
                              va_list subs ) {
  char *formatted_message;
  size_t message_length;

  clear_error(  );

  if( !entry ) {
    raise_argument_empty( "entry is NULL" );
    return NULL;
  }

  if( !message ) {
    free_mem( entry->message );
    entry->message = NULL;
    entry->message_length = 0;

  } else {
    formatted_message = config_format_string( message, subs, &message_length );
    if( !formatted_message ) {
      return NULL;

    } else {
      free_mem( entry->message );
      entry->message = formatted_message;
      entry->message_length = message_length;

    }
  }

  return entry;
}
开发者ID:goatshriek,项目名称:stumpless,代码行数:34,代码来源:entry.c


示例16: stumpless_add_param

struct stumpless_element *
stumpless_add_param( struct stumpless_element *element,
                     struct stumpless_param *param ) {

  struct stumpless_param **new_params;
  size_t old_params_size;
  size_t new_params_size;

  clear_error(  );

  if( !element ) {
    raise_argument_empty( "element is NULL" );
    return NULL;
  }

  if( !param ) {
    raise_argument_empty( "param is NULL" );
    return NULL;
  }

  old_params_size = sizeof( param ) * element->param_count;
  new_params_size = old_params_size + sizeof( param );

  new_params = realloc_mem( element->params, new_params_size );
  if( !new_params ) {
    return NULL;
  }

  new_params[element->param_count] = param;
  element->param_count++;
  element->params = new_params;

  return element;
}
开发者ID:goatshriek,项目名称:stumpless,代码行数:34,代码来源:entry.c


示例17: clear_error

	void radc_compiler::begin(const char * str, const radc_varlist * _varlist)
	{
		clear_error();

		_break = false;
		_options = 0;
		_cache_program = programs.Find(str);
		if (_cache_program == -1)
		{
			int length = strlen(str);

			buffer.Resize(length + 1);

			int i = 0;
			while (*str)
			{
				buffer[i++] = charmap[*str++];
			}

			buffer[i] = 0;
		}

		inputlist = _varlist;

		outputlist->clear();
	}
开发者ID:MSoft1115,项目名称:Rad3D,代码行数:26,代码来源:RadCCompiler.cpp


示例18: c_syb_make

int c_syb_make (int m_size)
{
  int count;
  
  error_message = (char *) malloc (sizeof (char) * (m_size + ERROR_MESSAGE_SIZE));
  clear_error ();
  max_size = m_size;
  
  if (dbinit () == FAIL)
    {
      return error_number;
      /* exit(ERREXIT); */
    }
  
  dberrhandle ((EHANDLEFUNC)err_handler);
  dbmsghandle ((MHANDLEFUNC)msg_handler);
  
  if (login == NULL)
    {
		login = safe_alloc (dblogin());
		DBSETLCHARSET (login, "utf8");
    }
 
  for (count = 0; count < MAX_DESCRIPTOR; count++)
    {
      descriptor[count] = NULL;
    }
  
  return error_number;
}
开发者ID:jocelyn,项目名称:EiffelStudio,代码行数:30,代码来源:sybase.c


示例19: call_unload

void legacy_image_device_base::unload()
{
	if (is_loaded()) {
		call_unload();
	}
    clear();
	clear_error();
}
开发者ID:libretro,项目名称:mame2010-libretro,代码行数:8,代码来源:devimage.c


示例20: syb_exec_immediate

int syb_exec_immediate (char *order)
{
  DBPROCESS * dbp = descriptor[PRIVATE_DESCRIPTOR];
  clear_error ();
  dbcmd (dbp, order);
  dbsqlexec (dbp);
  return error_number;
}
开发者ID:jocelyn,项目名称:EiffelStudio,代码行数:8,代码来源:sybase.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ clear_freeze_flag函数代码示例发布时间:2022-05-30
下一篇:
C++ clear_dma_ff函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap