本文整理汇总了C++中xdr_array函数的典型用法代码示例。如果您正苦于以下问题:C++ xdr_array函数的具体用法?C++ xdr_array怎么用?C++ xdr_array使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdr_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _xdr_directory_obj
bool_t
_xdr_directory_obj (XDR *xdrs, directory_obj *objp)
{
bool_t res = xdr_nis_name (xdrs, &objp->do_name);
if (__builtin_expect (res, TRUE))
{
res = xdr_nstype (xdrs, &objp->do_type);
if (__builtin_expect (res, TRUE))
{
res = xdr_array (xdrs, (void *) &objp->do_servers.do_servers_val,
&objp->do_servers.do_servers_len, ~0,
sizeof (nis_server), (xdrproc_t) _xdr_nis_server);
if (__builtin_expect (res, TRUE))
{
res = xdr_uint32_t (xdrs, &objp->do_ttl);
if (__builtin_expect (res, TRUE))
res = xdr_array (xdrs,
(void *) &objp->do_armask.do_armask_val,
&objp->do_armask.do_armask_len, ~0,
sizeof (oar_mask), (xdrproc_t) xdr_oar_mask);
}
}
}
return res;
}
示例2: xdr_RPGP_grid_t
static int xdr_RPGP_grid_t (XDR *xdrs, RPGP_grid_t *grid) {
int len;
len = 0;
if (xdrs->x_op == XDR_DECODE) {
grid->comp_params = NULL;
grid->dimensions = NULL;
}
else
len = Get_n_grid_points (grid);
if (xdr_int (xdrs, &(grid->comp_type)) == 0 ||
xdr_int (xdrs, &(grid->n_dimensions)) == 0 ||
(grid->n_dimensions > 0 &&
xdr_array (xdrs, (char **)&(grid->dimensions),
(unsigned int *)&(grid->n_dimensions), MAX_ARRAY_SIZE,
sizeof (int),
(xdrproc_t)xdr_int) == 0) ||
xdr_int (xdrs, &(grid->grid_type)) == 0 ||
xdr_int (xdrs, &(grid->numof_comp_params)) == 0 ||
(grid->numof_comp_params > 0 &&
xdr_array (xdrs, (char **)&(grid->comp_params),
(unsigned int *)&(grid->numof_comp_params), MAX_ARRAY_SIZE,
sizeof (RPGP_parameter_t),
(xdrproc_t)xdr_RPGP_parameter_t) == 0))
return (0);
if (xdrs->x_op == XDR_DECODE)
len = Get_n_grid_points (grid);
if (xdr_RPGP_data_t (xdrs, &(grid->data), len) == 0)
return (0);
return (1);
}
示例3: xdr_RPGP_radial_t
static int xdr_RPGP_radial_t (XDR *xdrs, RPGP_radial_t *radial) {
if (xdrs->x_op == XDR_DECODE) {
radial->description = NULL;
radial->comp_params = NULL;
radial->radials = NULL;
}
if (xdr_int (xdrs, &(radial->comp_type)) == 0 ||
xdr_string (xdrs, &(radial->description), MAX_ARRAY_SIZE) == 0 ||
xdr_float (xdrs, &(radial->bin_size)) == 0 ||
xdr_float (xdrs, &(radial->first_range)) == 0 ||
xdr_int (xdrs, &(radial->numof_comp_params)) == 0 ||
(radial->numof_comp_params > 0 &&
xdr_array (xdrs, (char **)&(radial->comp_params),
(unsigned int *)&(radial->numof_comp_params), MAX_ARRAY_SIZE,
sizeof (RPGP_parameter_t),
(xdrproc_t)xdr_RPGP_parameter_t) == 0) ||
xdr_int (xdrs, &(radial->numof_radials)) == 0)
return (0);
if (radial->numof_radials > 0) {
if (xdr_array (xdrs, (char **)&(radial->radials),
(unsigned int *)&(radial->numof_radials), MAX_ARRAY_SIZE,
sizeof (RPGP_radial_data_t),
(xdrproc_t)xdr_RPGP_radial_data_t) == 0)
return (0);
}
return (1);
}
示例4: xdr_matrice2
bool_t xdr_matrice2(XDR *xdrs, matrice2 *m) {
bool_t res = 1;
if (xdr_int(xdrs, &m->s) == 0) {
res = 0;
}
if (xdr_int(xdrs, &m->mul) == 0) {
res = 0;
}
//Force XDR to allocate memory while decoding
if((xdrs->x_op == XDR_DECODE) && (m->x != NULL)) {
free(m->x);
m->x = NULL;
}
if((xdrs->x_op == XDR_DECODE) && (m->y != NULL)) {
free(m->y);
m->y = NULL;
}
// if(xdrs->x_op != XDR_DECODE) {
// printf("%d\n", m->x[0]);
// }
uint si = m->s*m->s;
if (xdr_array(xdrs, (char **)&m->x, &si, (m->s*m->s), sizeof(int), (xdrproc_t)xdr_int) == 0) {
res = 0;
}
if (xdr_array(xdrs, (char **)&m->y, &si, (m->s*m->s), sizeof(int), (xdrproc_t)xdr_int) == 0) {
res = 0;
}
return res;
}
示例5: xdr_rpc_request_session_update
bool_t
xdr_rpc_request_session_update (XDR *xdrs, rpc_request_session_update *objp)
{
if (!xdr_array (xdrs, (char **)&objp->session_id.session_id_val, (u_int *) &objp->session_id.session_id_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->key.key_val, (u_int *) &objp->key.key_len, ~0,
sizeof (uint8_t), (xdrproc_t) xdr_uint8_t))
return FALSE;
return TRUE;
}
示例6: xdr_rpc_request_is_type_supported
bool_t
xdr_rpc_request_is_type_supported (XDR *xdrs, rpc_request_is_type_supported *objp)
{
if (!xdr_array (xdrs, (char **)&objp->key_system.key_system_val, (u_int *) &objp->key_system.key_system_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->mime_type.mime_type_val, (u_int *) &objp->mime_type.mime_type_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
return TRUE;
}
示例7: xdr_ndmp3_data_start_recover_request
bool_t
xdr_ndmp3_data_start_recover_request (XDR *xdrs, ndmp3_data_start_recover_request *objp)
{
if (!xdr_array (xdrs, (char **)&objp->env.env_val, (u_int *) &objp->env.env_len, ~0,
sizeof (ndmp3_pval), (xdrproc_t) xdr_ndmp3_pval))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->nlist.nlist_val, (u_int *) &objp->nlist.nlist_len, ~0,
sizeof (ndmp3_name), (xdrproc_t) xdr_ndmp3_name))
return FALSE;
if (!xdr_string (xdrs, &objp->bu_type, ~0))
return FALSE;
return TRUE;
}
示例8: xdr_rpc_response_create_session
bool_t
xdr_rpc_response_create_session (XDR *xdrs, rpc_response_create_session *objp)
{
if (!xdr_int (xdrs, &objp->platform_val))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->session_id.session_id_val, (u_int *) &objp->session_id.session_id_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->licence_req.licence_req_val, (u_int *) &objp->licence_req.licence_req_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
return TRUE;
}
示例9: xdr_rpc_request_create_session
bool_t
xdr_rpc_request_create_session (XDR *xdrs, rpc_request_create_session *objp)
{
if (!xdr_array (xdrs, (char **)&objp->init_data_type.init_data_type_val, (u_int *) &objp->init_data_type.init_data_type_len, ~0,
sizeof (char), (xdrproc_t) xdr_char))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->init_data.init_data_val, (u_int *) &objp->init_data.init_data_len, ~0,
sizeof (uint8_t), (xdrproc_t) xdr_uint8_t))
return FALSE;
if (!xdr_rpc_request_callback_info (xdrs, &objp->callback_info))
return FALSE;
return TRUE;
}
示例10: xdr_ndmp3_file
bool_t
xdr_ndmp3_file (XDR *xdrs, ndmp3_file *objp)
{
if (!xdr_array (xdrs, (char **)&objp->names.names_val, (u_int *) &objp->names.names_len, ~0,
sizeof (ndmp3_file_name), (xdrproc_t) xdr_ndmp3_file_name))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->stats.stats_val, (u_int *) &objp->stats.stats_len, ~0,
sizeof (ndmp3_file_stat), (xdrproc_t) xdr_ndmp3_file_stat))
return FALSE;
if (!xdr_ndmp3_u_quad (xdrs, &objp->node))
return FALSE;
if (!xdr_ndmp3_u_quad (xdrs, &objp->fh_info))
return FALSE;
return TRUE;
}
示例11: xdr_db_dict_desc
/* Special xdr_db_dict_desc that understands optional version number at end. */
bool_t
xdr_db_dict_desc(XDR *xdrs, db_dict_desc *objp)
{
if (!xdr_db_dict_version(xdrs, &objp->impl_vers))
return (FALSE);
if (!xdr_array(xdrs, (char **)&objp->tables.tables_val,
(uint_t *)&objp->tables.tables_len, ~0,
sizeof (db_table_desc_p), (xdrproc_t)xdr_db_table_desc_p))
return (FALSE);
if (!xdr_int(xdrs, &objp->count))
return (FALSE);
if (xdrs->x_op == XDR_DECODE) {
/* If no version was found, set version to 0. */
if (!xdr_vers(xdrs, (void**) &db_update_version))
make_zero(&db_update_version);
return (TRUE);
} else if (xdrs->x_op == XDR_ENCODE) {
/* Always write out version */
if (!xdr_vers(xdrs, (void**) &db_update_version))
return (FALSE);
} /* else XDR_FREE: do nothing */
return (TRUE);
}
示例12: xdr_cprinc3_arg
bool_t
xdr_cprinc3_arg(XDR *xdrs, cprinc3_arg *objp)
{
if (!xdr_ui_4(xdrs, &objp->api_version)) {
return (FALSE);
}
if (objp->api_version == KADM5_API_VERSION_1) {
if (!xdr_kadm5_principal_ent_rec_v1(xdrs, &objp->rec)) {
return (FALSE);
}
} else {
if (!xdr_kadm5_principal_ent_rec(xdrs, &objp->rec)) {
return (FALSE);
}
}
if (!xdr_long(xdrs, &objp->mask)) {
return (FALSE);
}
if (!xdr_array(xdrs, (caddr_t *)&objp->ks_tuple,
(unsigned int *)&objp->n_ks_tuple, ~0,
sizeof(krb5_key_salt_tuple),
xdr_krb5_key_salt_tuple)) {
return (FALSE);
}
if (!xdr_nullstring(xdrs, &objp->passwd)) {
return (FALSE);
}
return (TRUE);
}
示例13: xdr_rpc_request_load_session
bool_t xdr_rpc_request_load_session(XDR *xdrs, rpc_request_load_session *objp) {
if (!xdr_array(xdrs, (char **) &objp->session_id.session_id_val,
(u_int *) &objp->session_id.session_id_len, ~0,
sizeof(uint16_t), (xdrproc_t) xdr_uint16_t))
return FALSE;
return TRUE;
}
示例14: xdr_rpc_request_mediakeys
bool_t xdr_rpc_request_mediakeys(XDR *xdrs, rpc_request_mediakeys *objp) {
if (!xdr_array(xdrs, (char **) &objp->key_system.key_system_val,
(u_int *) &objp->key_system.key_system_len, ~0, sizeof(char),
(xdrproc_t) xdr_char))
return FALSE;
return TRUE;
}
示例15: xdr_ls_hqn_state
bool_t xdr_ls_hqn_state(XDR *xdrs, ls_hqn_state *objp)
{
if (!xdr_array(xdrs, (char **)&objp->domlist.dom, (u_int *)&objp->domlist.len, ~0, sizeof(ls_domain), xdr_ls_domain)) {
return (FALSE);
}
return (TRUE);
}