*** empty log message ***

This commit is contained in:
David Rose 2000-11-14 20:16:15 +00:00
parent 33c1ae4afc
commit fa8f38d8d6
9 changed files with 106 additions and 21 deletions

View File

@ -28,11 +28,11 @@
Warning: Lib(s) $[nonexisting], referenced in $[DIRNAME]/$[TARGET], not found.
#endif
#set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]]
#set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]]
#end metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target
#forscopes test_bin_target
#set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]]
#set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[all_sources]]
#end test_bin_target
// Allow the user to define additional EXTRA_DEPENDS targets in each

View File

@ -251,6 +251,14 @@
$[if $[HAVE_NET],$[IF_NET_SOURCES]] \
$[if $[HAVE_PYTHON],$[IF_PYTHON_SOURCES]]
#defer all_sources \
$[SOURCES] \
$[IF_CRYPTO_SOURCES] \
$[IF_ZLIB_SOURCES] \
$[IF_IPC_SOURCES] \
$[IF_NET_SOURCES] \
$[IF_PYTHON_SOURCES]
// This variable returns the set of sources that are to be
// interrogated for the current target.
#defer get_igatescan \

View File

@ -21,14 +21,14 @@
zcompressor.h download_utils.cxx download_utils.h
#define IF_CRYPTO_SOURCES \
crypto_utils.cxx crypto_utils.h
crypto_utils.cxx crypto_utils.h hashVal.cxx hashVal.I hashVal.h
#define INSTALL_HEADERS \
downloader.h downloader.I \
config_downloader.h zcompressor.I zcompressor.h \
asyncUtility.h asyncUtility.I decompressor.h \
extractor.h download_utils.h downloadDb.h downloadDb.I \
patcher.h
hashVal.I hashVal.h patcher.h
#define IGATESCAN all

View File

@ -6,6 +6,7 @@
// This file is compiled only if we have crypto++ installed.
#include "crypto_utils.h"
#include "hashVal.h"
#include <md5.h>
#include <files.h>

View File

@ -10,23 +10,7 @@
#include <filename.h>
#include <typedef.h>
class EXPCL_PANDAEXPRESS HashVal {
public:
INLINE HashVal(void) {
hv[0] = hv[1] = hv[2] = hv[3] = 0;
}
INLINE bool operator == (const HashVal &other) const {
return (hv[0] == other.hv[0] &&
hv[1] == other.hv[1] &&
hv[2] == other.hv[2] &&
hv[3] == other.hv[3]);
}
INLINE uint get_value(int val) const {
if (val < 4 && val >= 0)
return hv[val];
}
uint hv[4];
};
class HashVal;
EXPCL_PANDAEXPRESS void md5_a_file(const Filename &fname, HashVal &ret);
EXPCL_PANDAEXPRESS void md5_a_buffer(uchar *buf, ulong len, HashVal &ret);

View File

@ -0,0 +1,49 @@
// Filename: hashVal.I
// Created by: drose (14Nov00)
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: HashVal::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE HashVal::
HashVal(void) {
hv[0] = hv[1] = hv[2] = hv[3] = 0;
}
////////////////////////////////////////////////////////////////////
// Function: HashVal::operator ==
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE bool HashVal::
operator == (const HashVal &other) const {
return (hv[0] == other.hv[0] &&
hv[1] == other.hv[1] &&
hv[2] == other.hv[2] &&
hv[3] == other.hv[3]);
}
////////////////////////////////////////////////////////////////////
// Function: HashVal::operator ==
// Access: Public
// Description: Returns the integer value of the indicated component.
////////////////////////////////////////////////////////////////////
INLINE uint HashVal::
get_value(int val) const {
nassertr(val >= 0 && val < 4, 0);
return hv[val];
}
////////////////////////////////////////////////////////////////////
// Function: HashVal::output
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void HashVal::
output(ostream &out) const {
out << "[" << hv[0] << " " << hv[1] << " " << hv[2] << " " << hv[3] << "]";
}

View File

@ -0,0 +1,7 @@
// Filename: hashVal.cxx
// Created by: drose (14Nov00)
//
////////////////////////////////////////////////////////////////////
#include "hashVal.h"

View File

@ -0,0 +1,35 @@
// Filename: hashVal.h
// Created by: drose (14Nov00)
//
////////////////////////////////////////////////////////////////////
#ifndef HASHVAL_H
#define HASHVAL_H
#include <pandabase.h>
#include <typedef.h>
#include <notify.h>
////////////////////////////////////////////////////////////////////
// Class : HashVal
// Description : A sixteen-byte hash value sent to the crypt library.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDAEXPRESS HashVal {
public:
INLINE HashVal();
INLINE bool operator == (const HashVal &other) const;
INLINE uint get_value(int val) const;
INLINE void output(ostream &out) const;
uint hv[4];
};
INLINE ostream &operator << (ostream &out, const HashVal &hv) {
hv.output(out);
return out;
}
#include "hashVal.I"
#endif

View File

@ -1,4 +1,5 @@
#include <crypto_utils.h>
#include <hashVal.h>
int
main(int argc, char *argv[]) {