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


C++ RESOLVE函数代码示例

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


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


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