File: Status.xs

package info (click to toggle)
libgssapi-perl 0.28-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 758; makefile: 6
file content (82 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "ppport.h"
GSSAPI::Status
new(class, major, minor)
	char	*class
	U32	major
	U32	minor
    CODE:
	RETVAL.major = major;
	RETVAL.minor = minor;
    OUTPUT:
	RETVAL

U32
major(status)
	GSSAPI::Status	status
    CODE:
	RETVAL = status.major;
    OUTPUT:
	RETVAL

U32
minor(status)
	GSSAPI::Status	status
    CODE:
	RETVAL = status.minor;
    OUTPUT:
	RETVAL

U32
GSS_CALLING_ERROR(code)
	U32	code

U32
GSS_ROUTINE_ERROR(code)
	U32	code

U32
GSS_SUPPLEMENTARY_INFO(code)
	U32	code

bool
GSS_ERROR(code)
	U32	code
    CODE:
	RETVAL = GSS_ERROR(code) != 0;
    OUTPUT:
	RETVAL

U32
GSS_CALLING_ERROR_FIELD(code)
	U32	code

U32
GSS_ROUTINE_ERROR_FIELD(code)
	U32	code

U32
GSS_SUPPLEMENTARY_INFO_FIELD(code)
	U32	code

void
display_status(code, type)
	U32		code
	int		type
    PREINIT:
	OM_uint32	major_status, minor_status;
	unsigned int	msg_ctx;
	gss_buffer_desc	msg;
    PPCODE:
	msg_ctx = 0;
	do {
	    major_status =
		gss_display_status(&minor_status, code, type,
				   GSS_C_NO_OID, &msg_ctx, &msg);
	    if (GSS_ERROR(major_status)) {
		gss_release_buffer(&minor_status, &msg);
		break;
	    }
	    XPUSHs(sv_2mortal(newSVpvn(msg.value, msg.length)));
	    gss_release_buffer(&minor_status, &msg);
	} while (msg_ctx);