VirtualBox

Ignore:
Timestamp:
Nov 7, 2023 11:49:26 AM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Remove an unused code in nsprpub, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prio.h

    r101930 r101935  
    7272#define PR_Listen VBoxNsprPR_Listen
    7373#define PR_Accept VBoxNsprPR_Accept
    74 #define PR_OpenDir VBoxNsprPR_OpenDir
    75 #define PR_ReadDir VBoxNsprPR_ReadDir
    76 #define PR_CloseDir VBoxNsprPR_CloseDir
    7774#define PR_CreatePipe VBoxNsprPR_CreatePipe
    7875#define PR_GetDescType VBoxNsprPR_GetDescType
     
    962959NSPR_API(PRStatus)      PR_Sync(PRFileDesc *fd);
    963960
    964 /************************************************************************/
    965 
    966 struct PRDirEntry {
    967     const char *name;        /* name of entry, relative to directory name */
    968 };
    969 
    970 #if !defined(NO_NSPR_10_SUPPORT)
    971 #define PR_DirName(dirEntry)    (dirEntry->name)
    972 #endif
    973 
    974 /*
    975  *************************************************************************
    976  * FUNCTION: PR_OpenDir
    977  * DESCRIPTION:
    978  *     Open the directory by the given name
    979  * INPUTS:
    980  *     const char *name
    981  *         path name of the directory to be opened
    982  * OUTPUTS:
    983  *     None
    984  * RETURN: PRDir *
    985  *     If the directory is sucessfully opened, a PRDir object is
    986  *     dynamically allocated and a pointer to it is returned.
    987  *     If the directory cannot be opened, a NULL pointer is returned.
    988  * MEMORY:
    989  *     Upon successful completion, the return value points to
    990  *     dynamically allocated memory.
    991  *************************************************************************
    992  */
    993 
    994 NSPR_API(PRDir*) PR_OpenDir(const char *name);
    995 
    996 /*
    997  *************************************************************************
    998  * FUNCTION: PR_ReadDir
    999  * DESCRIPTION:
    1000  * INPUTS:
    1001  *     PRDir *dir
    1002  *         pointer to a PRDir object that designates an open directory
    1003  *     PRDirFlags flags
    1004  *           PR_SKIP_NONE     Do not skip any files
    1005  *           PR_SKIP_DOT      Skip the directory entry "." that
    1006  *                            represents the current directory
    1007  *           PR_SKIP_DOT_DOT  Skip the directory entry ".." that
    1008  *                            represents the parent directory.
    1009  *           PR_SKIP_BOTH     Skip both '.' and '..'
    1010  *           PR_SKIP_HIDDEN   Skip hidden files
    1011  * OUTPUTS:
    1012  * RETURN: PRDirEntry*
    1013  *     Returns a pointer to the next entry in the directory.  Returns
    1014  *     a NULL pointer upon reaching the end of the directory or when an
    1015  *     error occurs. The actual reason can be retrieved via PR_GetError().
    1016  *************************************************************************
    1017  */
    1018 
    1019 typedef enum PRDirFlags {
    1020     PR_SKIP_NONE = 0x0,
    1021     PR_SKIP_DOT = 0x1,
    1022     PR_SKIP_DOT_DOT = 0x2,
    1023     PR_SKIP_BOTH = 0x3,
    1024     PR_SKIP_HIDDEN = 0x4
    1025 } PRDirFlags;
    1026 
    1027 NSPR_API(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags);
    1028 
    1029 /*
    1030  *************************************************************************
    1031  * FUNCTION: PR_CloseDir
    1032  * DESCRIPTION:
    1033  *     Close the specified directory.
    1034  * INPUTS:
    1035  *     PRDir *dir
    1036  *        The directory to be closed.
    1037  * OUTPUTS:
    1038  *     None
    1039  * RETURN: PRStatus
    1040  *        If successful, will return a status of PR_SUCCESS. Otherwise
    1041  *        a value of PR_FAILURE. The reason for the failure may be re-
    1042  *        trieved using PR_GetError().
    1043  *************************************************************************
    1044  */
    1045 
    1046 NSPR_API(PRStatus) PR_CloseDir(PRDir *dir);
    1047 
    1048961/*
    1049962 *************************************************************************
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101905 r101935  
    499499                         * the address family of the socket. */
    500500#endif
    501 };
    502 
    503 struct PRDir {
    504     PRDirEntry d;
    505     _MDDir md;
    506501};
    507502
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c

    r101930 r101935  
    20992099    return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
    21002100}  /* PR_GetFileInfo64 */
    2101 
    2102 PR_IMPLEMENT(PRStatus) PR_CloseDir(PRDir *dir)
    2103 {
    2104     if (pt_TestAbort()) return PR_FAILURE;
    2105 
    2106     if (NULL != dir->md.d)
    2107     {
    2108         if (closedir(dir->md.d) == -1)
    2109         {
    2110             _PR_MD_MAP_CLOSEDIR_ERROR(errno);
    2111             return PR_FAILURE;
    2112         }
    2113         dir->md.d = NULL;
    2114         PR_DELETE(dir);
    2115     }
    2116     return PR_SUCCESS;
    2117 }  /* PR_CloseDir */
    2118 
    2119 PR_IMPLEMENT(PRDir*) PR_OpenDir(const char *name)
    2120 {
    2121     DIR *osdir;
    2122     PRDir *dir = NULL;
    2123 
    2124     if (pt_TestAbort()) return dir;
    2125 
    2126     osdir = opendir(name);
    2127     if (osdir == NULL)
    2128         pt_MapError(_PR_MD_MAP_OPENDIR_ERROR, errno);
    2129     else
    2130     {
    2131         dir = PR_NEWZAP(PRDir);
    2132         dir->md.d = osdir;
    2133     }
    2134     return dir;
    2135 }  /* PR_OpenDir */
    21362101
    21372102static PRInt32 _pr_poll_with_poll(
     
    23882353}
    23892354
    2390 PR_IMPLEMENT(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags)
    2391 {
    2392     struct dirent *dp;
    2393 
    2394     if (pt_TestAbort()) return NULL;
    2395 
    2396     for (;;)
    2397     {
    2398         dp = readdir(dir->md.d);
    2399         if (NULL == dp) return NULL;
    2400         if ((flags & PR_SKIP_DOT)
    2401             && ('.' == dp->d_name[0])
    2402             && (0 == dp->d_name[1])) continue;
    2403         if ((flags & PR_SKIP_DOT_DOT)
    2404             && ('.' == dp->d_name[0])
    2405             && ('.' == dp->d_name[1])
    2406             && (0 == dp->d_name[2])) continue;
    2407         if ((flags & PR_SKIP_HIDDEN) && ('.' == dp->d_name[0]))
    2408             continue;
    2409         break;
    2410     }
    2411     dir->d.name = dp->d_name;
    2412     return &dir->d;
    2413 }  /* PR_ReadDir */
    2414 
    24152355PR_IMPLEMENT(PRFileDesc*) PR_OpenTCPSocket(PRIntn af)
    24162356{
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette