]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
Use a hash for stats. Not finished
[vlc] / include / vlc_common.h
index fb7f1ab1c0d61e9463bd1cff03b438bbfffd9e51..7daebe4ae7810b98fa4fc404279e5611c88de256 100644 (file)
@@ -21,7 +21,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /**
@@ -202,9 +202,11 @@ typedef struct libvlc_t libvlc_t;
 typedef struct vlc_t vlc_t;
 typedef struct variable_t variable_t;
 typedef struct date_t date_t;
+typedef struct hashtable_entry_t hashtable_entry_t;
 
 /* Messages */
 typedef struct msg_bank_t msg_bank_t;
+typedef struct msg_queue_t msg_queue_t;
 typedef struct msg_subscription_t msg_subscription_t;
 
 /* Playlist */
@@ -372,7 +374,7 @@ typedef struct httpd_file_sys_t httpd_file_sys_t;
 typedef int (*httpd_file_callback_t)( httpd_file_sys_t *, httpd_file_t *, uint8_t *psz_request, uint8_t **pp_data, int *pi_data );
 typedef struct httpd_handler_t  httpd_handler_t;
 typedef struct httpd_handler_sys_t httpd_handler_sys_t;
-typedef int (*httpd_handler_callback_t)( httpd_handler_sys_t *, httpd_handler_t *, uint8_t *psz_url, uint8_t *psz_request, int i_type, uint8_t *p_in, int i_in, char *psz_remote_addr, char *psz_remote_host, uint8_t **pp_data, int *pi_data );
+typedef int (*httpd_handler_callback_t)( httpd_handler_sys_t *, httpd_handler_t *, char *psz_url, uint8_t *psz_request, int i_type, uint8_t *p_in, int i_in, char *psz_remote_addr, char *psz_remote_host, uint8_t **pp_data, int *pi_data );
 typedef struct httpd_redirect_t httpd_redirect_t;
 typedef struct httpd_stream_t httpd_stream_t;
 
@@ -415,6 +417,16 @@ typedef struct vlm_schedule_t vlm_schedule_t;
 /* divers */
 typedef struct vlc_meta_t    vlc_meta_t;
 
+/* Stats */
+typedef struct counter_t     counter_t;
+typedef struct counter_sample_t counter_sample_t;
+typedef struct stats_handler_t stats_handler_t;
+typedef struct input_stats_t input_stats_t;
+typedef struct global_stats_t global_stats_t;
+
+/* Update */
+typedef struct update_t update_t;
+typedef struct update_iterator_t update_iterator_t;
 
 /*****************************************************************************
  * Variable callbacks
@@ -465,6 +477,10 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *,      /* variable's object */
     char *psz_object_type;                                                  \
     char *psz_object_name;                                                  \
                                                                             \
+    /* Messages header */                                                   \
+    char *psz_header;                                                       \
+    int  i_flags;                                                           \
+                                                                            \
     /* Thread properties, if any */                                         \
     vlc_bool_t   b_thread;                                                  \
     vlc_thread_t thread_id;                                                 \
@@ -627,6 +643,20 @@ static int64_t GCD( int64_t a, int64_t b )
         }                                       \
     }
 
+/* Hash tables handling */
+struct hashtable_entry_t
+{
+    int       i_id;
+    char     *psz_name;
+    uint64_t  i_hash;
+    void     *p_data;
+};
+
+VLC_EXPORT( void, vlc_HashInsert, (hashtable_entry_t **, int *, int, const char *, void *));
+VLC_EXPORT( void*, vlc_HashRetrieve, (hashtable_entry_t*, int, int, const char *) );
+VLC_EXPORT( int, vlc_HashLookup, (hashtable_entry_t *, int, int, const char *) );
+
+
 /* MSB (big endian)/LSB (little endian) conversions - network order is always
  * MSB, and should be used for both network communications and files. Note that
  * byte orders other than little and big endians are not supported, but only
@@ -785,14 +815,14 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 #   define vlc_strdup NULL
 #endif
 
-#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
+#if !defined(HAVE_VASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS)
 #   define vasprintf vlc_vasprintf
     VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) );
 #elif !defined(__PLUGIN__)
 #   define vlc_vasprintf NULL
 #endif
 
-#if !defined(HAVE_ASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
+#if !defined(HAVE_ASPRINTF) || defined(__APPLE__) || defined(SYS_BEOS)
 #   define asprintf vlc_asprintf
     VLC_EXPORT( int, vlc_asprintf, (char **, const char *, ... ) );
 #elif !defined(__PLUGIN__)