]> granicus.if.org Git - rtmpdump/commitdiff
Namespace cleanup
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 13 Mar 2010 00:31:24 +0000 (00:31 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 13 Mar 2010 00:31:24 +0000 (00:31 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@336 400ebc74-4327-4243-bc38-086b20814532

librtmp/amf.c
librtmp/amf.h
librtmp/hashswf.c
librtmp/parseurl.c
librtmp/rtmp.c
librtmp/rtmp.h
rtmpdump.c
rtmpgw.c
rtmpsrv.c
rtmpsuck.c

index 8e22866c6cce2e14e1b40f376192ffb4577c96e7..bd372b4e61e1685684f7844e8e8d5e870500452f 100644 (file)
@@ -329,7 +329,7 @@ AMFProp_GetNumber(AMFObjectProperty * prop)
   return prop->p_vu.p_number;
 }
 
-int
+bool
 AMFProp_GetBoolean(AMFObjectProperty * prop)
 {
   return prop->p_vu.p_number != 0;
@@ -347,7 +347,7 @@ AMFProp_GetObject(AMFObjectProperty * prop, AMFObject * obj)
   *obj = prop->p_vu.p_object;
 }
 
-int
+bool
 AMFProp_IsValid(AMFObjectProperty * prop)
 {
   return prop->p_type != AMF_INVALID;
@@ -476,7 +476,7 @@ AMF3ReadString(const char *data, AVal * str)
 
 int
 AMF3Prop_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize,
-               int bDecodeName)
+               bool bDecodeName)
 {
   int nOriginalSize = nSize;
   AMF3DataType type;
@@ -593,7 +593,7 @@ AMF3Prop_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize,
 
 int
 AMFProp_Decode(AMFObjectProperty * prop, const char *pBuffer, int nSize,
-              int bDecodeName)
+              bool bDecodeName)
 {
   int nOriginalSize = nSize;
 
index 59e63455f39c8977d23276af253f79120f14d697..a03774f450ad34648025df49b29f011ba83b1172 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include <stdint.h>
+#include <stdbool.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -56,15 +57,6 @@ extern "C"
 #define AVC(str)       {str,sizeof(str)-1}
 #define AVMATCH(a1,a2) ((a1)->av_len == (a2)->av_len && !memcmp((a1)->av_val,(a2)->av_val,(a1)->av_len))
 
-#ifndef __cplusplus
-#undef bool
-#undef true
-#undef false
-#define        bool    int
-#define true   1
-#define        false   0
-#endif
-
   struct AMFObjectProperty;
 
   typedef struct AMFObject
index a37800d4a46925af59ce4e1149e6831d4013e606..8acba2da14ae2d64995b9be1c7ab0cae56f0e074 100644 (file)
@@ -24,7 +24,7 @@
 #include <ctype.h>
 #include <time.h>
 
-#include "rtmp.h"
+#include "rtmp_sys.h"
 #include "log.h"
 #include "http.h"
 
index 98d722ba962dec669da6ef803dda995a2c20a652..592ae07165ef2c77075eeefda231d104e5e47126 100644 (file)
@@ -26,7 +26,7 @@
 #include <assert.h>
 #include <ctype.h>
 
-#include "rtmp.h"
+#include "rtmp_sys.h"
 #include "log.h"
 
 bool RTMP_ParseURL(const char *url, int *protocol, char **host, unsigned int *port,
index 97d6011fcaed7a206d48f57a20102ee827aa6c7b..ade7d135a98ab0c16c543d2d46870534f2daeea8 100644 (file)
@@ -27,7 +27,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "rtmp.h"
+#include "rtmp_sys.h"
 #include "log.h"
 
 #include <openssl/ssl.h>
index ba0cd29b1cdaa050d0d98e1a6fc42ec920e159a4..a24825956271bd59d9fc39a2958dc94158e30386 100644 (file)
 
 #define CRYPTO
 
-#ifdef WIN32
-#include <winsock.h>
-#define GetSockError() WSAGetLastError()
-#define setsockopt(a,b,c,d,e)  (setsockopt)(a,b,c,(const char *)d,(int)e)
-#define EWOULDBLOCK    WSAETIMEDOUT    /* we don't use nonblocking, but we do use timeouts */
-#define sleep(n)       Sleep(n*1000)
-#define msleep(n)      Sleep(n)
-#define socklen_t      int
-#define SET_RCVTIMEO(tv,s)     int tv = s*1000
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/times.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#define GetSockError() errno
-#undef closesocket
-#define closesocket(s) close(s)
-#define msleep(n)      usleep(n*1000)
-#define SET_RCVTIMEO(tv,s)     struct timeval tv = {s,0}
-#endif
-
 #include <errno.h>
 #include <stdint.h>
 
@@ -304,7 +279,7 @@ extern "C"
   bool RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name,
                                      AMFObjectProperty * p);
 
-  bool RTMPSockBuf_Fill(RTMPSockBuf *sb);
+  int RTMPSockBuf_Fill(RTMPSockBuf *sb);
   int RTMPSockBuf_Send(RTMPSockBuf *sb, const char *buf, int len);
   int RTMPSockBuf_Close(RTMPSockBuf *sb);
 
index f850b3086b4e4c2f2bd972797ea00980e4aeb149..b2d8face813bd08a10f8f259c6e975662b910eb6 100644 (file)
@@ -29,7 +29,7 @@
 #include <signal.h>            // to catch Ctrl-C
 #include <getopt.h>
 
-#include "librtmp/rtmp.h"
+#include "librtmp/rtmp_sys.h"
 #include "librtmp/log.h"
 
 #ifdef WIN32
index 3b71d116d65a9441e6266326d3b67bb43ff38520..1e9559fabf8bf21970fc3c59dd562dc459e00e3c 100644 (file)
--- a/rtmpgw.c
+++ b/rtmpgw.c
@@ -28,7 +28,7 @@
 
 #include <assert.h>
 
-#include "librtmp/rtmp.h"
+#include "librtmp/rtmp_sys.h"
 #include "librtmp/log.h"
 
 #include "thread.h"
index d1c3a48eb4c4c18b21af85489f3ea4693a160303..de96bea5043d63f673a256ec381644d7ce739c8e 100644 (file)
--- a/rtmpsrv.c
+++ b/rtmpsrv.c
@@ -33,7 +33,7 @@
 
 #include <assert.h>
 
-#include "librtmp/rtmp.h"
+#include "librtmp/rtmp_sys.h"
 #include "librtmp/log.h"
 
 #include "thread.h"
index c9ff202d719f57e08417b0dfe94bc7ba3056c969..219d0705dc50d887232310113e4049a244e858c8 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <assert.h>
 
-#include "librtmp/rtmp.h"
+#include "librtmp/rtmp_sys.h"
 #include "librtmp/log.h"
 
 #include "thread.h"