summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/osdnet.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2011-12-12 14:20:12 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2011-12-12 14:20:12 +0000
commit6e79bb2629d4463830fd1739423a950c042c7b0f (patch)
treefd550398ed5ea6a3fe9c65ee8d42cb27899d372b /src/osd/osdnet.c
parent9e467dfcf6c70fd39d6e80271936f5699981db0d (diff)
Sync with MESS all credited there (no whatsnew)
Diffstat (limited to 'src/osd/osdnet.c')
-rw-r--r--src/osd/osdnet.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/osd/osdnet.c b/src/osd/osdnet.c
index 2df27d6cde5..21c8774ea03 100644
--- a/src/osd/osdnet.c
+++ b/src/osd/osdnet.c
@@ -1,22 +1,16 @@
#include "emu.h"
#include "osdnet.h"
-typedef struct netdev_entry
-{
- int id;
- char name[256];
- create_netdev func;
- struct netdev_entry *m_next;
-} netdev_entry_t;
-
static class simple_list<netdev_entry_t> netdev_list;
-void add_netdev(const char *name, create_netdev func)
+void add_netdev(const char *name, const char *description, create_netdev func)
{
netdev_entry_t *entry = global_alloc_clear(netdev_entry_t);
entry->id = netdev_list.count();
strncpy(entry->name, name, 255);
entry->name[255] = '\0';
+ strncpy(entry->description, description, 255);
+ entry->description[255] = '\0';
entry->func = func;
netdev_list.append(*entry);
}
@@ -26,6 +20,10 @@ void clear_netdev()
netdev_list.reset();
}
+const netdev_entry_t *netdev_first() {
+ return netdev_list.first();
+}
+
class netdev *open_netdev(int id, class device_network_interface *ifdev, int rate)
{
netdev_entry_t *entry = netdev_list.first();
@@ -97,3 +95,7 @@ const char *netdev::get_mac()
return "\0\0\0\0\0\0";
}
+int netdev_count()
+{
+ return netdev_list.count();
+}