# # # add_dir "visualc" # # add_file "visualc/config.h" # content [c167d67aac4adf6d4e043a0c0e0b5d3dff1d1df1] # # add_file "visualc/cryptopp.vcproj" # content [0727661cdcdc559aa071c4f92a8e8fec0ab0820a] # # add_file "visualc/lua.vcproj" # content [80cf26112ebad55f5e19ae77aa0c554931258d19] # # add_file "visualc/monotone.vcproj" # content [8274e98a16f62b94dd6870c8cd31ead4eb65933a] # # add_file "visualc/mt-stdint.h" # content [42adbbd087815733bdc5102a8c0199f2a064386d] # # add_file "visualc/netxx.vcproj" # content [46809a63cdc6c3d893838bee0607a552ffdd8c42] # # add_file "visualc/popt.vcproj" # content [24f60674ea05f1e23837af6415d7d800b67973b3] # # add_file "visualc/sqlite3.vcproj" # content [e7703d12a94e4c662924224ad48014d36b6336ed] # # add_file "visualc/stdint.h" # content [552d37099d9936774e14511b1307b1f3034535ad] # # add_file "visualc/stringprep.vcproj" # content [26cd86fdcac3e019a8aa81144fb86c82ff91cd77] # # add_file "visualc/txt2c.vcproj" # content [6128ea545bd948b35605ebce08b57423d49a58be] # # add_file "visualc/unistd.h" # content [470e076aa451f7e9b5de640025a322afd1ac8b5d] # # add_file "visualc/unknown_package.txt" # content [2d7bb5572221afa7d7fb30c8d19d3f693bfeee14] # # patch "app_state.cc" # from [18045740e735562c70e3a482927003729014844f] # to [e3a67fe2a50548cb2a0980d8a2aaeb0b376ea0e6] # # patch "automate.cc" # from [68d579fc833b4a0ec52a0c8e5b130af7517ab7ed] # to [c6af26e58286eb9f1ab7f1a8bbad9858d2549ef5] # # patch "automate.hh" # from [9fc7ef0ce9345d918e9e19e98f605a9d3bca6532] # to [50a099fbae11d18d8020c40813ede340f9005f54] # # patch "botan/config.h" # from [985b707216c13e7cb2684c869166c4dc4e007a45] # to [8a44f5a48d99ca4d00d670491c5183aa00b890e3] # # patch "cert.hh" # from [3fdb0157a21c4b2c67a95c911c8e64109b32e068] # to [66c19a9cceadc5c47a58ed7e78e1a141839517fd] # # patch "commands.hh" # from [80712c78001aaf6b8b1d9e6824c30da61ff4b690] # to [07aaf2a9c9a965caf9a889f71a168882ceff1f08] # # patch "database.cc" # from [430079748f8733f34aa2f781847a905d85983436] # to [e8dce4fafa2506b9d29964d6aec978a8586375a7] # # patch "database.hh" # from [dd9695e867200e94e2d10b9e9bd74bd423c0ac10] # to [0d339fb92195c393f466f7fef456601a0630c1fa] # # patch "diff_patch.hh" # from [fb7ab63b1e55fe0278df0c422cd090f555516326] # to [845e486548ebc492296e0a441557ad6ae96c741f] # # patch "file_io.hh" # from [2082dc3c8480400f32fcbe1c4d881d7512de2204] # to [61b703818d087acd311cc7924bcde561368e1cb1] # # patch "hash_map.hh" # from [93f57aa66711b5db2adf1d62e50bd1e9596b5406] # to [9f20bfd2451c998a09bd7cdc16725babed6596e6] # # patch "idna/idna.c" # from [b847eec12b86bf6335506db8c4fccb0f60599cef] # to [2a57a22e3ea331d29cc940a39e2e2784b1249316] # # patch "interner.hh" # from [a8d437360e4e6e069cb5ed9bea59a066cf975ea9] # to [0f5748a2c4373ffc08ee5a2688242a7c7f016928] # # patch "key_store.hh" # from [22c42b7740822edeb4062fd88ae1bafc2ed06f7f] # to [6821800c3a5f562b7d8aa747e8b232e0b37a9bda] # # patch "keys.cc" # from [b61b2cda83c67d33c1a2fb3ff0f7098ecfeb1570] # to [45a8b66cbe3500bec5c66c97e6e2b6c26f3dc6a4] # # patch "keys.hh" # from [969e5b32cfc2d56bfe239077a3104767d9ad72d7] # to [0ad74b0db8e4b18355e07020ea829a05f79356ed] # # patch "mkstemp.cc" # from [03865df03f56044431e1ce1e2eebb27e73e5c248] # to [f7f0ee56b94fe7bb94b565be2900550321bb1e4f] # # patch "monotone.cc" # from [92399bda2cd0fba92739636d7b0955c1c43bea23] # to [2ce41a5aca4d7af9c4f8bd55f5ebfbea93c80713] # # patch "mt_version.cc" # from [7bd1ed918bab15376f29478155f1ac92ffbdb4a5] # to [bd079100a09867f62ee066ec52037f8a54e9c92a] # # patch "popt/poptint.h" # from [15e002135a778d7a2aaeed3f10249731d77bd9b7] # to [b84a319581864e328a5a388fdfb332fd98a4fc55] # # patch "popt/system.h" # from [4af1b0f1e2f02b4c306e7484991c5f96c15af903] # to [20ef3da9493d57569afe953088775babe8e64c0e] # # patch "rcs_import.cc" # from [0de2b62e2c973f4c94592cff4990f0a43eb70294] # to [481795853a006ca20cac34f212115c16b2b88737] # # patch "roster.hh" # from [6811b78a4a979e2146ba44e6c3a3023dec0b4c53] # to [b67e901ef5db4851492065b9f084c3d201ff19ab] # # patch "schema_migration.hh" # from [889ff8603eb292709ad415b0784f3b958d99a134] # to [c36653905b7b493eea138419cb75432af1823a37] # # patch "vocab.cc" # from [084a7a4538c3e0b062b901d0ba891fd6b66cfdfe] # to [671fff360f475cad8de26f4f9c60d24f58413a54] # # patch "vocab.hh" # from [596953ad6326b68846702a85c22977f434e760e9] # to [feb37f4532612304b70e146d52621a09a31dd899] # # patch "win32/fs.cc" # from [d4bbd27d041e4767ef6b1d3e341c5ee65ce1f44f] # to [dcc13cfb0d76b0b26cb7679f2f55679916d932a4] # # patch "win32/inodeprint.cc" # from [958ef1bcb5ee1711a55894151ed1742fa3074ddc] # to [0c2f874048a2f4346078307114137aacd8a885be] # # patch "xdelta.cc" # from [623dce88e91af3d9f610b47d7596408fa4876dda] # to [8e7fc37bebb941af604140498ba860ed891fa76d] # ============================================================ --- visualc/config.h c167d67aac4adf6d4e043a0c0e0b5d3dff1d1df1 +++ visualc/config.h c167d67aac4adf6d4e043a0c0e0b5d3dff1d1df1 @@ -0,0 +1,16 @@ +#ifndef CONFIG_H +#define CONFIG_H 1 + +#define PACKAGE "monotone" +#define PACKAGE_STRING "monotone 0.26" +#define PACKAGE_BUGREPORT "address@hidden" +#define LC_MESSAGES LC_CTYPE +#define VERSION "0.26" + +#ifdef _MSC_VER +typedef unsigned long pid_t; +// #define HAVE_EXTERN_TEMPLATE +#define LOCALEDIR "" +#endif + +#endif /* CONFIG_H */ ============================================================ --- visualc/cryptopp.vcproj 0727661cdcdc559aa071c4f92a8e8fec0ab0820a +++ visualc/cryptopp.vcproj 0727661cdcdc559aa071c4f92a8e8fec0ab0820a @@ -0,0 +1,1242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/lua.vcproj 80cf26112ebad55f5e19ae77aa0c554931258d19 +++ visualc/lua.vcproj 80cf26112ebad55f5e19ae77aa0c554931258d19 @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/monotone.vcproj 8274e98a16f62b94dd6870c8cd31ead4eb65933a +++ visualc/monotone.vcproj 8274e98a16f62b94dd6870c8cd31ead4eb65933a @@ -0,0 +1,919 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/mt-stdint.h 42adbbd087815733bdc5102a8c0199f2a064386d +++ visualc/mt-stdint.h 42adbbd087815733bdc5102a8c0199f2a064386d @@ -0,0 +1,9 @@ +#ifndef _MONOTONE_MT_STDINT_H +#define _MONOTONE_MT_STDINT_H 1 +#ifndef _GENERATED_STDINT_H +#define _GENERATED_STDINT_H "monotone 0.26pre1" +/* generated using gnu compiler gcc.exe (GCC) 3.4.2 (mingw-special) */ +#define _STDINT_HAVE_STDINT_H 1 +#include +#endif +#endif ============================================================ --- visualc/netxx.vcproj 46809a63cdc6c3d893838bee0607a552ffdd8c42 +++ visualc/netxx.vcproj 46809a63cdc6c3d893838bee0607a552ffdd8c42 @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/popt.vcproj 24f60674ea05f1e23837af6415d7d800b67973b3 +++ visualc/popt.vcproj 24f60674ea05f1e23837af6415d7d800b67973b3 @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/sqlite3.vcproj e7703d12a94e4c662924224ad48014d36b6336ed +++ visualc/sqlite3.vcproj e7703d12a94e4c662924224ad48014d36b6336ed @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/stdint.h 552d37099d9936774e14511b1307b1f3034535ad +++ visualc/stdint.h 552d37099d9936774e14511b1307b1f3034535ad @@ -0,0 +1,14 @@ +#ifndef STDINT_H +#define STDINT_H 1 + +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; + +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; + +#endif /* STDINT_H */ ============================================================ --- visualc/stringprep.vcproj 26cd86fdcac3e019a8aa81144fb86c82ff91cd77 +++ visualc/stringprep.vcproj 26cd86fdcac3e019a8aa81144fb86c82ff91cd77 @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/txt2c.vcproj 6128ea545bd948b35605ebce08b57423d49a58be +++ visualc/txt2c.vcproj 6128ea545bd948b35605ebce08b57423d49a58be @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ============================================================ --- visualc/unistd.h 470e076aa451f7e9b5de640025a322afd1ac8b5d +++ visualc/unistd.h 470e076aa451f7e9b5de640025a322afd1ac8b5d @@ -0,0 +1,16 @@ +/* + * This file is part of the Mingw32 package. + * + * unistd.h maps (roughly) to io.h + */ + +#ifndef _UNISTD_H +#define _UNISTD_H + +#ifdef _MSC_VER +#include +#include +typedef size_t ssize_t; +#endif + +#endif /* _UNISTD_H */ ============================================================ --- visualc/unknown_package.txt 2d7bb5572221afa7d7fb30c8d19d3f693bfeee14 +++ visualc/unknown_package.txt 2d7bb5572221afa7d7fb30c8d19d3f693bfeee14 @@ -0,0 +1,1 @@ +unknown ============================================================ --- app_state.cc 18045740e735562c70e3a482927003729014844f +++ app_state.cc e3a67fe2a50548cb2a0980d8a2aaeb0b376ea0e6 @@ -83,11 +83,14 @@ set_key_dir(keydir); } - if (branch_name().empty()) + if (branch_name().empty() && !options[branch_option]().empty()) branch_name = options[branch_option]; + L(FL("branch name is '%s'\n") % branch_name()); - internalize_rsa_keypair_id(options[key_option], signing_key); + if (!options[key_option]().empty()) + internalize_rsa_keypair_id(options[key_option], signing_key); + if (global_sanity.filename.empty()) { bookkeeping_path dump_path; ============================================================ --- automate.cc 68d579fc833b4a0ec52a0c8e5b130af7517ab7ed +++ automate.cc c6af26e58286eb9f1ab7f1a8bbad9858d2549ef5 @@ -1156,8 +1156,7 @@ s.flush(); } -static ssize_t -automate_stdio_read(int d, void *buf, size_t nbytes) +static ssize_t automate_stdio_read(int d, void *buf, size_t nbytes) { ssize_t rv; ============================================================ --- automate.hh 9fc7ef0ce9345d918e9e19e98f605a9d3bca6532 +++ automate.hh 50a099fbae11d18d8020c40813ede340f9005f54 @@ -11,7 +11,7 @@ #include class app_state; -struct utf8; +class utf8; void automate_command(utf8 cmd, std::vector args, ============================================================ --- botan/config.h 985b707216c13e7cb2684c869166c4dc4e007a45 +++ botan/config.h 8a44f5a48d99ca4d00d670491c5183aa00b890e3 @@ -13,6 +13,8 @@ #if defined(_MSC_VER) #pragma warning(disable: 4250 4290) +#define BOTAN_EXT_ENTROPY_SRC_WIN32 +#define BOTAN_EXT_ENTROPY_SRC_CAPI #endif #define BOTAN_VERSION_MAJOR 1 ============================================================ --- cert.hh 3fdb0157a21c4b2c67a95c911c8e64109b32e068 +++ cert.hh 66c19a9cceadc5c47a58ed7e78e1a141839517fd @@ -20,7 +20,7 @@ // much extra meta-data as they like about files or manifests, using certs, // without needing anyone's special permission. -struct app_state; +class app_state; struct packet_consumer; struct cert ============================================================ --- commands.hh 80712c78001aaf6b8b1d9e6824c30da61ff4b690 +++ commands.hh 07aaf2a9c9a965caf9a889f71a168882ceff1f08 @@ -14,7 +14,7 @@ // bind tcl or lua or something in here class app_state; -struct utf8; +class utf8; struct usage { ============================================================ --- database.cc 430079748f8733f34aa2f781847a905d85983436 +++ database.cc e8dce4fafa2506b9d29964d6aec978a8586375a7 @@ -2712,7 +2712,7 @@ } -typedef hashmap::hash_multimap ancestry_map; +typedef hashmap::string_hashmultimap ancestry_map; static void transitive_closure(string const & x, ============================================================ --- database.hh dd9695e867200e94e2d10b9e9bd74bd423c0ac10 +++ database.hh 0d339fb92195c393f466f7fef456601a0630c1fa @@ -69,7 +69,7 @@ class transaction_guard; struct posting; -struct app_state; +class app_state; struct revision_set; struct query; @@ -88,7 +88,7 @@ std::map statement_cache; - struct app_state * __app; + app_state * __app; struct sqlite3 * __sql; struct sqlite3 * sql(bool init = false, bool migrating_format = false); int transaction_level; @@ -124,7 +124,7 @@ hexenc const & base, delta & del, std::string const & table); - void get_version(hexenc const & id, + void get_version(hexenc const & ident, data & dat, std::string const & data_table, std::string const & delta_table); @@ -134,7 +134,7 @@ std::string const & table); void drop(hexenc const & base, std::string const & table); - void put_delta(hexenc const & id, + void put_delta(hexenc const & ident, hexenc const & base, delta const & del, std::string const & table); @@ -158,7 +158,7 @@ void get_certs(std::vector< cert > & certs, std::string const & table); - void get_certs(hexenc const & id, + void get_certs(hexenc const & ident, std::vector< cert > & certs, std::string const & table); @@ -166,12 +166,12 @@ std::vector< cert > & certs, std::string const & table); - void get_certs(hexenc const & id, + void get_certs(hexenc const & ident, cert_name const & name, std::vector< cert > & certs, std::string const & table); - void get_certs(hexenc const & id, + void get_certs(hexenc const & ident, cert_name const & name, base64 const & val, std::vector< cert > & certs, @@ -216,11 +216,11 @@ void ensure_open_for_format_changes(); bool database_specified(); - bool file_version_exists(file_id const & id); - bool roster_version_exists(hexenc const & id); - bool revision_exists(revision_id const & id); - bool roster_link_exists_for_revision(revision_id const & id); - bool roster_exists_for_revision(revision_id const & id); + bool file_version_exists(file_id const & ident); + bool roster_version_exists(hexenc const & ident); + bool revision_exists(revision_id const & ident); + bool roster_link_exists_for_revision(revision_id const & ident); + bool roster_exists_for_revision(revision_id const & ident); void get_roster_links(std::map > & links); void get_file_ids(std::set & ids); @@ -231,7 +231,7 @@ // get plain version if it exists, or reconstruct version // from deltas (if they exist) - void get_file_version(file_id const & id, + void get_file_version(file_id const & ident, file_data & dat); // put file w/o predecessor into db @@ -245,15 +245,15 @@ // get plain version if it exists, or reconstruct version // from deltas (if they exist). - void get_manifest_version(manifest_id const & id, + void get_manifest_version(manifest_id const & ident, manifest_data & dat); void get_revision_ancestry(std::multimap & graph); - void get_revision_parents(revision_id const & id, + void get_revision_parents(revision_id const & ident, std::set & parents); - void get_revision_children(revision_id const & id, + void get_revision_children(revision_id const & ident, std::set & children); void get_revision_manifest(revision_id const & cid, @@ -261,10 +261,10 @@ void deltify_revision(revision_id const & rid); - void get_revision(revision_id const & id, + void get_revision(revision_id const & ident, revision_set & cs); - void get_revision(revision_id const & id, + void get_revision(revision_id const & ident, revision_data & dat); void put_revision(revision_id const & new_id, @@ -291,17 +291,17 @@ void get_public_keys(std::vector & pubkeys); bool public_key_exists(hexenc const & hash); - bool public_key_exists(rsa_keypair_id const & id); + bool public_key_exists(rsa_keypair_id const & ident); void get_pubkey(hexenc const & hash, - rsa_keypair_id & id, + rsa_keypair_id & ident, base64 & pub_encoded); - void get_key(rsa_keypair_id const & id, + void get_key(rsa_keypair_id const & ident, base64 & pub_encoded); - void put_key(rsa_keypair_id const & id, + void put_key(rsa_keypair_id const & ident, base64 const & pub_encoded); void delete_public_key(rsa_keypair_id const & pub_id); @@ -322,7 +322,7 @@ void get_revision_certs(cert_name const & name, std::vector< revision > & certs); - void get_revision_certs(revision_id const & id, + void get_revision_certs(revision_id const & ident, cert_name const & name, std::vector< revision > & certs); @@ -330,21 +330,21 @@ base64 const & val, std::vector< revision > & certs); - void get_revision_certs(revision_id const & id, + void get_revision_certs(revision_id const & ident, cert_name const & name, base64 const & value, std::vector< revision > & certs); - void get_revision_certs(revision_id const & id, + void get_revision_certs(revision_id const & ident, std::vector< revision > & certs); - void get_revision_certs(revision_id const & id, + void get_revision_certs(revision_id const & ident, std::vector< hexenc > & hashes); void get_revision_cert(hexenc const & hash, revision & c); - void get_manifest_certs(manifest_id const & id, + void get_manifest_certs(manifest_id const & ident, std::vector< manifest > & certs); void get_manifest_certs(cert_name const & name, ============================================================ --- diff_patch.hh fb7ab63b1e55fe0278df0c422cd090f555516326 +++ diff_patch.hh 845e486548ebc492296e0a441557ad6ae96c741f @@ -17,7 +17,7 @@ #include #include -struct roster_t; +class roster_t; struct conflict {}; ============================================================ --- file_io.hh 2082dc3c8480400f32fcbe1c4d881d7512de2204 +++ file_io.hh 61b703818d087acd311cc7924bcde561368e1cb1 @@ -19,7 +19,7 @@ // level for us to say whether applying them in any given case is valid or // not. -struct lua_hooks; +class lua_hooks; // use I() void assert_path_is_nonexistent(any_path const & path); ============================================================ --- hash_map.hh 93f57aa66711b5db2adf1d62e50bd1e9596b5406 +++ hash_map.hh 9f20bfd2451c998a09bd7cdc16725babed6596e6 @@ -21,8 +21,23 @@ return __gnu_cxx::__stl_hash_string(s.c_str()); } }; - - + struct string_eq + { + bool operator()(std::string const & a, + std::string const & b) const + { + return a == b; + } + }; + template struct string_hashmap + : public hash_map + {}; + template struct string_hashmultimap + : public hash_multimap + {}; + struct string_hashset + : public hash_set + {}; } #endif @@ -48,9 +63,68 @@ return size_t(h); } }; + struct string_eq + { + bool operator()(std::string const & a, + std::string const & b) const + { + return a == b; + } + }; + struct string_hashmap + : public hash_map + {}; + template struct string_hashmultimap + : public hash_multimap + {}; + struct string_hashset + : public hash_set + {}; } #endif +#ifdef _MSC_VER +#define HASHMAP_PRESENT +#include +#include + +namespace hashmap +{ + using stdext::hash_map; + using stdext::hash_set; + using stdext::hash_multimap; + + struct string_hash_traits + { + static const size_t bucket_size = 4; + static const size_t min_buckets = 8; + + size_t operator( )(std::string const & s) const + { + const char* s2=s.c_str(); + unsigned long h = 0; + for ( ; *s2; ++s2) + h = 5*h + *s2; + return size_t(h); + } + bool operator( )(std::string const & a, + std::string const & b) const + { + return a < b; + } + }; + template struct string_hashmap + : public hash_map + {}; + template struct string_hashmultimap + : public hash_multimap + {}; + struct string_hashset + : public hash_set + {}; +} +#endif + #ifndef HASHMAP_PRESENT #error need wrapper for hash_map for your compiler #endif ============================================================ --- idna/idna.c b847eec12b86bf6335506db8c4fccb0f60599cef +++ idna/idna.c 2a57a22e3ea331d29cc940a39e2e2784b1249316 @@ -30,6 +30,10 @@ #include "idna/idna.h" +#ifdef _MSC_VER +#define strcasecmp(a,b) _stricmp(a,b) +#endif + #define DOTP(c) ((c) == 0x002E || (c) == 0x3002 || \ (c) == 0xFF0E || (c) == 0xFF61) ============================================================ --- interner.hh a8d437360e4e6e069cb5ed9bea59a066cf975ea9 +++ interner.hh 0f5748a2c4373ffc08ee5a2688242a7c7f016928 @@ -11,22 +11,13 @@ #include "hash_map.hh" #include "sanity.hh" -struct string_eq -{ - bool operator()(std::string const & a, - std::string const & b) const - { - return a == b; - } -}; + template struct interner { - typedef typename hashmap::hash_map hmap; + typedef typename hashmap::string_hashmap hmap; hmap fwd; std::vector rev; ============================================================ --- key_store.hh 22c42b7740822edeb4062fd88ae1bafc2ed06f7f +++ key_store.hh 6821800c3a5f562b7d8aa747e8b232e0b37a9bda @@ -7,7 +7,7 @@ #include "paths.hh" #include "platform.hh" -struct app_state; +class app_state; struct keyreader; ============================================================ --- keys.cc b61b2cda83c67d33c1a2fb3ff0f7098ecfeb1570 +++ keys.cc 45a8b66cbe3500bec5c66c97e6e2b6c26f3dc6a4 @@ -34,11 +34,10 @@ using boost::shared_ptr; using boost::shared_dynamic_cast; -using Botan::byte; static void -do_arc4(SecureVector & sym_key, - SecureVector & payload) +do_arc4(SecureVector & sym_key, + SecureVector & payload) { L(FL("running arc4 process on %d bytes of data\n") % payload.size()); Pipe enc(get_cipher("ARC4", sym_key, ENCRYPTION)); @@ -149,7 +148,7 @@ { string phrase; - SecureVector pubkey, privkey; + SecureVector pubkey, privkey; rsa_pub_key raw_pub_key; rsa_priv_key raw_priv_key; @@ -236,7 +235,7 @@ keypair & new_kp) { arc4 decoded_key; - SecureVector decrypted_key; + SecureVector decrypted_key; string phrase; bool force = false; @@ -247,11 +246,11 @@ decode_base64(old_priv, decoded_key); for (int i = 0; i < 3; ++i) { - decrypted_key.set(reinterpret_cast(decoded_key().data()), + decrypted_key.set(reinterpret_cast(decoded_key().data()), decoded_key().size()); get_passphrase(app.lua, id, phrase, false, force); - SecureVector sym_key; - sym_key.set(reinterpret_cast(phrase.data()), phrase.size()); + SecureVector sym_key; + sym_key.set(reinterpret_cast(phrase.data()), phrase.size()); do_arc4(sym_key, decrypted_key); L(FL("building signer from %d-byte decrypted private key\n") % decrypted_key.size()); @@ -322,7 +321,7 @@ string const & tosign, base64 & signature) { - SecureVector sig; + SecureVector sig; string sig_string; // we permit the user to relax security here, by caching a decrypted key @@ -350,7 +349,7 @@ app.signers.insert(make_pair(id,make_pair(signer,priv_key))); } - sig = signer->sign_message(reinterpret_cast(tosign.data()), tosign.size()); + sig = signer->sign_message(reinterpret_cast(tosign.data()), tosign.size()); sig_string = string(reinterpret_cast(sig.begin()), sig.size()); L(FL("produced %d-byte signature\n") % sig_string.size()); @@ -378,8 +377,8 @@ { rsa_pub_key pub; decode_base64(pub_encoded, pub); - SecureVector pub_block; - pub_block.set(reinterpret_cast(pub().data()), pub().size()); + SecureVector pub_block; + pub_block.set(reinterpret_cast(pub().data()), pub().size()); L(FL("building verifier for %d-byte pub key\n") % pub_block.size()); shared_ptr x509_key = @@ -407,8 +406,8 @@ signature().size() % sig_decoded().size()); bool valid_sig = verifier->verify_message( - reinterpret_cast(alleged_text.data()), alleged_text.size(), - reinterpret_cast(sig_decoded().data()), sig_decoded().size()); + reinterpret_cast(alleged_text.data()), alleged_text.size(), + reinterpret_cast(sig_decoded().data()), sig_decoded().size()); return valid_sig; } @@ -421,8 +420,8 @@ { rsa_pub_key pub; decode_base64(pub_encoded, pub); - SecureVector pub_block; - pub_block.set(reinterpret_cast(pub().data()), pub().size()); + SecureVector pub_block; + pub_block.set(reinterpret_cast(pub().data()), pub().size()); shared_ptr x509_key = shared_ptr(X509::load_key(pub_block)); shared_ptr pub_key = shared_dynamic_cast(x509_key); @@ -432,9 +431,9 @@ shared_ptr encryptor; encryptor = shared_ptr(get_pk_encryptor(*pub_key, "EME1(SHA-1)")); - SecureVector ct; + SecureVector ct; ct = encryptor->encrypt( - reinterpret_cast(plaintext.data()), plaintext.size()); + reinterpret_cast(plaintext.data()), plaintext.size()); ciphertext = rsa_oaep_sha_data(string(reinterpret_cast(ct.begin()), ct.size())); } @@ -449,9 +448,9 @@ shared_ptr decryptor; decryptor = shared_ptr(get_pk_decryptor(*priv_key, "EME1(SHA-1)")); - SecureVector plain; + SecureVector plain; plain = decryptor->decrypt( - reinterpret_cast(ciphertext().data()), ciphertext().size()); + reinterpret_cast(ciphertext().data()), ciphertext().size()); plaintext = string(reinterpret_cast(plain.begin()), plain.size()); } @@ -481,20 +480,20 @@ void -key_hash_code(rsa_keypair_id const & id, +key_hash_code(rsa_keypair_id const & ident, base64 const & pub, hexenc & out) { - data tdat(id() + ":" + remove_ws(pub())); + data tdat(ident() + ":" + remove_ws(pub())); calculate_ident(tdat, out); } void -key_hash_code(rsa_keypair_id const & id, +key_hash_code(rsa_keypair_id const & ident, base64< rsa_priv_key > const & priv, hexenc & out) { - data tdat(id() + ":" + remove_ws(priv())); + data tdat(ident() + ":" + remove_ws(priv())); calculate_ident(tdat, out); } @@ -553,13 +552,13 @@ string pt("new fascist tidiness regime in place"); string phr("still spring water"); - SecureVector phrase(reinterpret_cast(phr.data()), + SecureVector phrase(reinterpret_cast(phr.data()), phr.size()); - SecureVector orig(reinterpret_cast(pt.data()), + SecureVector orig(reinterpret_cast(pt.data()), pt.size()); - SecureVector data(orig); + SecureVector data(orig); BOOST_CHECKPOINT("encrypting data"); do_arc4(phrase, data); ============================================================ --- keys.hh 969e5b32cfc2d56bfe239077a3104767d9ad72d7 +++ keys.hh 0ad74b0db8e4b18355e07020ea829a05f79356ed @@ -14,7 +14,7 @@ // could in theory be in transforms.cc too, but that file's already kinda // big and this stuff "feels" different, imho. -struct lua_hooks; +class lua_hooks; void generate_key_pair(lua_hooks & lua, // to hook for phrase rsa_keypair_id const & id, // to prompting user for phrase @@ -68,11 +68,11 @@ base64 const & pub, std::string & out); -void key_hash_code(rsa_keypair_id const & id, +void key_hash_code(rsa_keypair_id const & ident, base64 const & pub, hexenc & out); -void key_hash_code(rsa_keypair_id const & id, +void key_hash_code(rsa_keypair_id const & ident, base64< rsa_priv_key > const & priv, hexenc & out); ============================================================ --- mkstemp.cc 03865df03f56044431e1ce1e2eebb27e73e5c248 +++ mkstemp.cc f7f0ee56b94fe7bb94b565be2900550321bb1e4f @@ -13,6 +13,7 @@ #include #include #include +#include #include "file_io.hh" #include "botan/botan.h" @@ -43,8 +44,12 @@ for (i = 0; i < 6; ++i) tmp.append(1, letters[Botan::Global_RNG::random(Botan::Nonce) % NLETTERS]); - fd = open(tmp.c_str(), O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); - if (fd >= 0) +#ifdef _MSC_VER + fd = _open(tmp.c_str(), _O_RDWR | _O_CREAT | _O_EXCL | _O_BINARY, 0600); +#else + fd = open(tmp.c_str(), O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); +#endif + if (fd >= 0) { tmpl = tmp; return fd; ============================================================ --- monotone.cc 92399bda2cd0fba92739636d7b0955c1c43bea23 +++ monotone.cc 2ce41a5aca4d7af9c4f8bd55f5ebfbea93c80713 @@ -8,7 +8,9 @@ #include "popt/popt.h" #include +#ifndef _MSC_VER #include +#endif #include #include #include ============================================================ --- mt_version.cc 7bd1ed918bab15376f29478155f1ac92ffbdb4a5 +++ mt_version.cc bd079100a09867f62ee066ec52037f8a54e9c92a @@ -21,7 +21,7 @@ print_version() { std::cout << (F("%s (base revision: %s)") - % PACKAGE_STRING % package_revision_constant) + % PACKAGE_STRING % std::string(package_revision_constant)) << std::endl; } @@ -34,6 +34,6 @@ std::cout << F("Running on: %s\n" "Changes since base revision: %s\n") % s - % package_full_revision_constant; + % std::string(package_full_revision_constant); } ============================================================ --- popt/poptint.h 15e002135a778d7a2aaeed3f10249731d77bd9b7 +++ popt/poptint.h b84a319581864e328a5a388fdfb332fd98a4fc55 @@ -14,26 +14,26 @@ * @param p memory to free * @retval NULL always */ -/address@hidden@*/ static inline /address@hidden@*/ void * -_free(/address@hidden@*/ /address@hidden@*/ const void * p) - /address@hidden p @*/ + static void * +_free( const void * p) + { if (p != NULL) free((void *)p); return NULL; } /* Bit mask macros. */ -/address@hidden -redef @*/ + typedef unsigned int __pbm_bits; -/address@hidden =redef @*/ + #define __PBM_NBITS (8 * sizeof (__pbm_bits)) #define __PBM_IX(d) ((d) / __PBM_NBITS) #define __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) -/address@hidden -redef @*/ + typedef struct { __pbm_bits bits[1]; } pbm_set; -/address@hidden =redef @*/ + #define __PBM_BITS(set) ((set)->bits) #define PBM_ALLOC(d) calloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) @@ -44,53 +44,53 @@ struct optionStackEntry { int argc; -/address@hidden@*/ /address@hidden@*/ + const char ** argv; -/address@hidden@*/ /address@hidden@*/ + pbm_set * argb; int next; -/address@hidden@*/ /address@hidden@*/ + const char * nextArg; -/address@hidden@*/ /address@hidden@*/ + const char * nextCharArg; -/address@hidden@*/ /address@hidden@*/ + poptItem currAlias; int stuffed; }; struct poptContext_s { struct optionStackEntry optionStack[POPT_OPTION_DEPTH]; -/address@hidden@*/ + struct optionStackEntry * os; -/address@hidden@*/ /address@hidden@*/ + const char ** leftovers; int numLeftovers; int allocLeftovers; int nextLeftover; -/address@hidden@*/ + const struct poptOption * options; int restLeftover; -/address@hidden@*/ /address@hidden@*/ + const char * appName; -/address@hidden@*/ /address@hidden@*/ + poptItem aliases; int numAliases; int flags; -/address@hidden@*/ /address@hidden@*/ + poptItem execs; int numExecs; -/address@hidden@*/ /address@hidden@*/ + const char ** finalArgv; int finalArgvCount; int finalArgvAlloced; -/address@hidden@*/ /address@hidden@*/ + poptItem doExec; -/address@hidden@*/ + const char * execPath; int execAbsolute; -/address@hidden@*/ + const char * otherHelp; -/address@hidden@*/ + pbm_set * arg_strip; }; ============================================================ --- popt/system.h 4af1b0f1e2f02b4c306e7484991c5f96c15af903 +++ popt/system.h 20ef3da9493d57569afe953088775babe8e64c0e @@ -1,7 +1,17 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#ifdef WIN32 +#include +#include +#include +#include +#ifndef X_OK +#define X_OK 1 +#endif +#endif + #if defined (__GLIBC__) && defined(__LCLINT__) /address@hidden@*/ /address@hidden@*/ ============================================================ --- rcs_import.cc 0de2b62e2c973f4c94592cff4990f0a43eb70294 +++ rcs_import.cc 481795853a006ca20cac34f212115c16b2b88737 @@ -1082,7 +1082,7 @@ // have passed the window size while (!clusters.empty()) { - cluster_set::const_iterator j = clusters.begin(); + cluster_set::iterator j = clusters.begin(); if ((*j)->first_time + constants::cvs_window < i->time) { L(FL("expiring cluster\n")); ============================================================ --- roster.hh 6811b78a4a979e2146ba44e6c3a3023dec0b4c53 +++ roster.hh b67e901ef5db4851492065b9f084c3d201ff19ab @@ -255,7 +255,7 @@ void dump(roster_t const & val, std::string & out); -struct app_state; +class app_state; struct revision_set; // adaptor class to enable cset application on rosters. ============================================================ --- schema_migration.hh 889ff8603eb292709ad415b0784f3b958d99a134 +++ schema_migration.hh c36653905b7b493eea138419cb75432af1823a37 @@ -17,7 +17,7 @@ // of the migration. struct sqlite3; -struct app_state; +class app_state; void calculate_schema_id(sqlite3 *sql, std::string & id); void migrate_monotone_schema(sqlite3 *sql, app_state *app); ============================================================ --- vocab.cc 084a7a4538c3e0b062b901d0ba891fd6b66cfdfe +++ vocab.cc 671fff360f475cad8de26f4f9c60d24f58413a54 @@ -161,9 +161,9 @@ struct symtab_impl { - typedef hashmap::hash_set hset; + typedef hashmap::string_hashset hset; hset vals; - symtab_impl() : vals(1024) {} + symtab_impl() : vals() {} void clear() { vals.clear(); } std::string const & unique(std::string const & in) { @@ -275,16 +275,16 @@ void dump(dec const & obj, std::string & out) \ { dump(obj.inner(), out); } -#define EXTERN +#define EXTERN /* */ #include "vocab_terms.hh" -#undef EXTERN #undef ATOMIC #undef DECORATE -template class revision; -template class manifest; +EXTERN template class revision; +EXTERN template class manifest; +#undef EXTERN template void dump(base64 const&, std::string &); ============================================================ --- vocab.hh 596953ad6326b68846702a85c22977f434e760e9 +++ vocab.hh feb37f4532612304b70e146d52621a09a31dd899 @@ -166,7 +166,7 @@ // in the filesystem. if you want to *define* or work with any of these you // need to include boost/filesystem/path.hpp. -namespace boost { namespace filesystem { struct path; } } +namespace boost { namespace filesystem { class path; } } namespace fs = boost::filesystem; // kludge: certs are derived types. what else can we do? ============================================================ --- win32/fs.cc d4bbd27d041e4767ef6b1d3e341c5ee65ce1f44f +++ win32/fs.cc dcc13cfb0d76b0b26cb7679f2f55679916d932a4 @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -140,6 +141,8 @@ typedef BOOL (*MoveFileExFun)(LPCTSTR, LPCTSTR, DWORD); static MoveFileExFun MoveFileEx = 0; static bool MoveFileExAvailable = false; + +#if 0 if (MoveFileEx == 0) { HMODULE hModule = LoadLibrary("kernel32"); if (hModule) @@ -151,6 +154,7 @@ } else L(FL("using DeleteFile/MoveFile fallback for renames")); } +#endif if (MoveFileExAvailable) { if (MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING)) @@ -171,8 +175,6 @@ void rename_clobberingly(any_path const & from, any_path const & to) { - const char* szFrom = from.as_external().c_str(); - const char* szTo = to.as_external().c_str(); static const int renameAttempts = 16; DWORD sleepTime = 1; DWORD lastError = 0; @@ -182,11 +184,11 @@ // around the common problem where another process (e.g. a virus checker) // will exclusive open a file you've just touched. for (int i = 0; i < renameAttempts; ++i) { - if (rename_clobberingly_impl(szFrom, szTo)) + if (rename_clobberingly_impl(from.as_external().c_str(), to.as_external().c_str())) return; lastError = GetLastError(); L(FL("attempted rename of '%s' to '%s' failed: %d") - % szFrom % szTo % lastError); + % from % to % lastError); Sleep(sleepTime); if (sleepTime < 250) sleepTime *= 2; ============================================================ --- win32/inodeprint.cc 958ef1bcb5ee1711a55894151ed1742fa3074ddc +++ win32/inodeprint.cc 0c2f874048a2f4346078307114137aacd8a885be @@ -57,7 +57,8 @@ if (CloseHandle(filehandle) == 0) return false; - char digest[hash.OUTPUT_LENGTH]; + I(hash.OUTPUT_LENGTH == 20); + char digest[20]; hash.final(reinterpret_cast(digest)); std::string out(digest, hash.OUTPUT_LENGTH); inodeprint ip_raw(out); ============================================================ --- xdelta.cc 623dce88e91af3d9f610b47d7596408fa4876dda +++ xdelta.cc 8e7fc37bebb941af604140498ba860ed891fa76d @@ -179,7 +179,7 @@ vector & delta) { string::size_type blocksz = 64; - match_table matches ((a.size() / blocksz) * 2); + match_table matches; init_match_table(a, blocksz, matches); if (b.size() < blocksz) @@ -468,12 +468,12 @@ struct chunk_less_than { - bool operator()(chunk const & ch, version_pos vp) const + bool operator()(chunk const & ch1, chunk const & ch2) const { // nb: ch.vpos + ch.len is the 0-based index of the first element *not* // included in ch; thus we measure against ch.len - 1. - I(ch.len > 0); - return (ch.vpos + ch.len - 1) < vp; + I(ch1.len > 0); + return (ch1.vpos + ch1.len - 1) < ch2.vpos; } }; @@ -507,9 +507,10 @@ if (!out.empty()) dst_vpos = out.back().vpos + out.back().len; version_pos dst_final = dst_vpos + src_len; + chunk src_bounding_chunk(0,0,src_vpos,0); version_spec::const_iterator lo = lower_bound(in.begin(), in.end(), - src_vpos, + src_bounding_chunk, chunk_less_than()); for ( ; src_len > 0; ++lo) {