Enable annotation of library imports.
This commit is contained in:
		@@ -37,9 +37,11 @@ NOTE:   String length must be evenly divisible by 16byte (str_len % 16 == 0)
 | 
				
			|||||||
/*****************************************************************************/
 | 
					/*****************************************************************************/
 | 
				
			||||||
/* Includes:                                                                 */
 | 
					/* Includes:                                                                 */
 | 
				
			||||||
/*****************************************************************************/
 | 
					/*****************************************************************************/
 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include "aes.h"
 | 
					#include "aes.h"
 | 
				
			||||||
#include "mpw-util.h"
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*****************************************************************************/
 | 
					/*****************************************************************************/
 | 
				
			||||||
/* Defines:                                                                  */
 | 
					/* Defines:                                                                  */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,11 @@ This is an implementation of the AES algorithm, specifically ECB and CBC mode.
 | 
				
			|||||||
#ifndef _AES_H_
 | 
					#ifndef _AES_H_
 | 
				
			||||||
#define _AES_H_
 | 
					#define _AES_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// #define the macros below to 1/0 to enable/disable the mode of operation.
 | 
					// #define the macros below to 1/0 to enable/disable the mode of operation.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,8 +54,12 @@
 | 
				
			|||||||
* project, please see <http://www.apache.org/>.
 | 
					* project, please see <http://www.apache.org/>.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @return The amount of bytes needed to decode the given b64Text.
 | 
					 * @return The amount of bytes needed to decode the given b64Text.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,12 +16,11 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NOTE: mpw is currently NOT thread-safe.
 | 
					 | 
				
			||||||
#include "mpw-types.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef _MPW_ALGORITHM_H
 | 
					#ifndef _MPW_ALGORITHM_H
 | 
				
			||||||
#define _MPW_ALGORITHM_H
 | 
					#define _MPW_ALGORITHM_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-types.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef mpw_enum( unsigned int, MPAlgorithmVersion ) {
 | 
					typedef mpw_enum( unsigned int, MPAlgorithmVersion ) {
 | 
				
			||||||
    /** V0 did math with chars whose signedness was platform-dependent. */
 | 
					    /** V0 did math with chars whose signedness was platform-dependent. */
 | 
				
			||||||
            MPAlgorithmVersion0,
 | 
					            MPAlgorithmVersion0,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,12 +16,14 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					#include "base64.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-util.h"
 | 
					 | 
				
			||||||
#include "base64.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MP_N                32768LU
 | 
					#define MP_N                32768LU
 | 
				
			||||||
#define MP_r                8U
 | 
					#define MP_r                8U
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,10 +16,12 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "mpw-util.h"
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MP_N                32768LU
 | 
					#define MP_N                32768LU
 | 
				
			||||||
#define MP_r                8U
 | 
					#define MP_r                8U
 | 
				
			||||||
#define MP_p                2U
 | 
					#define MP_p                2U
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,11 +16,13 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-util.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MP_N                32768LU
 | 
					#define MP_N                32768LU
 | 
				
			||||||
#define MP_r                8U
 | 
					#define MP_r                8U
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,10 +16,12 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-util.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MP_N                32768LU
 | 
					#define MP_N                32768LU
 | 
				
			||||||
#define MP_r                8U
 | 
					#define MP_r                8U
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,11 +16,13 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "mpw-marshal-util.h"
 | 
					#include "mpw-marshal-util.h"
 | 
				
			||||||
#include "mpw-util.h"
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
char *mpw_get_token(const char **in, const char *eol, char *delim) {
 | 
					char *mpw_get_token(const char **in, const char *eol, char *delim) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Skip leading spaces.
 | 
					    // Skip leading spaces.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,12 +19,14 @@
 | 
				
			|||||||
#ifndef _MPW_MARSHAL_UTIL_H
 | 
					#ifndef _MPW_MARSHAL_UTIL_H
 | 
				
			||||||
#define _MPW_MARSHAL_UTIL_H
 | 
					#define _MPW_MARSHAL_UTIL_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-algorithm.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#if MPW_JSON
 | 
					#if MPW_JSON
 | 
				
			||||||
#include "json-c/json.h"
 | 
					#include <json-c/json.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-algorithm.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Type parsing.
 | 
					/// Type parsing.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,14 +17,16 @@
 | 
				
			|||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <ctype.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "mpw-marshal.h"
 | 
					#include "mpw-marshal.h"
 | 
				
			||||||
#include "mpw-util.h"
 | 
					#include "mpw-util.h"
 | 
				
			||||||
#include "mpw-marshal-util.h"
 | 
					#include "mpw-marshal-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <ctype.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MPMarshalledUser *mpw_marshal_user(
 | 
					MPMarshalledUser *mpw_marshal_user(
 | 
				
			||||||
        const char *fullName, MPMasterKeyProvider masterKeyProvider, const MPAlgorithmVersion algorithmVersion) {
 | 
					        const char *fullName, MPMasterKeyProvider masterKeyProvider, const MPAlgorithmVersion algorithmVersion) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,10 +19,12 @@
 | 
				
			|||||||
#ifndef _MPW_MARSHAL_H
 | 
					#ifndef _MPW_MARSHAL_H
 | 
				
			||||||
#define _MPW_MARSHAL_H
 | 
					#define _MPW_MARSHAL_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <time.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "mpw-algorithm.h"
 | 
					#include "mpw-algorithm.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <time.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//// Types.
 | 
					//// Types.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef mpw_enum( unsigned int, MPMarshalFormat ) {
 | 
					typedef mpw_enum( unsigned int, MPMarshalFormat ) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,12 +16,14 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <ctype.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "mpw-types.h"
 | 
					#include "mpw-types.h"
 | 
				
			||||||
#include "mpw-util.h"
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <ctype.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const size_t MPMasterKeySize = 64;
 | 
					const size_t MPMasterKeySize = 64;
 | 
				
			||||||
const size_t MPSiteKeySize = 256 / 8; // Size of HMAC-SHA-256
 | 
					const size_t MPSiteKeySize = 256 / 8; // Size of HMAC-SHA-256
 | 
				
			||||||
const MPIdenticon MPIdenticonUnset = {
 | 
					const MPIdenticon MPIdenticonUnset = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,9 +19,16 @@
 | 
				
			|||||||
#ifndef _MPW_TYPES_H
 | 
					#ifndef _MPW_TYPES_H
 | 
				
			||||||
#define _MPW_TYPES_H
 | 
					#define _MPW_TYPES_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#define MP_LIBS_BEGIN
 | 
				
			||||||
 | 
					#define MP_LIBS_END
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef NS_ENUM
 | 
					#ifdef NS_ENUM
 | 
				
			||||||
#define mpw_enum(_type, _name) NS_ENUM(_type, _name)
 | 
					#define mpw_enum(_type, _name) NS_ENUM(_type, _name)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,9 @@
 | 
				
			|||||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
					// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
//==============================================================================
 | 
					//==============================================================================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-util.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <ctype.h>
 | 
					#include <ctype.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
@@ -29,8 +32,7 @@
 | 
				
			|||||||
#define AES_ECB 0
 | 
					#define AES_ECB 0
 | 
				
			||||||
#define AES_CBC 1
 | 
					#define AES_CBC 1
 | 
				
			||||||
#include "aes.h"
 | 
					#include "aes.h"
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-util.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef inf_level
 | 
					#ifdef inf_level
 | 
				
			||||||
int mpw_verbosity = inf_level;
 | 
					int mpw_verbosity = inf_level;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,10 +19,12 @@
 | 
				
			|||||||
#ifndef _MPW_UTIL_H
 | 
					#ifndef _MPW_UTIL_H
 | 
				
			||||||
#define _MPW_UTIL_H
 | 
					#define _MPW_UTIL_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "mpw-types.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MP_LIBS_BEGIN
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <stdarg.h>
 | 
					#include <stdarg.h>
 | 
				
			||||||
 | 
					MP_LIBS_END
 | 
				
			||||||
#include "mpw-types.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
//// Logging.
 | 
					//// Logging.
 | 
				
			||||||
#ifndef trc
 | 
					#ifndef trc
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user