OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } /* end FlipSlashes() */ | 666 } /* end FlipSlashes() */ |
667 | 667 |
668 | 668 |
669 /* | 669 /* |
670 ** | 670 ** |
671 ** Local implementations of standard Unix RTL functions which are not provided | 671 ** Local implementations of standard Unix RTL functions which are not provided |
672 ** by the VC RTL. | 672 ** by the VC RTL. |
673 ** | 673 ** |
674 */ | 674 */ |
675 | 675 |
676 PRStatus | 676 PRInt32 |
677 _PR_MD_CLOSE_DIR(_MDDir *d) | 677 _PR_MD_CLOSE_DIR(_MDDir *d) |
678 { | 678 { |
679 if ( d ) { | 679 if ( d ) { |
680 if (FindClose(d->d_hdl)) { | 680 if (FindClose(d->d_hdl)) { |
681 d->magic = (PRUint32)-1; | 681 d->magic = (PRUint32)-1; |
682 return PR_SUCCESS; | 682 return 0; |
683 } else { | 683 } else { |
684 _PR_MD_MAP_CLOSEDIR_ERROR(GetLastError()); | 684 _PR_MD_MAP_CLOSEDIR_ERROR(GetLastError()); |
685 » return PR_FAILURE; | 685 » return -1; |
686 } | 686 } |
687 } | 687 } |
688 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); | 688 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); |
689 return PR_FAILURE; | 689 return -1; |
690 } | 690 } |
691 | 691 |
692 | 692 |
693 PRStatus | 693 PRStatus |
694 _PR_MD_OPEN_DIR(_MDDir *d, const char *name) | 694 _PR_MD_OPEN_DIR(_MDDir *d, const char *name) |
695 { | 695 { |
696 char filename[ MAX_PATH ]; | 696 char filename[ MAX_PATH ]; |
697 size_t len; | 697 size_t len; |
698 | 698 |
699 len = strlen(name); | 699 len = strlen(name); |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 } | 1571 } |
1572 err = GetLastError(); | 1572 err = GetLastError(); |
1573 PR_ASSERT(NO_ERROR != err); | 1573 PR_ASSERT(NO_ERROR != err); |
1574 _PR_MD_MAP_READDIR_ERROR(err); | 1574 _PR_MD_MAP_READDIR_ERROR(err); |
1575 return NULL; | 1575 return NULL; |
1576 } | 1576 } |
1577 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); | 1577 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); |
1578 return NULL; | 1578 return NULL; |
1579 } | 1579 } |
1580 | 1580 |
1581 PRStatus | 1581 PRInt32 |
1582 _PR_MD_CLOSE_DIR_UTF16(_MDDirUTF16 *d) | 1582 _PR_MD_CLOSE_DIR_UTF16(_MDDirUTF16 *d) |
1583 { | 1583 { |
1584 if ( d ) { | 1584 if ( d ) { |
1585 if (FindClose(d->d_hdl)) { | 1585 if (FindClose(d->d_hdl)) { |
1586 d->magic = (PRUint32)-1; | 1586 d->magic = (PRUint32)-1; |
1587 return PR_SUCCESS; | 1587 return 0; |
1588 } else { | 1588 } else { |
1589 _PR_MD_MAP_CLOSEDIR_ERROR(GetLastError()); | 1589 _PR_MD_MAP_CLOSEDIR_ERROR(GetLastError()); |
1590 return PR_FAILURE; | 1590 return -1; |
1591 } | 1591 } |
1592 } | 1592 } |
1593 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); | 1593 PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); |
1594 return PR_FAILURE; | 1594 return -1; |
1595 } | 1595 } |
1596 | 1596 |
1597 #define _PR_IS_W_SLASH(ch) ((ch) == L'/' || (ch) == L'\\') | 1597 #define _PR_IS_W_SLASH(ch) ((ch) == L'/' || (ch) == L'\\') |
1598 | 1598 |
1599 /* | 1599 /* |
1600 * IsRootDirectoryW -- | 1600 * IsRootDirectoryW -- |
1601 * | 1601 * |
1602 * Return PR_TRUE if the pathname 'fn' is a valid root directory, | 1602 * Return PR_TRUE if the pathname 'fn' is a valid root directory, |
1603 * else return PR_FALSE. The PRUnichar buffer pointed to by 'fn' must | 1603 * else return PR_FALSE. The PRUnichar buffer pointed to by 'fn' must |
1604 * be writable. During the execution of this function, the contents | 1604 * be writable. During the execution of this function, the contents |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 info->creationTime = info->modifyTime; | 1777 info->creationTime = info->modifyTime; |
1778 } else { | 1778 } else { |
1779 _PR_FileTimeToPRTime(&findFileData.ftCreationTime, | 1779 _PR_FileTimeToPRTime(&findFileData.ftCreationTime, |
1780 &info->creationTime); | 1780 &info->creationTime); |
1781 } | 1781 } |
1782 | 1782 |
1783 return 0; | 1783 return 0; |
1784 } | 1784 } |
1785 /* ================ end of UTF16 Interfaces ================================ */ | 1785 /* ================ end of UTF16 Interfaces ================================ */ |
1786 #endif /* MOZ_UNICODE */ | 1786 #endif /* MOZ_UNICODE */ |
OLD | NEW |