<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># HG changeset patch
# Parent ba07a0acb7a58d24df9ba0851ea34401aff8ec34
Remove _t suffix from typedefs in auth.h, auth.c.

diff -r ba07a0acb7a5 src/auth.c
--- a/src/auth.c
+++ b/src/auth.c
@@ -26,26 +26,26 @@
 
 typedef struct {
    int ok;
-   enum AuthParseHTTPAuthType_t type;
+   AuthParseHTTPAuthType type;
    const char *realm;
    const char *nonce;
    const char *opaque;
    int stale;
-   enum AuthParseDigestAlgorithm_t algorithm;
+   AuthParseDigestAlgorithm algorithm;
    const char *domain;
-   enum AuthParseDigestQOP_t qop;
-} AuthParse_t;
+   AuthParseDigestQOP qop;
+} AuthParse;
 
 typedef struct {
    char *scheme;
    char *authority;
    Dlist *realms;
-} AuthHost_t;
+} AuthHost;
 
 typedef struct {
-   const AuthParse_t *auth_parse;
+   const AuthParse *auth_parse;
    const DilloUrl *url;
-} AuthDialogData_t;
+} AuthDialogData;
 
 /*
  *  Local data
@@ -60,9 +60,9 @@
    auth_hosts = dList_new(1);
 }
 
-static AuthParse_t *Auth_parse_new()
+static AuthParse *Auth_parse_new()
 {
-   AuthParse_t *auth_parse = dNew(AuthParse_t, 1);
+   AuthParse *auth_parse = dNew(AuthParse, 1);
    auth_parse-&gt;ok = 0;
    auth_parse-&gt;type = TYPENOTSET;
    auth_parse-&gt;realm = NULL;
@@ -75,7 +75,7 @@
    return auth_parse;
 }
 
-static void Auth_parse_free(AuthParse_t *auth_parse)
+static void Auth_parse_free(AuthParse *auth_parse)
 {
    if (auth_parse) {
       dFree((void *)auth_parse-&gt;realm);
@@ -147,9 +147,9 @@
    return result;
 }
 
-typedef int (Auth_parse_token_value_callback_t)(AuthParse_t *auth_parse,
-                                                char *token,
-                                                const char *value);
+typedef int (Auth_parse_token_value_callback)(AuthParse *auth_parse,
+                                              char *token,
+                                              const char *value);
 
 
 /*
@@ -160,8 +160,8 @@
  *
  * Return: 1 if the parse succeeds, 0 otherwise.
  */
-static int Auth_parse_token_value(AuthParse_t *auth_parse, char **auth,
-                                  Auth_parse_token_value_callback_t *callback)
+static int Auth_parse_token_value(AuthParse *auth_parse, char **auth,
+                                  Auth_parse_token_value_callback *callback)
 {
    char keep_going, expect_quoted;
    char *token, *beyond_token;
@@ -225,7 +225,7 @@
    return 1;
 }
 
-static int Auth_parse_basic_challenge_cb(AuthParse_t *auth_parse, char *token,
+static int Auth_parse_basic_challenge_cb(AuthParse *auth_parse, char *token,
                                          const char *value)
 {
    if (dStrAsciiCasecmp("realm", token) == 0) {
@@ -238,7 +238,7 @@
    return 1;
 }
 
-static int Auth_parse_digest_challenge_cb(AuthParse_t *auth_parse, char *token,
+static int Auth_parse_digest_challenge_cb(AuthParse *auth_parse, char *token,
                                           const char *value)
 {
    const char *const fn = "Auth_parse_digest_challenge_cb";
@@ -301,9 +301,9 @@
    return 1;
 }
 
-static void Auth_parse_challenge_args(AuthParse_t *auth_parse,
+static void Auth_parse_challenge_args(AuthParse *auth_parse,
                                       char **challenge,
-                                      Auth_parse_token_value_callback_t *cb)
+                                      Auth_parse_token_value_callback *cb)
 {
    /* parse comma-separated token-value pairs */
    while (1) {
@@ -335,9 +335,9 @@
    }
 }
 
-static void Auth_parse_challenge(AuthParse_t *auth_parse, char *challenge)
+static void Auth_parse_challenge(AuthParse *auth_parse, char *challenge)
 {
-   Auth_parse_token_value_callback_t *cb;
+   Auth_parse_token_value_callback *cb;
 
    MSG("auth.c: Auth_parse_challenge: challenge = '%s'\n", challenge);
    if (auth_parse-&gt;type == DIGEST) {
@@ -353,9 +353,9 @@
 /*
  * Return the host that contains a URL, or NULL if there is no such host.
  */
-static AuthHost_t *Auth_host_by_url(const DilloUrl *url)
+static AuthHost *Auth_host_by_url(const DilloUrl *url)
 {
-   AuthHost_t *host;
+   AuthHost *host;
    int i;
 
    for (i = 0; (host = dList_nth_data(auth_hosts, i)); i++)
@@ -369,10 +369,10 @@
 /*
  * Search all realms for the one with the given name.
  */
-static AuthRealm_t *Auth_realm_by_name(const AuthHost_t *host,
+static AuthRealm *Auth_realm_by_name(const AuthHost *host,
                                            const char *name)
 {
-   AuthRealm_t *realm;
+   AuthRealm *realm;
    int i;
 
    for (i = 0; (realm = dList_nth_data(host-&gt;realms, i)); i++)
@@ -385,10 +385,10 @@
 /*
  * Search all realms for the one with the best-matching path.
  */
-static AuthRealm_t *Auth_realm_by_path(const AuthHost_t *host,
+static AuthRealm *Auth_realm_by_path(const AuthHost *host,
                                        const char *path)
 {
-   AuthRealm_t *realm_best, *realm;
+   AuthRealm *realm_best, *realm;
    int i, j;
    int match_length = 0;
 
@@ -409,7 +409,7 @@
    return realm_best;
 }
 
-static void Auth_realm_delete(AuthRealm_t *realm)
+static void Auth_realm_delete(AuthRealm *realm)
 {
    int i;
 
@@ -427,7 +427,7 @@
    dFree(realm);
 }
 
-static int Auth_realm_includes_path(const AuthRealm_t *realm, const char *path)
+static int Auth_realm_includes_path(const AuthRealm *realm, const char *path)
 {
    int i;
    char *realm_path;
@@ -439,7 +439,7 @@
    return 0;
 }
 
-static void Auth_realm_add_path(AuthRealm_t *realm, const char *path)
+static void Auth_realm_add_path(AuthRealm *realm, const char *path)
 {
    int len, i;
    char *realm_path, *n_path;
@@ -471,8 +471,8 @@
 char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri)
 {
    char *ret = NULL;
-   AuthHost_t *host;
-   AuthRealm_t *realm;
+   AuthHost *host;
+   AuthRealm *realm;
 
    if ((host = Auth_host_by_url(url)) &amp;&amp;
        (realm = Auth_realm_by_path(host, URL_PATH(url)))) {
@@ -490,7 +490,7 @@
 /*
  * Determine whether the user needs to authenticate.
  */
-static int Auth_do_auth_required(const AuthParse_t *auth_parse,
+static int Auth_do_auth_required(const AuthParse *auth_parse,
                                  const DilloUrl *url)
 {
    /*
@@ -500,8 +500,8 @@
     * recorded its authentication, and whether it was accepted?  (JCH)
     */
 
-   AuthHost_t *host;
-   AuthRealm_t *realm;
+   AuthHost *host;
+   AuthRealm *realm;
 
    /*
     * The size of the following comments reflects the concerns in the
@@ -545,16 +545,16 @@
 static void Auth_do_auth_dialog_cb(const char *user, const char *password,
                                    void *vData)
 {
-   AuthDialogData_t *data;
-   AuthHost_t *host;
-   AuthRealm_t *realm;
+   AuthDialogData *data;
+   AuthHost *host;
+   AuthRealm *realm;
 
-   data = (AuthDialogData_t *)vData;
+   data = (AuthDialogData *)vData;
 
    /* find or create the host */
    if (!(host = Auth_host_by_url(data-&gt;url))) {
       /* create a new host */
-      host = dNew(AuthHost_t, 1);
+      host = dNew(AuthHost, 1);
       host-&gt;scheme = dStrdup(URL_SCHEME(data-&gt;url));
       host-&gt;authority = dStrdup(URL_AUTHORITY(data-&gt;url));
       host-&gt;realms = dList_new(1);
@@ -563,7 +563,7 @@
 
    /* find or create the realm */
    if (!(realm = Auth_realm_by_name(host, data-&gt;auth_parse-&gt;realm))) {
-      realm = dNew0(AuthRealm_t, 1);
+      realm = dNew0(AuthRealm, 1);
       realm-&gt;name = dStrdup(data-&gt;auth_parse-&gt;realm);
       realm-&gt;paths = dList_new(1);
       dList_append(host-&gt;realms, realm);
@@ -615,12 +615,12 @@
  * Return: Nonzero if we got new credentials from the user and everything
  * seems fine.
  */
-static int Auth_do_auth_dialog(const AuthParse_t *auth_parse,
+static int Auth_do_auth_dialog(const AuthParse *auth_parse,
                                const DilloUrl *url)
 {
    int ret;
    char *title, *msg;
-   AuthDialogData_t *data;
+   AuthDialogData *data;
    const char *typestr = auth_parse-&gt;type == DIGEST ? "Digest" : "Basic";
 
    _MSG("auth.c: Auth_do_auth_dialog: realm = '%s'\n", auth_parse-&gt;realm);
@@ -629,7 +629,7 @@
    msg = dStrconcat("The server at ", URL_HOST(url), " requires a username"
                     " and password for  \"", auth_parse-&gt;realm, "\".\n\n"
                     "Authentication scheme: ", typestr, NULL);
-   data = dNew(AuthDialogData_t, 1);
+   data = dNew(AuthDialogData, 1);
    data-&gt;auth_parse = auth_parse;
    data-&gt;url = a_Url_dup(url);
    ret = a_Dialog_user_password(title, msg, Auth_do_auth_dialog_cb, data);
@@ -642,10 +642,10 @@
 /*
  * Do authorization for an auth string.
  */
-static int Auth_do_auth(char *challenge, enum AuthParseHTTPAuthType_t type,
+static int Auth_do_auth(char *challenge, AuthParseHTTPAuthType type,
                         const DilloUrl *url)
 {
-   AuthParse_t *auth_parse;
+   AuthParse *auth_parse;
    int reload = 0;
 
    _MSG("auth.c: Auth_do_auth: challenge={%s}\n", challenge);
diff -r ba07a0acb7a5 src/auth.h
--- a/src/auth.h
+++ b/src/auth.h
@@ -7,12 +7,12 @@
 
 #include "url.h"
 
-enum AuthParseHTTPAuthType_t { TYPENOTSET, BASIC, DIGEST };
-enum AuthParseDigestAlgorithm_t { ALGORITHMNOTSET, MD5, MD5SESS };
-enum AuthParseDigestQOP_t { QOPNOTSET, AUTH, AUTHINT };
+typedef enum { TYPENOTSET, BASIC, DIGEST } AuthParseHTTPAuthType;
+typedef enum { ALGORITHMNOTSET, MD5, MD5SESS } AuthParseDigestAlgorithm;
+typedef enum { QOPNOTSET, AUTH, AUTHINT } AuthParseDigestQOP;
 
 typedef struct {
-   enum AuthParseHTTPAuthType_t type;
+   AuthParseHTTPAuthType type;
    char *name;
    Dlist *paths; /* stripped of any trailing '/', so the root path is "" */
    char *authorization; /* BASIC: the authorization request header */
@@ -23,10 +23,10 @@
    unsigned int nonce_count;
    char *nonce;
    char *opaque;
-   enum AuthParseDigestAlgorithm_t algorithm;
+   AuthParseDigestAlgorithm algorithm;
    char *domain; /* NOT USED */
-   enum AuthParseDigestQOP_t qop;
-} AuthRealm_t;
+   AuthParseDigestQOP qop;
+} AuthRealm;
 
 
 char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri);
diff -r ba07a0acb7a5 src/digest.c
--- a/src/digest.c
+++ b/src/digest.c
@@ -51,7 +51,7 @@
 /*
  * This portion only has to be calculated once.
  */
-int a_Digest_compute_digest(AuthRealm_t *realm, const char *username,
+int a_Digest_compute_digest(AuthRealm *realm, const char *username,
                             const char *passwd)
 {
    Dstr *a1;
@@ -89,7 +89,7 @@
 /*
  * This portion is calculatd for each request.
  */
-static Dstr *Digest_create_response(AuthRealm_t *realm, const char *method,
+static Dstr *Digest_create_response(AuthRealm *realm, const char *method,
                                     const char *digest_uri,
                                     const Dstr *entity_body)
 {
@@ -166,7 +166,7 @@
  * algorithm, response, qop". It apparently doesn't use "opaque", so that's
  * been left where it already was.
  */
-char *a_Digest_authorization_hdr(AuthRealm_t *realm, const DilloUrl *url,
+char *a_Digest_authorization_hdr(AuthRealm *realm, const DilloUrl *url,
                                  const char *digest_uri)
 {
    char *ret;
diff -r ba07a0acb7a5 src/digest.h
--- a/src/digest.h
+++ b/src/digest.h
@@ -6,10 +6,10 @@
 
 
 char *a_Digest_create_cnonce(void);
-int a_Digest_compute_digest(AuthRealm_t *realm,
+int a_Digest_compute_digest(AuthRealm *realm,
                             const char *username,
                             const char *passwd);
-char *a_Digest_authorization_hdr(AuthRealm_t *realm,
+char *a_Digest_authorization_hdr(AuthRealm *realm,
                                  const DilloUrl *url,
                                  const char *uri);
 
</pre></body></html>