| 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 | 2 |
| 3 /* This Source Code Form is subject to the terms of the Mozilla Public | 3 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 #include "primpl.h" | 6 #include "primpl.h" |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 /*****************************************************************************/ | 10 /*****************************************************************************/ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 (PRSendfileFN)_PR_InvalidInt, | 44 (PRSendfileFN)_PR_InvalidInt, |
| 45 (PRConnectcontinueFN)_PR_InvalidStatus, | 45 (PRConnectcontinueFN)_PR_InvalidStatus, |
| 46 (PRReservedFN)_PR_InvalidInt, | 46 (PRReservedFN)_PR_InvalidInt, |
| 47 (PRReservedFN)_PR_InvalidInt, | 47 (PRReservedFN)_PR_InvalidInt, |
| 48 (PRReservedFN)_PR_InvalidInt, | 48 (PRReservedFN)_PR_InvalidInt, |
| 49 (PRReservedFN)_PR_InvalidInt | 49 (PRReservedFN)_PR_InvalidInt |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 PRIntn _PR_InvalidInt(void) | 52 PRIntn _PR_InvalidInt(void) |
| 53 { | 53 { |
| 54 PR_ASSERT(!"I/O method is invalid"); | 54 PR_NOT_REACHED("I/O method is invalid"); |
| 55 PR_SetError(PR_INVALID_METHOD_ERROR, 0); | 55 PR_SetError(PR_INVALID_METHOD_ERROR, 0); |
| 56 return -1; | 56 return -1; |
| 57 } /* _PR_InvalidInt */ | 57 } /* _PR_InvalidInt */ |
| 58 | 58 |
| 59 PRInt16 _PR_InvalidInt16(void) | 59 PRInt16 _PR_InvalidInt16(void) |
| 60 { | 60 { |
| 61 PR_ASSERT(!"I/O method is invalid"); | 61 PR_NOT_REACHED("I/O method is invalid"); |
| 62 PR_SetError(PR_INVALID_METHOD_ERROR, 0); | 62 PR_SetError(PR_INVALID_METHOD_ERROR, 0); |
| 63 return -1; | 63 return -1; |
| 64 } /* _PR_InvalidInt */ | 64 } /* _PR_InvalidInt */ |
| 65 | 65 |
| 66 PRInt64 _PR_InvalidInt64(void) | 66 PRInt64 _PR_InvalidInt64(void) |
| 67 { | 67 { |
| 68 PRInt64 rv; | 68 PRInt64 rv; |
| 69 LL_I2L(rv, -1); | 69 LL_I2L(rv, -1); |
| 70 PR_ASSERT(!"I/O method is invalid"); | 70 PR_NOT_REACHED("I/O method is invalid"); |
| 71 PR_SetError(PR_INVALID_METHOD_ERROR, 0); | 71 PR_SetError(PR_INVALID_METHOD_ERROR, 0); |
| 72 return rv; | 72 return rv; |
| 73 } /* _PR_InvalidInt */ | 73 } /* _PR_InvalidInt */ |
| 74 | 74 |
| 75 /* | 75 /* |
| 76 * An invalid method that returns PRStatus | 76 * An invalid method that returns PRStatus |
| 77 */ | 77 */ |
| 78 | 78 |
| 79 PRStatus _PR_InvalidStatus(void) | 79 PRStatus _PR_InvalidStatus(void) |
| 80 { | 80 { |
| 81 PR_ASSERT(!"I/O method is invalid"); | 81 PR_NOT_REACHED("I/O method is invalid"); |
| 82 PR_SetError(PR_INVALID_METHOD_ERROR, 0); | 82 PR_SetError(PR_INVALID_METHOD_ERROR, 0); |
| 83 return PR_FAILURE; | 83 return PR_FAILURE; |
| 84 } /* _PR_InvalidDesc */ | 84 } /* _PR_InvalidDesc */ |
| 85 | 85 |
| 86 /* | 86 /* |
| 87 * An invalid method that returns a pointer | 87 * An invalid method that returns a pointer |
| 88 */ | 88 */ |
| 89 | 89 |
| 90 PRFileDesc *_PR_InvalidDesc(void) | 90 PRFileDesc *_PR_InvalidDesc(void) |
| 91 { | 91 { |
| 92 PR_ASSERT(!"I/O method is invalid"); | 92 PR_NOT_REACHED("I/O method is invalid"); |
| 93 PR_SetError(PR_INVALID_METHOD_ERROR, 0); | 93 PR_SetError(PR_INVALID_METHOD_ERROR, 0); |
| 94 return NULL; | 94 return NULL; |
| 95 } /* _PR_InvalidDesc */ | 95 } /* _PR_InvalidDesc */ |
| 96 | 96 |
| 97 PR_IMPLEMENT(PRDescType) PR_GetDescType(PRFileDesc *file) | 97 PR_IMPLEMENT(PRDescType) PR_GetDescType(PRFileDesc *file) |
| 98 { | 98 { |
| 99 return file->methods->file_type; | 99 return file->methods->file_type; |
| 100 } | 100 } |
| 101 | 101 |
| 102 PR_IMPLEMENT(PRStatus) PR_Close(PRFileDesc *fd) | 102 PR_IMPLEMENT(PRStatus) PR_Close(PRFileDesc *fd) |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 if (buf) | 587 if (buf) |
| 588 PR_DELETE(buf); | 588 PR_DELETE(buf); |
| 589 if ((rv >= 0) && (flags & PR_TRANSMITFILE_CLOSE_SOCKET)) | 589 if ((rv >= 0) && (flags & PR_TRANSMITFILE_CLOSE_SOCKET)) |
| 590 PR_Close(sd); | 590 PR_Close(sd); |
| 591 return rv; | 591 return rv; |
| 592 } | 592 } |
| 593 | 593 |
| 594 #endif | 594 #endif |
| 595 | 595 |
| 596 /* priometh.c */ | 596 /* priometh.c */ |
| OLD | NEW |