Mac OS X x86 assembler support.
[openssl.git] / crypto / engine / eng_table.c
index a83c3899ee111f02304a9af6bb0263f2a0a3ba8d..3e892c8a621d62a9658fce4fb35eb3b0fc52ce6f 100644 (file)
@@ -76,6 +76,14 @@ struct st_engine_table
        LHASH piles;
        }; /* ENGINE_TABLE */
 
+
+typedef struct st_engine_pile_doall
+       {
+       engine_table_doall_cb *cb;
+       void *arg;
+       } ENGINE_PILE_DOALL;
+       
+
 /* Global flags (ENGINE_TABLE_FLAG_***). */
 static unsigned int table_flags = 0;
 
@@ -147,7 +155,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
                        lh_insert(&(*table)->piles, fnd);
                        }
                /* A registration shouldn't add duplciate entries */
-               sk_ENGINE_delete_ptr(fnd->sk, e);
+               (void)sk_ENGINE_delete_ptr(fnd->sk, e);
                /* if 'setdefault', this ENGINE goes to the head of the list */
                if(!sk_ENGINE_push(fnd->sk, e))
                        goto end;
@@ -178,7 +186,7 @@ static void int_unregister_cb(ENGINE_PILE *pile, ENGINE *e)
        /* Iterate the 'c->sk' stack removing any occurance of 'e' */
        while((n = sk_ENGINE_find(pile->sk, e)) >= 0)
                {
-               sk_ENGINE_delete(pile->sk, n);
+               (void)sk_ENGINE_delete(pile->sk, n);
                /* "touch" this ENGINE_CIPHER */
                pile->uptodate = 1;
                }
@@ -313,3 +321,21 @@ end:
        ERR_clear_error();
        return ret;
        }
+
+/* Table enumeration */
+
+static void int_doall_cb(ENGINE_PILE *pile, ENGINE_PILE_DOALL *dall)
+       {
+       dall->cb(pile->nid, pile->sk, pile->funct, dall->arg);
+       }
+
+static IMPLEMENT_LHASH_DOALL_ARG_FN(int_doall_cb,ENGINE_PILE *,ENGINE_PILE_DOALL *)
+void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,
+                                                               void *arg)
+       {
+       ENGINE_PILE_DOALL dall;
+       dall.cb = cb;
+       dall.arg = arg;
+       lh_doall_arg(&table->piles,
+                       LHASH_DOALL_ARG_FN(int_doall_cb), &dall);
+       }