Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
fa8f38d8d6

+ 2 - 2
dtool/pptempl/Depends.pp

@@ -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

+ 8 - 0
dtool/pptempl/Global.pp

@@ -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 \

+ 2 - 2
panda/src/downloader/Sources.pp

@@ -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
 

+ 1 - 0
panda/src/downloader/crypto_utils.cxx

@@ -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>

+ 1 - 17
panda/src/downloader/crypto_utils.h

@@ -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);

+ 49 - 0
panda/src/downloader/hashVal.I

@@ -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] << "]";
+}

+ 7 - 0
panda/src/downloader/hashVal.cxx

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

+ 35 - 0
panda/src/downloader/hashVal.h

@@ -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

+ 1 - 0
panda/src/downloadertools/check_md5.cxx

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