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


C++ FS_CALL函数代码示例

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


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

示例1: IO

	virtual status_t IO(off_t offset, void* buffer, size_t* length)
	{
		iovec vec;
		vec.iov_base = buffer;
		vec.iov_len = *length;

		if (fWrite) {
			return FS_CALL(fVnode, write_pages, fCookie, offset, &vec, 1,
				length);
		}

		return FS_CALL(fVnode, read_pages, fCookie, offset, &vec, 1, length);
	}
开发者ID:RAZVOR,项目名称:haiku,代码行数:13,代码来源:vfs_request_io.cpp

示例2: luv_fs_write

static int luv_fs_write(lua_State* L) {
  uv_file file = luaL_checkinteger(L, 1);
  uv_buf_t buf;
  int64_t offset;
  int ref;
  uv_fs_t* req;
  size_t count;
  uv_buf_t *bufs = NULL;

  if (lua_istable(L, 2)) {
    bufs = luv_prep_bufs(L, 2, &count);
  }
  else if (lua_isstring(L, 2)) {
    luv_check_buf(L, 2, &buf);
    count = 1;
  }
  else {
    return luaL_argerror(L, 2, "data must be string or table of strings");
  }

  offset = luaL_checkinteger(L, 3);
  ref = luv_check_continuation(L, 4);
  req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  req->ptr = buf.base;
  ((luv_req_t*)req->data)->data = bufs;
  FS_CALL(write, req, file, bufs ? bufs : &buf, count, offset);
}
开发者ID:kidaa,项目名称:luv,代码行数:28,代码来源:fs.c

示例3: luv_fs_symlink

int luv_fs_symlink(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  const char* new_path = luaL_checkstring(L, 2);
  int flags = luv_string_to_flags(L, luaL_checkstring(L, 3));
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(symlink, 4, new_path, path, new_path, flags);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例4: luv_fs_chown

int luv_fs_chown(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  int uid = luaL_checkint(L, 2);
  int gid = luaL_checkint(L, 3);
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(chown, 4, path, path, uid, gid);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例5: luv_fs_mkdtemp

static int luv_fs_mkdtemp(lua_State* L) {
  const char* tpl = luaL_checkstring(L, 1);
  int ref = luv_check_continuation(L, 2);
  uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  FS_CALL(mkdtemp, req, tpl);
}
开发者ID:kidaa,项目名称:luv,代码行数:7,代码来源:fs.c

示例6: luv_fs_futime

int luv_fs_futime(lua_State* L) {
  uv_file file = luaL_checkint(L, 1);
  double atime = luaL_checknumber(L, 2);
  double mtime = luaL_checknumber(L, 3);
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(futime, 4, NULL, file, atime, mtime);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例7: luv_fs_open

int luv_fs_open(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  int flags = luv_string_to_flags(L, luaL_checkstring(L, 2));
  int mode = luaL_checkint(L, 3);
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(open, 4, path, path, flags, mode);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例8: luv_fs_fchown

int luv_fs_fchown(lua_State* L) {
  uv_file file = luaL_checkint(L, 1);
  int uid = luaL_checkint(L, 2);
  int gid = luaL_checkint(L, 3);
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(fchown, 4, NULL, file, uid, gid);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例9: luv_fs_readlink

static int luv_fs_readlink(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  int ref = luv_check_continuation(L, 2);
  uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  FS_CALL(readlink, req, path);
}
开发者ID:kidaa,项目名称:luv,代码行数:7,代码来源:fs.c

示例10: luv_fs_utime

int luv_fs_utime(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  double atime = luaL_checknumber(L, 2);
  double mtime = luaL_checknumber(L, 3);
  uv_fs_t* req = luv_fs_store_callback(L, 4);
  FS_CALL(utime, 4, path, path, atime, mtime);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:7,代码来源:luv_fs.c

示例11: luv_fs_fdatasync

static int luv_fs_fdatasync(lua_State* L) {
  uv_file file = luaL_checkinteger(L, 1);
  int ref = luv_check_continuation(L, 2);
  uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  FS_CALL(fdatasync, req, file);
}
开发者ID:kidaa,项目名称:luv,代码行数:7,代码来源:fs.c

示例12: luv_fs_write

int luv_fs_write(lua_State* L) {
    uv_file file = luaL_checkint(L, 1);
    off_t offset = luaL_checkint(L, 2);
    size_t length;
    void* chunk = (void*)luaL_checklstring(L, 3, &length);
    uv_fs_t* req = luv_fs_store_callback(L, 4);
    FS_CALL(write, 4, NULL, file, chunk, length, offset);
}
开发者ID:nko,项目名称:luvit,代码行数:8,代码来源:luv_fs.c

示例13: luv_fs_chmod

static int luv_fs_chmod(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  int mode = luaL_checkinteger(L, 2);
  int ref = luv_check_continuation(L, 3);
  uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  FS_CALL(chmod, req, path, mode);
}
开发者ID:kidaa,项目名称:luv,代码行数:8,代码来源:fs.c

示例14: luv_fs_access

static int luv_fs_access(lua_State* L) {
  const char* path = luaL_checkstring(L, 1);
  int amode = luv_check_amode(L, 2);
  int ref = luv_check_continuation(L, 3);
  uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
  req->data = luv_setup_req(L, ref);
  FS_CALL(access, req, path, amode);
}
开发者ID:kidaa,项目名称:luv,代码行数:8,代码来源:fs.c

示例15: luv_fs_sendfile

int luv_fs_sendfile(lua_State* L) {
  uv_file out_fd = luaL_checkint(L, 1);
  uv_file in_fd = luaL_checkint(L, 2);
  off_t in_offset = luaL_checkint(L, 3);
  size_t length = luaL_checkint(L, 4);
  uv_fs_t* req = luv_fs_store_callback(L, 5);
  FS_CALL(sendfile, 5, NULL, out_fd, in_fd, in_offset, length);
}
开发者ID:AndrewTsao,项目名称:luvit,代码行数:8,代码来源:luv_fs.c


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