dispatch_xdr.c.preserve
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:3k
源码类别:
SQL Server
开发平台:
Unix_Linux
- /*
- * Please do not edit this file.
- * It was generated using rpcgen.
- */
- #include "dispatch.h"
- bool_t
- xdr_rpc_svc_t(XDR *xdrs, rpc_svc_t *objp)
- {
- register long *buf;
- if (!xdr_enum(xdrs, (enum_t *)objp)) {
- return (FALSE);
- }
- return (TRUE);
- }
- bool_t
- xdr_opq(XDR *xdrs, opq *objp)
- {
- register long *buf;
- if (!xdr_bytes(xdrs, (char **)&objp->opq_val, (u_int *)&objp->opq_len, ~0)) {
- return (FALSE);
- }
- return (TRUE);
- }
- bool_t
- xdr_res(XDR *xdrs, res *objp)
- {
- register long *buf;
- if (!xdr_opq(xdrs, &objp->proc_id)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->rpc_id)) {
- return (FALSE);
- }
- return (TRUE);
- }
- bool_t
- xdr_init_arg(XDR *xdrs, init_arg *objp)
- {
- register long *buf;
- if (xdrs->x_op == XDR_ENCODE) {
- if (!xdr_string(xdrs, &objp->user_name, ~0)) {
- return (FALSE);
- }
- buf = XDR_INLINE(xdrs,4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int(xdrs, &objp->wait_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->total_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->type)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->need_gdb)) {
- return (FALSE);
- }
- }
- else {
- IXDR_PUT_LONG(buf,objp->wait_time);
- IXDR_PUT_LONG(buf,objp->total_time);
- IXDR_PUT_LONG(buf,objp->type);
- IXDR_PUT_LONG(buf,objp->need_gdb);
- }
- if (!xdr_string(xdrs, &objp->x_server, ~0)) {
- return (FALSE);
- }
- return (TRUE);
- } else if (xdrs->x_op == XDR_DECODE) {
- if (!xdr_string(xdrs, &objp->user_name, ~0)) {
- return (FALSE);
- }
- buf = XDR_INLINE(xdrs,4 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (!xdr_int(xdrs, &objp->wait_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->total_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->type)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->need_gdb)) {
- return (FALSE);
- }
- }
- else {
- objp->wait_time = IXDR_GET_LONG(buf);
- objp->total_time = IXDR_GET_LONG(buf);
- objp->type = IXDR_GET_LONG(buf);
- objp->need_gdb = IXDR_GET_LONG(buf);
- }
- if (!xdr_string(xdrs, &objp->x_server, ~0)) {
- return (FALSE);
- }
- return(TRUE);
- }
- if (!xdr_string(xdrs, &objp->user_name, ~0)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->wait_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->total_time)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->type)) {
- return (FALSE);
- }
- if (!xdr_int(xdrs, &objp->need_gdb)) {
- return (FALSE);
- }
- if (!xdr_string(xdrs, &objp->x_server, ~0)) {
- return (FALSE);
- }
- return (TRUE);
- }
- long adm_rpc_port = 0x30001001;
- void fix_adm_port(char* opt)
- {
- static int have_got = 0;
- if (opt)
- {
- adm_rpc_port = atol(opt);
- have_got = 1;
- }
- else if (!have_got)
- {
- char *s = getenv("GSSPORT");
- if (s)
- adm_rpc_port = atol(s);
- have_got = 1;
- }
- }