diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-01 11:14:27 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-01 11:14:27 +0200 |
commit | 3cd5294d8a337ee5cd2ec894c9fbe04ad3a7690d (patch) | |
tree | da57ce74189de9bfb27e1a747063c37cd62de501 /svdrp.h | |
parent | 8a7bc6a0bbf60cae8b6391a630880aad5cba3363 (diff) | |
download | vdr-3cd5294d8a337ee5cd2ec894c9fbe04ad3a7690d.tar.gz vdr-3cd5294d8a337ee5cd2ec894c9fbe04ad3a7690d.tar.bz2 |
Implemented strict locking of global lists
Diffstat (limited to 'svdrp.h')
-rw-r--r-- | svdrp.h | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: svdrp.h 4.2 2015/05/22 13:44:43 kls Exp $ + * $Id: svdrp.h 4.3 2015/09/01 10:34:09 kls Exp $ */ #ifndef __SVDRP_H @@ -40,20 +40,35 @@ public: ///< to the command. The response strings are exactly as received, ///< with the leading three digit reply code and possible continuation ///< line indicator ('-') in place. - const char *Response(int Index) { return (Index > 0 && Index < response.Size()) ? response[Index] : NULL; } + const char *Response(int Index) { return (Index >= 0 && Index < response.Size()) ? response[Index] : NULL; } ///< This is a convenience function for accessing the response strings. ///< Returns the string at the given Index, or NULL if Index is out ///< of range. + int Code(const char *s) { return s ? atoi(s) : 0; } + ///< Returns the value of the three digit reply code of the given + ///< response string. + const char *Value(const char *s) { return s && s[0] && s[1] && s[2] && s[3] ? s + 4 : NULL; } + ///< Returns the actual value of the given response string, skipping + ///< the three digit reply code and possible continuation line indicator. }; +enum eSvdrpFetchFlags { + sffNone = 0b0000, + sffTimers = 0b0001, + }; + +const char *SVDRPHostName(void); void SetSVDRPGrabImageDir(const char *GrabImageDir); void StartSVDRPHandler(int TcpPort, int UdpPort); void StopSVDRPHandler(void); void SendSVDRPDiscover(const char *Address = NULL); -bool GetSVDRPServerNames(cStringList *ServerNames); +bool GetSVDRPServerNames(cStringList *ServerNames, eSvdrpFetchFlags FetchFlag = sffNone); ///< Gets a list of all available VDRs this VDR is connected to via SVDRP, ///< and stores it in the given ServerNames list. The list is cleared ///< before getting the server names. + ///< If FetchFlag is given, only the server names for which the local + ///< client has this flag set will be returned, and the client's flag + ///< will be cleared. ///< Returns true if the resulting list is not empty. #endif //__SVDRP_H |