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

C++ RESOLVE函数代码示例

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

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



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

示例1: lookup_functions

static int lookup_functions()
{
	lib_handle = LoadLibraryA("hid.dll");
	if (lib_handle) {
#define RESOLVE(x) x = (x##_)GetProcAddress(lib_handle, #x); if (!x) return -1;
		RESOLVE(HidD_GetAttributes);
		RESOLVE(HidD_GetSerialNumberString);
		RESOLVE(HidD_GetManufacturerString);
		RESOLVE(HidD_GetProductString);
		RESOLVE(HidD_SetFeature);
		RESOLVE(HidD_GetFeature);
		RESOLVE(HidD_GetIndexedString);
		RESOLVE(HidD_GetPreparsedData);
		RESOLVE(HidD_FreePreparsedData);
		RESOLVE(HidP_GetCaps);
#undef RESOLVE
	}
	else
		return -1;

	return 0;
}
开发者ID:SchrodingersGat,项目名称:reverse-geocachr,代码行数:22,代码来源:hid.c


示例2: initKernel

void initKernel(void) {
	int libkernel;
	loadModule("libkernel.sprx", &libkernel);
	
	RESOLVE(libkernel, sceKernelLoadStartModule);
	
	RESOLVE(libkernel, sceKernelAllocateDirectMemory);
	RESOLVE(libkernel, sceKernelMapDirectMemory);
	
	RESOLVE(libkernel, sceKernelSleep);
	RESOLVE(libkernel, sceKernelUsleep);
	RESOLVE(libkernel, sceKernelGettimeofday);
	RESOLVE(libkernel, sceKernelGetProcessTime);
	RESOLVE(libkernel, sceKernelGetCurrentCpu);
}
开发者ID:respu,项目名称:PS4-SDK,代码行数:15,代码来源:kernel.c


示例3: fclose

int fclose(FILE *stream)
{
    int fd = fileno(stream);

    if (intercept[fd])
    {
	DEBUGF("fd=%d\n", fd);

	return _intercept_close(fd);
    }

    RESOLVE(fclose);
    return o_fclose(stream);
}
开发者ID:chx,项目名称:http-fs-wrapper,代码行数:14,代码来源:httpfs.c


示例4: ftello64

__off64_t ftello64 (FILE *stream)
{
    int fd = fileno(stream);

    if (intercept[fd])
    {
	DEBUGF("fd=%d\n", fd);

	return intercept[fd]->offset;
    }

    RESOLVE(ftello64);
    return o_ftello64(stream);
}
开发者ID:chx,项目名称:http-fs-wrapper,代码行数:14,代码来源:httpfs.c


示例5: pdf_array_push_drop

void
pdf_array_push_drop(fz_context *ctx, pdf_obj *obj, pdf_obj *item)
{
	RESOLVE(obj);
	if (obj >= PDF_OBJ__LIMIT)
	{
		fz_try(ctx)
			pdf_array_push(ctx, obj, item);
		fz_always(ctx)
			pdf_drop_obj(ctx, item);
		fz_catch(ctx)
			fz_rethrow(ctx);
	}
}
开发者ID:camlhsegu,项目名称:mupdf,代码行数:14,代码来源:pdf-object.c


示例6: pdf_array_insert_drop

void
pdf_array_insert_drop(fz_context *ctx, pdf_obj *obj, pdf_obj *item, int i)
{
	RESOLVE(obj);
	if (obj)
	{
		fz_try(ctx)
			pdf_array_insert(ctx, obj, item, i);
		fz_always(ctx)
			pdf_drop_obj(ctx, item);
		fz_catch(ctx)
			fz_rethrow(ctx);
	}
}
开发者ID:zyma678,项目名称:iOSMuPDFSource,代码行数:14,代码来源:pdf-object.c


示例7: __fxstat64

int __fxstat64(int version, int fd, struct stat64 *buf)
{
    if (intercept[fd])
    {
	DEBUGF("version=%d, fd=%d\n", version, fd);

	_intercept_stat(fd, buf);

	return 0;
    }

    RESOLVE(__fxstat64);
    return o___fxstat64(version, fd, buf);
}
开发者ID:chx,项目名称:http-fs-wrapper,代码行数:14,代码来源:httpfs.c


示例8: fread

size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
    int fd = fileno(stream);

    if (intercept[fd])
    {
	DEBUGF("ptr=%p, size=%zu, nmemb=%zu, fd=%d", ptr, size, nmemb, fd);

	return _intercept_read(fd, ptr, size * nmemb);
    }

    RESOLVE(fread);
    return o_fread(ptr, size, nmemb, stream);
}
开发者ID:chx,项目名称:http-fs-wrapper,代码行数:14,代码来源:httpfs.c


示例9: pdf_array_delete

void
pdf_array_delete(fz_context *ctx, pdf_obj *obj, int i)
{
	RESOLVE(obj);
	if (!OBJ_IS_ARRAY(obj))
		fz_throw(ctx, FZ_ERROR_GENERIC, "not an array (%s)", pdf_objkindstr(obj));
	if (i < 0 || i >= ARRAY(obj)->len)
		fz_throw(ctx, FZ_ERROR_GENERIC, "index out of bounds");
	prepare_object_for_alteration(ctx, obj, NULL);
	pdf_drop_obj(ctx, ARRAY(obj)->items[i]);
	ARRAY(obj)->items[i] = 0;
	ARRAY(obj)->len--;
	memmove(ARRAY(obj)->items + i, ARRAY(obj)->items + i + 1, (ARRAY(obj)->len - i) * sizeof(pdf_obj*));
}
开发者ID:muennich,项目名称:mupdf,代码行数:14,代码来源:pdf-object.c


示例10: pdf_array_insert

void
pdf_array_insert(fz_context *ctx, pdf_obj *obj, pdf_obj *item, int i)
{
	RESOLVE(obj);
	if (!OBJ_IS_ARRAY(obj))
		fz_throw(ctx, FZ_ERROR_GENERIC, "not an array (%s)", pdf_objkindstr(obj));
	if (i < 0 || i > ARRAY(obj)->len)
		fz_throw(ctx, FZ_ERROR_GENERIC, "index out of bounds");
	prepare_object_for_alteration(ctx, obj, item);
	if (ARRAY(obj)->len + 1 > ARRAY(obj)->cap)
		pdf_array_grow(ctx, ARRAY(obj));
	memmove(ARRAY(obj)->items + i + 1, ARRAY(obj)->items + i, (ARRAY(obj)->len - i) * sizeof(pdf_obj*));
	ARRAY(obj)->items[i] = pdf_keep_obj(ctx, item);
	ARRAY(obj)->len++;
}
开发者ID:muennich,项目名称:mupdf,代码行数:15,代码来源:pdf-object.c


示例11: confuga_truncate

CONFUGA_API int confuga_truncate(confuga *C, const char *path, confuga_off_t length)
{
	static const confuga_fid_t empty = {CONFUGA_FID_EMPTY};

	int rc;
	RESOLVE(path)
	debug(D_CONFUGA, "truncate(`%s', %" PRIuCONFUGA_OFF_T ")", unresolved_path, length);
	confuga_fid_t fid;
	confuga_off_t size;
	enum CONFUGA_FILE_TYPE type;
	CATCH(lookup(C, path, &fid, &size, &type));
	if (length > 0)
		CATCH(EINVAL);
	CATCH(update(C, path, empty, 0, 0));
	PROLOGUE
}
开发者ID:xavierdingdev,项目名称:cctools,代码行数:16,代码来源:confuga_namespace.c


示例12: pdf_array_push

void
pdf_array_push(fz_context *ctx, pdf_obj *obj, pdf_obj *item)
{
	RESOLVE(obj);
	if (!OBJ_IS_ARRAY(obj))
		fz_throw(ctx, FZ_ERROR_GENERIC, "not an array (%s)", pdf_objkindstr(obj));

	if (!item)
		item = PDF_OBJ_NULL;

	prepare_object_for_alteration(ctx, obj, item);
	if (ARRAY(obj)->len + 1 > ARRAY(obj)->cap)
		pdf_array_grow(ctx, ARRAY(obj));
	ARRAY(obj)->items[ARRAY(obj)->len] = pdf_keep_obj(ctx, item);
	ARRAY(obj)->len++;
}
开发者ID:ArtifexSoftware,项目名称:mupdf,代码行数:16,代码来源:pdf-object.c


示例13: confuga_link

CONFUGA_API int confuga_link(confuga *C, const char *target, const char *path)
{
	/* This deserves some explanation:
	 *
	 * Since the NM manages both the Confuga NS and the file metadata, the
	 * inode on the local file system contains all the file metadata and a
	 * pointer to file contents. So, when we create a link, we really want to
	 * have both entries point to the local file system inode.
	 *
	 * The inode also points to file data which includes the Confuga file ID.
	 * This would be an identifier for the content, not the metadata.
	 */
	int rc;
	RESOLVE(target);
	SIMPLE_WRAP_UNIX(link(target, path), "link(`%s', `%s')", unresolved_target, unresolved_path);
}
开发者ID:xavierdingdev,项目名称:cctools,代码行数:16,代码来源:confuga_namespace.c


示例14: chirp_fs_local_open

static INT64_T chirp_fs_local_open(const char *path, INT64_T flags, INT64_T mode)
{
    const char *unresolved = path;
    RESOLVE(path)
    INT64_T fd = getfd();
    if (fd == -1) return -1;
    mode &= S_IXUSR|S_IRWXG|S_IRWXO;
    mode |= S_IRUSR|S_IWUSR;
    INT64_T lfd = open64(path, flags, mode);
    if (lfd >= 0) {
        open_files[fd].fd = lfd;
        strcpy(open_files[fd].path, unresolved);
        return fd;
    } else {
        return -1;
    }
}
开发者ID:reneme,项目名称:cctools,代码行数:17,代码来源:chirp_fs_local.c


示例15: chirp_fs_local_open

static INT64_T chirp_fs_local_open(const char *path, INT64_T flags, INT64_T mode)
{
	PREAMBLE("open(`%s', 0x%" PRIx64 ", 0o%" PRIo64 ")", path, flags, mode);
	const char *unresolved = path;
	RESOLVE(path)
	INT64_T fd = getfd();
	if (fd == -1) return -1;
	mode &= S_IXUSR|S_IRWXG|S_IRWXO;
	mode |= S_IRUSR|S_IWUSR;
	rc = open64(path, flags, (int) mode);
	if (rc >= 0) {
		open_files[fd].fd = rc;
		strcpy(open_files[fd].path, unresolved);
		rc = fd;
	}
	PROLOGUE
}
开发者ID:NeilB879,项目名称:cctools,代码行数:17,代码来源:chirp_fs_local.c


示例16: fseeko64

int fseeko64 (FILE *stream, __off64_t offset, int whence)
{
    int fd = fileno(stream);

    if (intercept[fd])
    {
	DEBUGF("fd=%d, offset=%s, whence=%d\n", fd, str_off_t(offset), whence);

	if (_intercept_seek(fd, offset, whence) < 0)
	    return EINVAL;

	return 0;
    }

    RESOLVE(fseeko64);
    return o_fseeko64(stream, offset, whence);
}
开发者ID:chx,项目名称:http-fs-wrapper,代码行数:17,代码来源:httpfs.c


示例17: fz_copy_dict

fz_obj *
fz_copy_dict(fz_context *ctx, fz_obj *obj)
{
	fz_obj *dict;
	int i, n;

	RESOLVE(obj);
	if (obj && obj->kind != FZ_DICT)
		fz_warn(ctx, "assert: not a dict (%s)", fz_objkindstr(obj));

	n = fz_dict_len(obj);
	dict = fz_new_dict(ctx, n);
	for (i = 0; i < n; i++)
		fz_dict_put(dict, fz_dict_get_key(obj, i), fz_dict_get_val(obj, i));

	return dict;
}
开发者ID:plotnick,项目名称:mupdf,代码行数:17,代码来源:base_object.c


示例18: pdf_array_push

void
pdf_array_push(pdf_obj *obj, pdf_obj *item)
{
	RESOLVE(obj);

	if (!obj)
		return; /* Can't warn :( */
	if (obj->kind != PDF_ARRAY)
		fz_warn(obj->ctx, "assert: not an array (%s)", pdf_objkindstr(obj));
	else
	{
		if (obj->u.a.len + 1 > obj->u.a.cap)
			pdf_array_grow(obj);
		obj->u.a.items[obj->u.a.len] = pdf_keep_obj(item);
		obj->u.a.len++;
	}
}
开发者ID:Ernest0x,项目名称:mupdf,代码行数:17,代码来源:base_object.c


示例19: pdf_array_put

void
pdf_array_put(fz_context *ctx, pdf_obj *obj, int i, pdf_obj *item)
{
	RESOLVE(obj);
	if (!OBJ_IS_ARRAY(obj))
		fz_throw(ctx, FZ_ERROR_GENERIC, "not an array (%s)", pdf_objkindstr(obj));
	if (i == ARRAY(obj)->len)
	{
		pdf_array_push(ctx, obj, item);
		return;
	}
	if (i < 0 || i > ARRAY(obj)->len)
		fz_throw(ctx, FZ_ERROR_GENERIC, "index out of bounds");
	prepare_object_for_alteration(ctx, obj, item);
	pdf_drop_obj(ctx, ARRAY(obj)->items[i]);
	ARRAY(obj)->items[i] = pdf_keep_obj(ctx, item);
}
开发者ID:muennich,项目名称:mupdf,代码行数:17,代码来源:pdf-object.c


示例20: pdf_dict_put_val_drop

void
pdf_dict_put_val_drop(fz_context *ctx, pdf_obj *obj, int i, pdf_obj *new_obj)
{
	RESOLVE(obj);
	if (!obj || obj->kind != PDF_DICT)
	{
		pdf_drop_obj(ctx, new_obj);
		return;
	}
	if (i < 0 || i >= obj->u.d.len)
	{
		/* FIXME: Should probably extend the dict here */
		pdf_drop_obj(ctx, new_obj);
		return;
	}
	pdf_drop_obj(ctx, obj->u.d.items[i].v);
	obj->u.d.items[i].v = new_obj;
}
开发者ID:zyma678,项目名称:iOSMuPDFSource,代码行数:18,代码来源:pdf-object.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ RESTARTABLE函数代码示例发布时间:2022-05-30
下一篇:
C++ RESET_ERROR_CODE函数代码示例发布时间: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