aboutsummaryrefslogtreecommitdiff
path: root/Src/Components/wac_network/util.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Components/wac_network/util.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Components/wac_network/util.h')
-rw-r--r--Src/Components/wac_network/util.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/Src/Components/wac_network/util.h b/Src/Components/wac_network/util.h
new file mode 100644
index 00000000..6fe3c496
--- /dev/null
+++ b/Src/Components/wac_network/util.h
@@ -0,0 +1,42 @@
+/*
+** JNetLib
+** Copyright (C) 2000-2007 Nullsoft, Inc.
+** Author: Justin Frankel
+** File: util.h - JNL interface for basic network utilities
+** License: see jnetlib.h
+**
+** routines you may be interested in:
+** JNL::open_socketlib();
+** opens the socket library. Call this once before using any network
+** code. If you create a new thread, call this again. Only really an
+** issue for Win32 support, but use it anyway for portability/
+**
+** JNL::close_Socketlib();
+** closes the socketlib. Call this when you're done with the network,
+** after all your JNetLib objects have been destroyed.
+**
+** unsigned long JNL::ipstr_to_addr(const char *cp);
+** gives you the integer representation of a ip address in dotted
+** decimal form.
+**
+** JNL::addr_to_ipstr(unsigned long addr, char *host, int maxhostlen);
+** gives you the dotted decimal notation of an integer ip address.
+**
+*/
+
+#ifndef NULLSOFT_WAC_NETWORK_UTIL_H
+#define NULLSOFT_WAC_NETWORK_UTIL_H
+
+class JNL
+{
+ public:
+ static int open_socketlib();
+ static void close_socketlib();
+
+ static unsigned long ipstr_to_addr( const char *cp );
+ static void addr_to_ipstr( unsigned long addr, char *host, int maxhostlen );
+
+ static int parse_url( const char *url, char **prot, char **host, unsigned short *port, char **req, char **lp );
+};
+
+#endif //!NULLSOFT_WAC_NETWORK_UTIL_H