"Fossies" - the Fresh Open Source Software Archive

Member "snd-20.9/_sndlib.h" (22 Aug 2020, 2328 Bytes) of package /linux/misc/snd-20.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "_sndlib.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 20.6_vs_20.7.

    1 #ifndef H_SNDLIB_H
    2 #define H_SNDLIB_H
    3 /* we're not supposed to use a name like _SNDLIB_H */
    4 
    5 #include "mus-config.h"
    6 
    7 #ifndef _MSC_VER
    8   #include <unistd.h>
    9 #endif
   10 
   11 #include <sys/types.h>
   12 #include <stdio.h>
   13 
   14 #if ((!__NetBSD__) && ((_MSC_VER) || (!defined(__STC__)) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901L))))
   15   #define __func__ __FUNCTION__
   16 #endif
   17 
   18 #if (!defined(M_PI))
   19   #define M_PI 3.14159265358979323846264338327
   20   #define M_PI_2 (M_PI / 2.0)
   21 #endif
   22 
   23 #define is_power_of_2(x)    ((((x) - 1) & (x)) == 0)
   24 
   25 #define MUS_MAX_MALLOC_DEFAULT (1 << 26)
   26 #define MUS_MAX_TABLE_SIZE_DEFAULT (1024 * 1024 * 20) /* delay line allocation etc */
   27 
   28 #ifndef SEEK_SET
   29   #define SEEK_SET 0
   30   #define SEEK_END 2
   31 #endif
   32 
   33 #ifdef _MSC_VER
   34   #ifdef FOPEN
   35     #undef FOPEN
   36   #endif
   37   #if USE_SND
   38     #define OPEN(File, Flags, Mode) snd_open((File), (Flags), 0)
   39   #else
   40     #define OPEN(File, Flags, Mode) open((File), (Flags))
   41   #endif
   42 #else
   43   #if USE_SND
   44     #define OPEN(File, Flags, Mode) snd_open((File), (Flags), (Mode))
   45    #else
   46     #define OPEN(File, Flags, Mode) open((File), (Flags), (Mode))
   47   #endif
   48 #endif
   49 
   50 #if USE_SND
   51   #define FOPEN(File, Flags)  snd_fopen((File), (Flags))
   52   #define CREAT(File, Flags)  snd_creat((File), (Flags))
   53   #define REMOVE(OldF)        snd_remove(OldF, IGNORE_CACHE)
   54   #define STRERROR(Err)       snd_io_strerror()
   55   #define CLOSE(Fd, Name)     snd_close(Fd, Name)
   56   #define FCLOSE(Fd, Name)    snd_fclose(Fd, Name)
   57 #else
   58   #define FOPEN(File, Flags)  fopen((File), (Flags))
   59   #define CREAT(File, Flags)  creat((File), (Flags))
   60   #define REMOVE(OldF)        remove(OldF)
   61   #define STRERROR(Err)       strerror(Err)
   62   #define CLOSE(Fd, Name)     close(Fd)
   63   #define FCLOSE(Fd, Name)    fclose(Fd)
   64 #endif
   65 
   66 #ifndef S_set
   67   #if (!HAVE_EXTENSION_LANGUAGE)
   68     #define S_set "set-"
   69   #else
   70   #if HAVE_RUBY
   71     #define S_set "set_"
   72   #else
   73   #if HAVE_SCHEME
   74     #define S_set "set! "
   75   #else
   76   #if HAVE_FORTH
   77     #define S_set "set-"
   78   #endif
   79   #endif
   80   #endif
   81   #endif
   82 #endif
   83 
   84 #define MUS_LOOP_INFO_SIZE 8
   85 #define MUS_ALSA_API 0
   86 #define MUS_OSS_API 1
   87 #define MUS_JACK_API 2
   88 
   89 #define G7XX 0
   90 #define MUS_MAX_CHANS 256
   91 
   92 #include "sndlib.h"
   93 #if (HAVE_EXTENSION_LANGUAGE)  /* make sndinfo for example sets this to 0 but does not change mus-config.h */
   94   #include "xen.h"
   95   #include "vct.h"
   96 #endif
   97 #endif