jutils.h Source File

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
    00033 #define MAX_DEBUG 2
    00034
    00035 #define FUNC 2 /* se il debug level e' questo
    00036                   ci sono le funzioni chiamate */
    00037 #define WARN 1 /* ... blkbblbl */
    00038
    00042 #define CHAR_SET(func,var) \
    00043 char var[MAX_VALUE_SIZE]; \
    00044 void func(char *in) { \
    00045 if(strncmp(var,in,MAX_VALUE_SIZE)==0) return; \
    00046 else strncpy(var,in,MAX_VALUE_SIZE); \
    00047 } \
    00048 char *func() { return var; };
    00049
    00050 #define INT_SET(func,var) \
    00051 int var; \
    00052 void func(int in) { \
    00053 if(var==in) return; \
    00054 else var=in; \
    00055 } \
    00056 int func() { return var; };
    00057
    00058 #define FLOAT_SET(func,var) \
    00059 float var; \
    00060 void func(float in) { \
    00061 if(var==in) return; \
    00062 else var=in; \
    00063 } \
    00064 float func() { return var; };
    00065
    00066   class GUI;
    00067
    00068   void set_guimsg(GUI *g);
    00069   void MuseSetDebug(int lev);
    00070   int MuseGetDebug();
    00071   void MuseSetLog(char *file);
    00072   void MuseCloseLog();
    00073   void notice(const char *format, ...);
    00074   void func(const char *format, ...);
    00075   void error(const char *format, ...);
    00076   void act(const char *format, ...);
    00077   void warning(const char *format, ...);
    00078   double dtime();
    00079   void jsleep(int sec, long nsec);
    00080   int set_rtpriority(int max);
    00081   void chomp(char *str);
    00082   int resolve(char *host, char *ip);
    00083
    00084 #ifdef __cplusplus
    00085 }
    00086 #endif
    00087
    00088 #endif