44 * darcy@druid.net
55 * http://www.druid.net/darcy/
66 *
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 $
88 * best viewed with tabs set to 4
99 */
1010
@@ -75,14 +75,14 @@ chkpass_in(PG_FUNCTION_ARGS)
7575result = (chkpass * )palloc (sizeof (chkpass ));
7676strncpy (result -> password ,str + 1 ,13 );
7777result -> password [13 ]= 0 ;
78- return PointerGetDatum (result );
78+ PG_RETURN_POINTER (result );
7979}
8080
8181if (verify_pass (str )!= 0 )
8282{
8383elog (ERROR ,"chkpass_in: purported CHKPASS \"%s\" is a weak password" ,
8484str );
85- return PointerGetDatum (NULL );
85+ PG_RETURN_POINTER (NULL );
8686}
8787
8888result = (chkpass * )palloc (sizeof (chkpass ));
@@ -98,7 +98,7 @@ chkpass_in(PG_FUNCTION_ARGS)
9898mysalt [2 ]= 0 ;/* technically the terminator is not
9999 * necessary but I like to play safe */
100100strcpy (result -> password ,crypt (str ,mysalt ));
101- return PointerGetDatum (result );
101+ PG_RETURN_POINTER (result );
102102}
103103
104104/*
@@ -114,7 +114,7 @@ chkpass_out(PG_FUNCTION_ARGS)
114114char * result ;
115115
116116if (password == NULL )
117- return PointerGetDatum (NULL );
117+ PG_RETURN_POINTER (NULL );
118118
119119if ((result = (char * )palloc (16 ))!= NULL )
120120{
@@ -138,7 +138,7 @@ chkpass_rout(PG_FUNCTION_ARGS)
138138text * result = NULL ;
139139
140140if (password == NULL )
141- return PointerGetDatum (NULL );
141+ PG_RETURN_POINTER (NULL );
142142
143143if ((result = (text * )palloc (VARHDRSZ + 16 ))!= NULL )
144144{
@@ -181,7 +181,7 @@ chkpass_ne(PG_FUNCTION_ARGS)
181181char str [10 ];
182182int sz = 8 ;
183183
184- if (!a1 || !a2 )return 0 ;
184+ if (!a1 || !a2 )PG_RETURN_BOOL ( 0 ) ;
185185if (a2 -> vl_len < 12 )sz = a2 -> vl_len - 4 ;
186186strncpy (str ,a2 -> vl_dat ,sz );
187187str [sz ]= 0 ;