[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/lib
From: |
shishi-commit |
Subject: |
CVS shishi/lib |
Date: |
Fri, 17 Sep 2004 16:07:01 +0200 |
Update of /home/cvs/shishi/lib
In directory dopio:/tmp/cvs-serv22847
Modified Files:
principal.c
Log Message:
Doc fix.
--- /home/cvs/shishi/lib/principal.c 2004/09/17 13:58:27 1.38
+++ /home/cvs/shishi/lib/principal.c 2004/09/17 14:07:00 1.39
@@ -98,6 +98,22 @@
handle->default_principal = NULL;
}
+/**
+ * shishi_parse_name:
+ * @handle: Shishi library handle create by shishi_init().
+ * @name: Input principal name string, e.g. imap/address@hidden
+ * @principal: newly allocated output string with principal name.
+ * @realm: newly allocated output string with realm name.
+ *
+ * Split up principal name (e.g., "address@hidden") into two
+ * newly allocated strings, the principal ("simon") and realm
+ * ("JOSEFSSON.ORG"). If there is no realm part in NAME, REALM is set
+ * to NULL.
+ *
+ * Return value: Returns SHISHI_INVALID_PRINCIPAL_NAME if NAME is NULL
+ * or ends with the escape character "\", or SHISHI_OK iff
+ * successful
+ **/
int
shishi_parse_name (Shishi * handle, const char *name,
char **principal, char **realm)
@@ -115,6 +131,9 @@
else if (*p++ == '\\')
escaped = 1;
+ if (escaped)
+ return SHISHI_INVALID_PRINCIPAL_NAME;
+
if (principal)
{
*principal = xstrndup (name, p - name + 1);
@@ -138,7 +157,7 @@
*realm = xstrdup (p);
}
else if (realm)
- *realm = xstrdup (shishi_realm_default (handle));
+ *realm = NULL;
return SHISHI_OK;
}
- CVS shishi/lib, (continued)
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib,
shishi-commit <=
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17
- CVS shishi/lib, shishi-commit, 2004/09/17