Commits

Andreas Tscharner committed 3e15f9a

Use parameter names in methods in header files (doxygen complained)

Comments (0)

Files changed (13)

src/Factories.hxx

  * the encryption factory class
  *
  * \author Andreas Tscharner
- * \date 2014-02-09
+ * \date 2014-08-23
  */
 
 
 		 *
 		 * \return Instance of desired compression class
 		 */
-		static lrc::CompressDecompress *get_compression_class(lrc::CompressionType);
+		static lrc::CompressDecompress *get_compression_class(lrc::CompressionType p_compType);
 };
 
 /*! \class EncryptionFactory
 		 *
 		 * \return Instance of desired encryption class
 		 */
-		static lrc::EncryptDecrypt *get_encryption_class(lrc::EncryptionType, char *) throw(lrcEncryptionDisabledException);
+		static lrc::EncryptDecrypt *get_encryption_class(lrc::EncryptionType p_encType, char *p_resID) throw(lrcEncryptionDisabledException);
 };
 
 

src/ResourceData.hxx

 //      ResourceData.hxx
 //
-//      Copyright 2011, 2012 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2012, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * information
  *
  * \author Andreas Tscharner
- * \date 2012-01-07
+ * \date 2014-08-023
  */
 
 
 		 *
 		 * \param[in] p_newErrMsg New error message
 		 */
-		void set_error_msg(char *);
+		void set_error_msg(char *p_newErrMsg);
 
 	public:
 		/*! \brief Constructor
 		 *
 		 * \param[in] p_resIdent Resource identifier
 		 */
-		void set_ident(const char *);
+		void set_ident(const char *p_resIdent);
 
 		/*! \brief Set file containing resource
 		 *
 		 *
 		 * \param[in] p_resFilename Filename containing resource
 		 */
-		void set_file(const char *);
+		void set_file(const char *p_resFilename);
 		/*! \brief Return filename
 		 *
 		 * This method returns the filename of the resource data file of
 		 * \param[in] p_resEncryption Encryption type
 		 * \param[in] p_password Password for encryption
 		 */
-		void set_encryption(lrc::EncryptionType, const unsigned char *);
+		void set_encryption(lrc::EncryptionType p_resEncryption, const unsigned char *p_password);
 		/*! \brief Return encryption type
 		 *
 		 * Method to return the encryption type of this very resource
 		 *
 		 * \param[in] p_resCompression Compression type
 		 */
-		void set_compression(lrc::CompressionType);
+		void set_compression(lrc::CompressionType p_resCompression);
 		/*! \brief Return compression type
 		 *
 		 * Method to return the compression type of this very resource
 		 *
 		 * \see Collector
 		 */
-		void set_rc_position(int, int);
+		void set_rc_position(int p_line, int p_col);
 		/*! \brief Return resource description position
 		 *
 		 * Method to return the resource description in the RC file of this
 		 *
 		 * \remarks The caller is responsible to free the used memory
 		 */
-		int prepare_resource_from_file(unsigned char **, size_t &);
+		int prepare_resource_from_file(unsigned char **p_resData, size_t &p_resSize);
 		/*! \brief Get resource data from compressed and encrypted chunk of
 		 *         memory
 		 *
 		 *
 		 * \remarks The caller is responsible to free the returned class
 		 */
-		int get_data_from_memory(unsigned char *, resEntry, const unsigned char *p_password = nullptr);
+		int get_data_from_memory(unsigned char *p_dataStart, resEntry p_resEntry, const unsigned char *p_password = nullptr);
 
 		/*! \brief Return error message
 		 *
  * used in the whole project
  *
  * \author Andreas Tscharner
- * \date 2014-08-22
+ * \date 2014-08-23
  */
 
 
  * \retval true File exists
  * \retval false File does not exist
  */
-bool file_exists(const char *);
+bool file_exists(const char *p_filename);
 
 /*! \brief Returns the size of a file
  *
  *
  * \remarks If an error occurres, the function returns -1
  */
-int file_size(const char *);
+int file_size(const char *p_filename);
 
 /*! \brief Returns the file extension
  *
  * \remarks The returned string is a pointer to the file extension within
  * the given string! It is NULL, if the given filename has no extension.
  */
-char *get_extension(char *);
+char *get_extension(char *p_filename);
 
 /*! \brief Replace the file extension
  *
  * \remarks The caller is responsible to free the allocated memory of the
  * returned string
  */
-char *replace_extension(char *, const char *);
+char *replace_extension(char *p_filename, const char *p_newExt);
 
 /*! \brief Delete list of data
  *
  * This function deletes a list of data (double pointers to unsigned chars)
  *
  * \param[in] p_dataList List of data to delete
- * \param[in] p_listSize Size of data list
+ * \param[in] p_dataSize Size of data list
  */
-void delete_list(unsigned char **, unsigned int);
+void delete_list(unsigned char **p_dataList, unsigned int p_dataSize);
 
 /*! \brief Gets length of a password
  *
  *
  * \remarks -1 will be returned if the given password was \c nullptr
  */
-int password_len(const unsigned char *);
+int password_len(const unsigned char *p_password);
 
 
 #endif /* __UTILS_HXX__ */

src/compiler/Collector.hxx

 //      Collector.hxx
 //
-//      Copyright 2011, 2012 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2012, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * responsible to collect all resource data
  *
  * \author Andreas Tscharner
- * \date 2012-05-06
+ * \date 2014-08-23
  */
 
 
 		 * \remarks The caller is responsible to free the string containing
 		 *          the name of the resource ID that appears more than once
 		 */
-		int are_resIDs_unique(std::vector<ResourceData *>, inFilePosition &, char **);
+		int are_resIDs_unique(std::vector<ResourceData *> p_entries, inFilePosition &p_doubleIDPos, char **p_doubleID);
 
 		/*! \brief Show error message from resource data
 		 *
 		 * \param[in] p_errorCode Error code
 		 * \param[in] p_resData ResourceData instance that caused the error
 		 */
-		void show_resource_data_error(int, ResourceData *);
+		void show_resource_data_error(int p_errorCode, ResourceData *p_resData);
 
 	public:
 		/*! \brief Constructor
 		 * given .rdf file exists and the overwrite flag indicates that
 		 * overwriting is forbidden
 		 */
-		Collector(char *, char *, bool) throw(lrcFileExistsException);
+		Collector(char *p_rcName, char *p_rdfName, bool p_overwriteAllow) throw(lrcFileExistsException);
 		/*! \brief Destructor
 		 *
 		 * Clean up the memory that was needed by the class
 		 * \retval ERROR_FILE_READ An error occurred while reading the file
 		 * \retval ERROR_FILE_WRITE An error occurred while writing the file
 		 */
-		int collect(std::vector<ResourceData *> *, lrc::CompressionType, lrc::EncryptionType, const unsigned char *);
+		int collect(std::vector<ResourceData *> *p_resEntries, lrc::CompressionType p_compress, lrc::EncryptionType p_encrypt, const unsigned char *p_key);
 };
 
 

src/compiler/InFileParser.hxx

 //      InFileParser.hxx
 //
-//      Copyright 2011, 2012 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2012, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * input file for the Linux Resource Compiler
  *
  * \author Andreas Tscharner
- * \date 2012-09-01
+ * \date 2014-08-23
  */
 
 
 		 * \exception lrcFileNotFoundException Exception that is thrown if
 		 * the given file could not be found
 		 */
-		InFileParser(char *) throw(lrcFileNotFoundException);
+		InFileParser(char *p_filename) throw(lrcFileNotFoundException);
 		/*! \brief Destructor
 		 *
 		 * Cleans up the memory and resources the parser class needed
 		 * \remarks lrc::NoneCompression is the default if the given string
 		 *          defines no other compression type
 		 */
-		static lrc::CompressionType eval_compression_type(const char *);
+		static lrc::CompressionType eval_compression_type(const char *p_compStr);
 		/*! \brief Evaluate encryption type from string
 		 *
 		 * This method evaluated which encryption type should be used
 		 * \remarks lrc::NoneEncryption is the default if the ginve string
 		 *          defines no other encryption type
 		 */
-		static lrc::EncryptionType eval_encryption_type(const char *);
+		static lrc::EncryptionType eval_encryption_type(const char *p_encStr);
 		/*! \brief Get password
 		 *
 		 * This method gets the password, either directly from the .rc or
 		 * \remarks The caller is responsible to free the used memory that
 		 *          the returned password needs
 		 */
-		 static unsigned char *get_password(const char *) throw(lrcFileNotFoundException);
+		 static unsigned char *get_password(const char *p_passwdStr) throw(lrcFileNotFoundException);
 
 		/*! \brief Parses the file
 		 *
 		 *
 		 * \return Error code of last error
 		 */
-		virtual int get_internal_error(inFilePosition &, char **);
+		virtual int get_internal_error(inFilePosition &p_errPos, char **p_errMsg);
 
 		/*! \brief Return all resource entries
 		 *

src/compiler/ParserFactory.hxx

 //      ParserFactory.hxx
 //
-//      Copyright 2011 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * used to create a matching parser class depending on the file to parse.
  *
  * \author Andreas Tscharner
- * \date 2011-09-11
+ * \date 2014-08-23
  */
 
 
 		 * This method creates a parser class depending on the given file.
 		 * The file can be a .rc or a .rif (xml) file
 		 *
-		 * \param[in] p_filename NAme of the file to parse
+		 * \param[in] p_filename Name of the file to parse
 		 *
 		 * \return Instance of a macthing parser class
 		 *
 		 *          class
 		 * \remarks If the file does not exist \c nullptr will be returned
 		 */
-		static InFileParser *create_input_parser(const char *);
+		static InFileParser *create_input_parser(const char *p_filename);
 };
 
 

src/compiler/RCParser.hxx

 		 * \retval true Line is comment or empty
 		 * \retval false Line contains information
 		 */
-		bool is_comment(char *);
+		bool is_comment(char *p_line);
 
 	public:
 		/*! \brief Constructor
 		 * \exception lrcFileNotFoundException Exception that is thrown if
 		 * the given .rc file could not be found
 		 */
-		RCParser(char *) throw(lrcFileNotFoundException);
+		RCParser(char *p_filename) throw(lrcFileNotFoundException);
 
 		/*! \brief Parses the file
 		 *

src/compiler/RIFParser.hxx

 //      RIFParser.hxx
 //
-//      Copyright 2011 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * parse the RIF input file for \c lrc
  *
  * \author Andreas Tscharner
- * \date 2011-09-26
+ * \date 2014-08-23
  */
 
 #ifndef __RIFPARSER_HXX__
 		 * \exception lrcFileNotFoundException Exception that is thrown if
 		 * the given .rif file could not be found
 		 */
-		RIFParser(char *) throw (lrcFileNotFoundException);
+		RIFParser(char *p_filename) throw (lrcFileNotFoundException);
 
 		/*! \brief Parses the file
 		 *

src/include/CompressDecompress.hxx

 //      CompressDecompress.hxx
 //
-//      Copyright 2011, 2012, 2013 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011-2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * compression/decompression algorithms used in \c lrc
  *
  * \author Andreas Tscharner
- * \date 2013-09-08
+ * \date 2014-08-23
  */
 
 
 			 *
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			virtual int compress(const unsigned char *, size_t, unsigned char **, size_t &) = 0;
+			virtual int compress(const unsigned char *p_decompData, size_t p_decompSize, unsigned char **p_compData, size_t &p_compSize) = 0;
 			/*! \brief Abstract method for decompression
 			 *
 			 * This abstract method has to be implemented by a derived class
 			 *
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			virtual int decompress(const unsigned char *, size_t, unsigned char **, size_t &) = 0;
+			virtual int decompress(const unsigned char *p_compData, size_t p_compSize, unsigned char **p_decompData, size_t &p_decompSize) = 0;
 	};
 }
 

src/include/EncryptDecrypt.hxx

 //      EncryptDecyrpt.hxx
 //
-//      Copyright 2011, 2013 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2013, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * class for all encryption and decryption used in \c lrc.
  *
  * \author Andreas Tscharner
- * \date 2013-02-24
+ * \date 2014-08-23
  */
 
 
 			 *
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			virtual int encrypt(const unsigned char *, const unsigned char *, size_t, unsigned char **, size_t &) = 0;
+			virtual int encrypt(const unsigned char *p_key, const unsigned char *p_clearData, size_t p_clearSize, unsigned char **p_encData, size_t &p_encSize) = 0;
 			/*! \brief Abstract method for decryption
 			 *
 			 * This abstract method has to be implemented by a derived class
 			 *
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			virtual int decrypt(const unsigned char *, const unsigned char *, size_t, unsigned char **, size_t &) = 0;
+			virtual int decrypt(const unsigned char *p_key, const unsigned char *p_encData, size_t p_encSize, unsigned char **p_clearData, size_t &p_clearSize) = 0;
 	};
 }
 

src/include/ResourceManager.hxx

  * \c liblrc
  *
  * \author Andreas Tscharner
- * \date 2014-08-10
+ * \date 2014-08-23
  */
 
 
 			 * \retval ERROR_ENCRYPTION_DECRYPT An error occurred while
 			 *                                  decrypting the data
 			 */
-			int decrypt_data(const unsigned char *, size_t, unsigned char **, size_t &);
+			int decrypt_data(const unsigned char *p_encData, size_t p_encSize, unsigned char **p_clearData, size_t &p_clearSize);
 			/*! \brief Decompress resource data
 			 *
 			 * This method decompresses the resource data in the memory
 			 * \retval ERROR_COMPRESSION_DECOMPRESS An error occurred while
 			 *                                      decompressing the data
 			 */
-			int decompress_data(const unsigned char *, size_t, unsigned char **, size_t &);
+			int decompress_data(const unsigned char *p_compData, size_t p_compSize, unsigned char **p_decompData, size_t &p_decompSize);
 			/*! \brief Setup new resources
 			 *
 			 * This method sets up internal data to provide the resource
 			 *
 			 * \retval NO_ERROR Internal data successfully set up
 			 */
-			int setup_resources(const unsigned char *, size_t);
+			int setup_resources(const unsigned char *p_resData, size_t p_resSize);
 
 			/*! \brief Method to load resource file
 			 *
 			 * \retval ERROR_COMPRESSION_DECOMPRESS An error occurred while
 			 *                                      decompressing the data
 			 */
-			int load_embedded(const unsigned char *, const unsigned char *);
+			int load_embedded(const unsigned char *p_startAddr, const unsigned char *p_endAddr);
 
 		public:
 			/*! \brief Constructor expecting resource file name
 			 * \exception lrcFileNotFoundException Will be thrown if the
 			 *                                     file does not exist
 			 */
-			ResourceManager(const char *, const CompressionType, const EncryptionType, const unsigned char *) throw (lrcFileNotFoundException);
+			ResourceManager(const char *p_resFilename, const CompressionType p_compress, const EncryptionType p_encrypt, const unsigned char *p_key) throw (lrcFileNotFoundException);
 			/*! \brief Constructor for embedded resources
 			 *
 			 * The constructor expects the start and end address of the
 			 *          [Wiki](https://bitbucket.org/StarFire/lrc/wiki/Home)
 			 *          or the man page
 			 */
-			ResourceManager(const unsigned char *, const unsigned char *, const CompressionType, const EncryptionType, const unsigned char *);
+			ResourceManager(const unsigned char *p_startAddr, const unsigned char *p_endAddr, const CompressionType p_compress, const EncryptionType p_encrypt, const unsigned char *p_key);
 			/*! \brief Destructor
 			 *
 			 * The destructor cleans up all the used memory of the class
 			 *
 			 * \remarks The caller is resposible to free the used memory
 			 */
-			char **get_resource_ids(int &);
+			char **get_resource_ids(int &p_numRes);
 
 			/*! \brief Returns the requested resource
 			 *
 			 *
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			Resource *get_resource(const char *, const unsigned char *p_password = nullptr);
+			Resource *get_resource(const char *p_resID, const unsigned char *p_password = nullptr);
 
 			/*! \brief Returns the resource at the index
 			 *
 			 *          resources)
 			 * \remarks The caller is responsible to free the used memory
 			 */
-			Resource *get_resource(unsigned int, const unsigned char *p_password = nullptr);
+			Resource *get_resource(unsigned int p_resIdx, const unsigned char *p_password = nullptr);
 	};
 }
 

src/lrcExceptions.hxx

 //      lrcExceptions.hxx
 //
-//      Copyright 2011, 2012 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2012, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * This file contains all exception classes for lrc project
  *
  * \author Andreas Tscharner
- * \date 2012-01-07
+ * \date 2014-08-23
  */
 
 #ifndef __LRC_EXCEPTIONS_HXX__
 		 *
 		 * \param[in] p_fileNotFoundName Name of file that could not be found
 		 */
-		lrcFileNotFoundException(char *);
+		lrcFileNotFoundException(char *p_fileNotFoundName);
 		/*! \brief Destructor
 		 */
 		~lrcFileNotFoundException(void) throw();
 		 *
 		 * \param[in] p_filename File of file to be overwritten
 		 */
-		lrcFileExistsException(char *);
+		lrcFileExistsException(char *p_filename);
 		/*! \brief Destructor
 		 *
 		 * Frees up memory needed by the class
 		 *
 		 * \param[in] p_resourceID Resource ID
 		 */
-		lrcEncryptionDisabledException(char *);
+		lrcEncryptionDisabledException(char *p_resourceID);
 		/*! \brief Destructor
 		 *
 		 * Frees the memory of the exception

src/strategies/SerpentEncryption.hxx

 //      SerpentEncryption.hxx
 //
-//      Copyright 2011 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2014 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * algorithm
  *
  * \author Andreas Tscharner
- * \date 2011-08-24
+ * \date 2014-08-23
  */
 
 
 		 * \retval NO_ERROR Initialization vector successfully created
 		 * \retval ERROR_INVALID_PARAMETER The array was not created
 		 */
-		int create_initialization_vector(unsigned char *, size_t);
+		int create_initialization_vector(unsigned char *p_ivArray, size_t p_ivSize);
 	public:
 		/*! \brief Serpent encryption
 		 *
 		 * Method to encrypt the given data using the Serpent algorithm
 		 */
-		int encrypt(const unsigned char *, const unsigned char *, size_t, unsigned char **, size_t &);
+		int encrypt(const unsigned char *p_key, const unsigned char *p_clearData, size_t p_clearSize, unsigned char **p_encData, size_t &p_encSize);
 		/*! \brief Serpent decryption
 		 *
 		 * Method to decrypt the given data using the Serpent algorithm
 		 */
-		int decrypt(const unsigned char *, const unsigned char *, size_t, unsigned char **, size_t &);
+		int decrypt(const unsigned char *p_key, const unsigned char *p_encData, size_t p_encSize, unsigned char **p_clearData, size_t &p_clearSize);
 };