X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=para.h;h=eb99ec68e6f2609da70f8d75d3dc038c1c4ea59e;hp=c84685d9940ffafa3213be1bd64c672d119fca8e;hb=d330cf697501c14bb696256cb27c9e69b9edf3f4;hpb=df3c03e72911edb31e7f1e32ebe29dad063e3b70 diff --git a/para.h b/para.h index c84685d9..eb99ec68 100644 --- a/para.h +++ b/para.h @@ -1,19 +1,7 @@ /* * Copyright (C) 1997-2007 Andre Noll * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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. + * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file para.h global paraslash definitions */ @@ -36,6 +24,7 @@ #include #include /* needed by create_pf_socket */ #include +#include #include "gcc-compat.h" /** used in various contexts */ @@ -151,10 +140,6 @@ /** sent by para_client, followed by the decrypted challenge number */ #define CHALLENGE_RESPONSE_MSG "challenge_response:" -/* gui_common */ -int para_open_audiod_pipe(char *); -int read_audiod_pipe(int, void (*)(char *)); - /* exec */ int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds); @@ -188,7 +173,6 @@ int stat_item_valid(const char *item); int stat_line_valid(const char *); void stat_client_write(const char *msg, int itemnum); int stat_client_add(int fd, long unsigned mask); -size_t for_each_line(char *buf, size_t n, void (*line_handler)(char *)); #define FOR_EACH_STAT_ITEM(i) for (i = 0; i < NUM_STAT_ITEMS; i++) __printf_2_3 void para_log(int, const char*, ...); @@ -216,3 +200,9 @@ __printf_2_3 void para_log(int, const char*, ...); p = para_realloc(p, size); \ } \ } + +static inline int para_random(unsigned max) +{ + return ((max + 0.0) * (rand() / (RAND_MAX + 1.0))); +} +