1 Star 0 Fork 12

102君/dlt698.45

forked from s_baoshan/dlt698.45 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
constraints.h 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
eomer 提交于 2019-11-12 10:34 . init repo
/*-
* Copyright (c) 2004, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN1_CONSTRAINTS_VALIDATOR_H
#define ASN1_CONSTRAINTS_VALIDATOR_H
#include <asn_system.h> /* Platform-dependent types */
#ifdef __cplusplus
extern "C" {
#endif
struct asn_TYPE_descriptor_s; /* Forward declaration */
/*
* Validate the structure according to the ASN.1 constraints.
* If errbuf and errlen are given, they shall be pointing to the appropriate
* buffer space and its length before calling this function. Alternatively,
* they could be passed as NULL's. If constraints validation fails,
* errlen will contain the actual number of bytes taken from the errbuf
* to encode an error message (properly 0-terminated).
*
* RETURN VALUES:
* This function returns 0 in case all ASN.1 constraints are met
* and -1 if one or more constraints were failed.
*/
int
asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor,
const void *struct_ptr, /* Target language's structure */
char *errbuf, /* Returned error description */
size_t *errlen /* Length of the error description */
);
/*
* Generic type for constraint checking callback,
* associated with every type descriptor.
*/
typedef int (asn_constr_check_f)(
struct asn_TYPE_descriptor_s *type_descriptor,
const void *struct_ptr,
asn_app_constraint_failed_f *optional_callback, /* Log the error */
void *optional_app_key /* Opaque key passed to a callback */
);
/*******************************
* INTERNALLY USEFUL FUNCTIONS *
*******************************/
asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */
asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */
/*
* Invoke the callback with a complete error message.
*/
#define ASN__CTFAIL if(ctfailcb) ctfailcb
#ifdef __cplusplus
}
#endif
#endif /* ASN1_CONSTRAINTS_VALIDATOR_H */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wylkd1991/dlt698.45.git
git@gitee.com:wylkd1991/dlt698.45.git
wylkd1991
dlt698.45
dlt698.45
master

搜索帮助