4
4
* darcy@druid.net
5
5
* http://www.druid.net/darcy/
6
6
*
7
- * $Id: chkpass.c,v 1.3 2001/05/28 15:34:27 darcy Exp $
7
+ * $Id: chkpass.c,v 1.4 2001/05/30 02:11:46 darcy Exp $
8
8
* best viewed with tabs set to 4
9
9
*/
10
10
@@ -75,14 +75,14 @@ chkpass_in(PG_FUNCTION_ARGS)
75
75
result = (chkpass * )palloc (sizeof (chkpass ));
76
76
strncpy (result -> password ,str + 1 ,13 );
77
77
result -> password [13 ]= 0 ;
78
- return PointerGetDatum (result );
78
+ PG_RETURN_POINTER (result );
79
79
}
80
80
81
81
if (verify_pass (str )!= 0 )
82
82
{
83
83
elog (ERROR ,"chkpass_in: purported CHKPASS \"%s\" is a weak password" ,
84
84
str );
85
- return PointerGetDatum (NULL );
85
+ PG_RETURN_POINTER (NULL );
86
86
}
87
87
88
88
result = (chkpass * )palloc (sizeof (chkpass ));
@@ -98,7 +98,7 @@ chkpass_in(PG_FUNCTION_ARGS)
98
98
mysalt [2 ]= 0 ;/* technically the terminator is not
99
99
* necessary but I like to play safe */
100
100
strcpy (result -> password ,crypt (str ,mysalt ));
101
- return PointerGetDatum (result );
101
+ PG_RETURN_POINTER (result );
102
102
}
103
103
104
104
/*
@@ -114,7 +114,7 @@ chkpass_out(PG_FUNCTION_ARGS)
114
114
char * result ;
115
115
116
116
if (password == NULL )
117
- return PointerGetDatum (NULL );
117
+ PG_RETURN_POINTER (NULL );
118
118
119
119
if ((result = (char * )palloc (16 ))!= NULL )
120
120
{
@@ -138,7 +138,7 @@ chkpass_rout(PG_FUNCTION_ARGS)
138
138
text * result = NULL ;
139
139
140
140
if (password == NULL )
141
- return PointerGetDatum (NULL );
141
+ PG_RETURN_POINTER (NULL );
142
142
143
143
if ((result = (text * )palloc (VARHDRSZ + 16 ))!= NULL )
144
144
{
@@ -181,7 +181,7 @@ chkpass_ne(PG_FUNCTION_ARGS)
181
181
char str [10 ];
182
182
int sz = 8 ;
183
183
184
- if (!a1 || !a2 )return 0 ;
184
+ if (!a1 || !a2 )PG_RETURN_BOOL ( 0 ) ;
185
185
if (a2 -> vl_len < 12 )sz = a2 -> vl_len - 4 ;
186
186
strncpy (str ,a2 -> vl_dat ,sz );
187
187
str [sz ]= 0 ;