Пример #1
0
static void
s_load_certs_from_disk (zcertstore_t *self)
{
    zhashx_purge (self->certs);
    zdir_t *dir = zdir_new (self->location, NULL);
    if (dir) {
        //  Load all certificates including those in subdirectories
        zfile_t **filelist = zdir_flatten (dir);
        assert (filelist);
        zrex_t *rex = zrex_new ("_secret$");
        assert (rex);

        uint index;
        for (index = 0;; index++) {
            zfile_t *file = filelist [index];
            if (!file)
                break;      //  End of list
            if (zfile_is_regular (file)
            && !zrex_matches (rex, zfile_filename (file, NULL))) {
                zcert_t *cert = zcert_load (zfile_filename (file, NULL));
                if (cert)
                    zcertstore_insert (self, &cert);
            }
        }
        zdir_flatten_free (&filelist);
        self->modified = zdir_modified (dir);
        self->count = zdir_count (dir);
        self->cursize = zdir_cursize (dir);

        zrex_destroy (&rex);
        zdir_destroy (&dir);
    }
}
Пример #2
0
void
zcertstore_empty (zcertstore_t *self)
{
    zhashx_purge (self->certs);
}
Пример #3
0
JNIEXPORT void JNICALL
Java_org_zeromq_czmq_Zhashx__1_1purge (JNIEnv *env, jclass c, jlong self)
{
    zhashx_purge ((zhashx_t *) (intptr_t) self);
}
Пример #4
0
///
//  Delete all items from the hash table. If the key destructor is  
//  set, calls it on every key. If the item destructor is set, calls
//  it on every item.                                               
void QZhashx::purge ()
{
    zhashx_purge (self);
    
}