* darcy@druid.net
* http://www.druid.net/darcy/
*
- * $Id: chkpass.c,v 1.3 2001/05/28 15:34:27 darcy Exp $
+ * $Id: chkpass.c,v 1.4 2001/05/30 02:11:46 darcy Exp $
* best viewed with tabs set to 4
*/
result = (chkpass *) palloc(sizeof(chkpass));
strncpy(result->password, str + 1, 13);
result->password[13] = 0;
- return PointerGetDatum(result);
+ PG_RETURN_POINTER(result);
}
if (verify_pass(str) != 0)
{
elog(ERROR, "chkpass_in: purported CHKPASS \"%s\" is a weak password",
str);
- return PointerGetDatum(NULL);
+ PG_RETURN_POINTER(NULL);
}
result = (chkpass *) palloc(sizeof(chkpass));
mysalt[2] = 0; /* technically the terminator is not
* necessary but I like to play safe */
strcpy(result->password, crypt(str, mysalt));
- return PointerGetDatum(result);
+ PG_RETURN_POINTER(result);
}
/*
char *result;
if (password == NULL)
- return PointerGetDatum(NULL);
+ PG_RETURN_POINTER(NULL);
if ((result = (char *) palloc(16)) != NULL)
{
text *result = NULL;
if (password == NULL)
- return PointerGetDatum(NULL);
+ PG_RETURN_POINTER(NULL);
if ((result = (text *) palloc(VARHDRSZ + 16)) != NULL)
{
char str[10];
int sz = 8;
- if (!a1 || !a2) return 0;
+ if (!a1 || !a2) PG_RETURN_BOOL(0);
if (a2->vl_len < 12) sz = a2->vl_len - 4;
strncpy(str, a2->vl_dat, sz);
str[sz] = 0;