Back to index

lightning-sunbird  0.9+nobinonly
Functions
prdir.c File Reference
#include "primpl.h"

Go to the source code of this file.

Functions

 PR_IMPLEMENT (PRDir *)
 PR_IMPLEMENT (PRDirEntry *)
 PR_IMPLEMENT (PRStatus)

Function Documentation

Definition at line 41 of file prdir.c.

{
    PRDir *dir;
    PRStatus sts;

    dir = PR_NEW(PRDir);
    if (dir) {
        sts = _PR_MD_OPEN_DIR(&dir->md,name);
        if (sts != PR_SUCCESS) {
            PR_DELETE(dir);
            return NULL;
        }
    } else {
              PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
       }
    return dir;
}

Definition at line 59 of file prdir.c.

{
    /* _MD_READ_DIR return a char* to the name; allocation in machine-dependent code */
    char* name = _PR_MD_READ_DIR(&dir->md, flags);
    dir->d.name = name;
    return name ? &dir->d : NULL;
}

Definition at line 67 of file prdir.c.

{
PRInt32 rv;

    if (dir) {
        rv = _PR_MD_CLOSE_DIR(&dir->md);
              PR_DELETE(dir);
              if (rv < 0) {
                     return PR_FAILURE;
              } else
                     return PR_SUCCESS;
    }
       return PR_SUCCESS;
}