Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members  

jutils.h

Go to the documentation of this file.
00001 /* MuSE - Multiple Streaming Engine
00002  * Copyright (C) 2000-2002 Denis Roio aka jaromil <jaromil@dyne.org>
00003  *
00004  * This source code is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Public License as published 
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * This source code is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012  * Please refer to the GNU Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Public License along with
00015  * this source code; if not, write to:
00016  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 #ifndef __UTILS_H__
00020 #define __UTILS_H__
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 #include <stdio.h>
00027 #include <string.h>
00028 #include <libintl.h>
00029 
00034 #define MAX_DEBUG 2
00035 
00036 #define FUNC 2 /* se il debug level e' questo
00037                   ci sono le funzioni chiamate */
00038 #define WARN 1 /* ... blkbblbl */
00039 
00040 // for native language support
00041 #define _(x)    gettext(x)
00042 
00043 
00047 #define CHAR_SET(func,var) \
00048 char var[MAX_VALUE_SIZE]; \
00049 void func(char *in) { \
00050 if(strncmp(var,in,MAX_VALUE_SIZE)==0) return; \
00051 else strncpy(var,in,MAX_VALUE_SIZE); \
00052 } \
00053 char *func() { return var; };
00054 
00055 #define INT_SET(func,var) \
00056 int var; \
00057 void func(int in) { \
00058 if(var==in) return; \
00059 else var=in; \
00060 } \
00061 int func() { return var; };
00062 
00063 #define FLOAT_SET(func,var) \
00064 float var; \
00065 void func(float in) { \
00066 if(var==in) return; \
00067 else var=in; \
00068 } \
00069 float func() { return var; };
00070   
00071   class GUI;
00072 
00073   void set_guimsg(GUI *g);
00074   void MuseSetDebug(int lev);
00075   int MuseGetDebug();
00076   void MuseSetLog(char *file);
00077   void MuseCloseLog();
00078   void notice(const char *format, ...);
00079   void func(const char *format, ...);
00080   void error(const char *format, ...);
00081   void act(const char *format, ...);
00082   void warning(const char *format, ...);
00083   double dtime();
00084   void jsleep(int sec, long nsec);
00085   int set_rtpriority(int max);
00086   void chomp(char *str);
00087   int resolve(char *host, char *ip);
00088 
00089 #ifdef __cplusplus
00090 }
00091 #endif
00092 
00093 #endif

Generated on Thu Dec 16 12:28:21 2004 for MuSE by doxygen1.3