moved stuff to where it belongs
diff --git a/aos/common/common.gyp b/aos/common/common.gyp
index 4b9d602..41e0de8 100644
--- a/aos/common/common.gyp
+++ b/aos/common/common.gyp
@@ -380,12 +380,5 @@
'die',
],
},
- {
- 'target_name': 'util',
- 'type': 'static_library',
- 'sources': [
- 'util.cc',
- ],
- },
],
}
diff --git a/aos/common/network/SendSocket.h b/aos/common/network/SendSocket.h
index 06529d0..1ca0c4c 100644
--- a/aos/common/network/SendSocket.h
+++ b/aos/common/network/SendSocket.h
@@ -5,7 +5,7 @@
#include "aos/linux_code/configuration.h"
#include "aos/common/network_port.h"
-#include "aos/common/util.h"
+#include "aos/common/util/inet_addr.h"
namespace aos {
diff --git a/aos/common/network/network.gyp b/aos/common/network/network.gyp
index 4d5aff3..c254c93 100644
--- a/aos/common/network/network.gyp
+++ b/aos/common/network/network.gyp
@@ -13,35 +13,6 @@
],
},
{
- 'target_name': 'socket_so',
- 'type': 'shared_library',
- 'variables': {'no_rsync': 1},
- 'sources': [
- 'ReceiveSocket.cpp',
- 'SendSocket.cpp',
- 'Socket.cpp',
- ],
- 'dependencies': [
- '<(AOS)/build/aos.gyp:logging',
- ],
- 'export_dependent_settings': [
- ],
- 'conditions': [
- ['OS=="crio"', {
- 'dependencies': [
- '<(EXTERNALS):WPILib',
- ]}
- ],
- ],
- 'direct_dependent_settings': {
- 'variables': {
- 'jni_libs': [
- 'socket_so',
- ],
- },
- },
- },
- {
'target_name': 'socket',
'type': 'static_library',
'sources': [
@@ -52,7 +23,7 @@
'dependencies': [
'<(AOS)/build/aos.gyp:logging',
'<(AOS)/common/common.gyp:time',
- '<(AOS)/common/common.gyp:util',
+ '<(AOS)/common/util/util.gyp:inet_addr',
'<(AOS)/linux_code/linux_code.gyp:configuration',
],
'export_dependent_settings': [
diff --git a/aos/common/util.cc b/aos/common/util/inet_addr.cc
similarity index 93%
rename from aos/common/util.cc
rename to aos/common/util/inet_addr.cc
index 2903611..a83ecf9 100644
--- a/aos/common/util.cc
+++ b/aos/common/util/inet_addr.cc
@@ -1,4 +1,4 @@
-#include "aos/common/util.h"
+#include "aos/common/util/inet_addr.h"
#include <stdlib.h>
#ifndef __VXWORKS__
diff --git a/aos/common/util.h b/aos/common/util/inet_addr.h
similarity index 83%
rename from aos/common/util.h
rename to aos/common/util/inet_addr.h
index f41b86e..35368f1 100644
--- a/aos/common/util.h
+++ b/aos/common/util/inet_addr.h
@@ -1,5 +1,5 @@
-#ifndef AOS_COMMON_UTIL_H_
-#define AOS_COMMON_UTIL_H_
+#ifndef AOS_COMMON_UTIL_INET_ADDR_H_
+#define AOS_COMMON_UTIL_INET_ADDR_H_
#ifdef __VXWORKS__
#include <inetLib.h>
@@ -26,4 +26,4 @@
} // namespace util
} // namespace aos
-#endif // AOS_COMMON_UTIL_H_
+#endif // AOS_COMMON_UTIL_INET_ADDR_H_
diff --git a/aos/common/util/util.gyp b/aos/common/util/util.gyp
index 98f1a3d..6dd2aa2 100644
--- a/aos/common/util/util.gyp
+++ b/aos/common/util/util.gyp
@@ -1,6 +1,13 @@
{
'targets': [
{
+ 'target_name': 'inet_addr',
+ 'type': 'static_library',
+ 'sources': [
+ 'inet_addr.cc',
+ ],
+ },
+ {
'target_name': 'log_interval',
'type': 'static_library',
'sources': [
diff --git a/aos/linux_code/starter/netconsole.cc b/aos/linux_code/starter/netconsole.cc
index e8e76c7..cd840a6 100644
--- a/aos/linux_code/starter/netconsole.cc
+++ b/aos/linux_code/starter/netconsole.cc
@@ -10,7 +10,7 @@
#include <assert.h>
#include "aos/common/logging/logging_impl.h"
-#include "aos/common/util.h"
+#include "aos/common/util/inet_addr.h"
#include "aos/linux_code/configuration.h"
namespace aos {
diff --git a/aos/linux_code/starter/starter.gyp b/aos/linux_code/starter/starter.gyp
index 2419b33..8283d3e 100644
--- a/aos/linux_code/starter/starter.gyp
+++ b/aos/linux_code/starter/starter.gyp
@@ -9,7 +9,7 @@
'dependencies': [
'<(AOS)/build/aos.gyp:logging',
'<(AOS)/linux_code/linux_code.gyp:configuration',
- '<(AOS)/common/common.gyp:util',
+ '<(AOS)/common/util/util.gyp:inet_addr',
],
},
{
diff --git a/aos/map_utils.h b/aos/map_utils.h
deleted file mode 100644
index 5b85091..0000000
--- a/aos/map_utils.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef AOS_MAP_UTILS_H_
-#define AOS_MAP_UTILS_H_
-
-// TODO(aschuh): Template std::map as well.
-// Maps the key to the value, inserting it if it isn't there, or replacing it if
-// it is. Returns true if the key was added and false if it was replaced.
-template <typename K, typename V>
-bool InsertIntoMap(std::map<K, V> *my_map, const K &key, const V &new_value) {
- std::pair<typename std::map<K, V>::iterator, bool> element;
- element = my_map->insert(std::pair<K,V>(key, new_value));
- if (element.second == false) {
- element.first->second = new_value;
- }
- return element.second;
-}
-
-// Gets the value for the key from the map.
-// Returns true if the key was found and then populates *value with the value.
-// Otherwise, leaves value alone and returns false.
-template <typename K, typename V>
-bool GetFromMap(const std::map<K, V> &my_map, const K &key, V *value) {
- typename std::map<K, V>::const_iterator element = my_map.find(key);
- if (element != my_map.end()) {
- *value = element->second;
- return true;
- }
- return false;
-}
-
-#endif // AOS_MAP_UTILS_H_
diff --git a/frc971/crio/crio.gyp b/frc971/crio/crio.gyp
index d544f71..6ce501a 100644
--- a/frc971/crio/crio.gyp
+++ b/frc971/crio/crio.gyp
@@ -9,7 +9,7 @@
'dependencies': [
'<(EXTERNALS):WPILib',
'<(AOS)/crio/crio.gyp:ip',
- '<(AOS)/common/common.gyp:util',
+ '<(AOS)/common/util/util.gyp:inet_addr',
],
},
{
diff --git a/frc971/crio/dumb_main.cc b/frc971/crio/dumb_main.cc
index 08c653e..116fc02 100644
--- a/frc971/crio/dumb_main.cc
+++ b/frc971/crio/dumb_main.cc
@@ -3,7 +3,7 @@
#include "aos/common/network_port.h"
#include "aos/crio/ip.h"
-#include "aos/common/util.h"
+#include "aos/common/util/inet_addr.h"
using ::aos::util::MakeIPAddress;
using ::aos::util::GetOwnIPAddress;