Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * seccomon.h - common data structures for security libraries | 6 * seccomon.h - common data structures for security libraries |
| 7 * | 7 * |
| 8 * This file should have lowest-common-denominator datastructures | 8 * This file should have lowest-common-denominator datastructures |
| 9 * for security libraries. It should not be dependent on any other | 9 * for security libraries. It should not be dependent on any other |
| 10 * headers, and should not require linking with any libraries. | 10 * headers, and should not require linking with any libraries. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 } SECItemType; | 49 } SECItemType; |
| 50 | 50 |
| 51 typedef struct SECItemStr SECItem; | 51 typedef struct SECItemStr SECItem; |
| 52 | 52 |
| 53 struct SECItemStr { | 53 struct SECItemStr { |
| 54 SECItemType type; | 54 SECItemType type; |
| 55 unsigned char *data; | 55 unsigned char *data; |
| 56 unsigned int len; | 56 unsigned int len; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 typedef struct SECItemArrayStr SECItemArray; | |
| 60 | |
| 61 struct SECItemArrayStr { | |
| 62 SECItem *items; | |
| 63 unsigned int len; | |
|
wtc
2013/04/23 00:58:05
I think this field should be renamed |nitems| or |
| |
| 64 }; | |
| 65 | |
| 59 /* | 66 /* |
| 60 ** A status code. Status's are used by procedures that return status | 67 ** A status code. Status's are used by procedures that return status |
| 61 ** values. Again the motivation is so that a compiler can generate | 68 ** values. Again the motivation is so that a compiler can generate |
| 62 ** warnings when return values are wrong. Correct testing of status codes: | 69 ** warnings when return values are wrong. Correct testing of status codes: |
| 63 ** | 70 ** |
| 64 ** SECStatus rv; | 71 ** SECStatus rv; |
| 65 ** rv = some_function (some_argument); | 72 ** rv = some_function (some_argument); |
| 66 ** if (rv != SECSuccess) | 73 ** if (rv != SECSuccess) |
| 67 ** do_an_error_thing(); | 74 ** do_an_error_thing(); |
| 68 ** | 75 ** |
| 69 */ | 76 */ |
| 70 typedef enum _SECStatus { | 77 typedef enum _SECStatus { |
| 71 SECWouldBlock = -2, | 78 SECWouldBlock = -2, |
| 72 SECFailure = -1, | 79 SECFailure = -1, |
| 73 SECSuccess = 0 | 80 SECSuccess = 0 |
| 74 } SECStatus; | 81 } SECStatus; |
| 75 | 82 |
| 76 /* | 83 /* |
| 77 ** A comparison code. Used for procedures that return comparision | 84 ** A comparison code. Used for procedures that return comparision |
| 78 ** values. Again the motivation is so that a compiler can generate | 85 ** values. Again the motivation is so that a compiler can generate |
| 79 ** warnings when return values are wrong. | 86 ** warnings when return values are wrong. |
| 80 */ | 87 */ |
| 81 typedef enum _SECComparison { | 88 typedef enum _SECComparison { |
| 82 SECLessThan = -1, | 89 SECLessThan = -1, |
| 83 SECEqual = 0, | 90 SECEqual = 0, |
| 84 SECGreaterThan = 1 | 91 SECGreaterThan = 1 |
| 85 } SECComparison; | 92 } SECComparison; |
| 86 | 93 |
| 87 #endif /* _SECCOMMON_H_ */ | 94 #endif /* _SECCOMMON_H_ */ |
| OLD | NEW |