/* sound.c -- sound support.
- Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1998-1999, 2001-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* BEGIN: Non Windows Includes */
#ifndef WINDOWSNT
-#ifndef MSDOS
#include <sys/ioctl.h>
-#endif
/* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention
sys/soundcard.h. So, let's try whatever's there. */
/* BEGIN: Windows Specific Includes */
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <limits.h>
#include <windows.h>
#include <mmsystem.h>
/* Symbols. */
-extern Lisp_Object QCfile, QCdata;
Lisp_Object QCvolume, QCdevice;
Lisp_Object Qsound;
Lisp_Object Qplay_sound_functions;
};
#ifdef HAVE_ALSA
-static void alsa_sound_perror (char *, int) NO_RETURN;
+static void alsa_sound_perror (const char *, int) NO_RETURN;
#endif
-static void sound_perror (char *) NO_RETURN;
-static void sound_warning (char *);
+static void sound_perror (const char *) NO_RETURN;
+static void sound_warning (const char *);
static int parse_sound (Lisp_Object, Lisp_Object *);
/* END: Common Definitions */
/* Like perror, but signals an error. */
static void
-sound_perror (char *msg)
+sound_perror (const char *msg)
{
int saved_errno = errno;
/* Display a warning message. */
static void
-sound_warning (char *msg)
+sound_warning (const char *msg)
{
message (msg);
}
static u_int32_t
le2hl (u_int32_t value)
{
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24);
#endif
static u_int16_t
le2hs (u_int16_t value)
{
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[0] + (p[1] << 8);
#endif
static u_int32_t
be2hl (u_int32_t value)
{
-#ifndef WORDS_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[3] + (p[2] << 8) + (p[1] << 16) + (p[0] << 24);
#endif
static u_int16_t
be2hs (u_int16_t value)
{
-#ifndef WORDS_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[1] + (p[0] << 8);
#endif
static void
vox_open (struct sound_device *sd)
{
- char *file;
+ const char *file;
/* Open the sound device. Default is /dev/dsp. */
if (sd->file)
static int
vox_init (struct sound_device *sd)
{
- char *file;
+ const char *file;
int fd;
/* Open the sound device. Default is /dev/dsp. */
/* This driver is available on GNU/Linux. */
static void
-alsa_sound_perror (char *msg, int err)
+alsa_sound_perror (const char *msg, int err)
{
error ("%s: %s", msg, snd_strerror (err));
}
static void
alsa_open (struct sound_device *sd)
{
- char *file;
+ const char *file;
struct alsa_params *p;
int err;
int chn;
snd_mixer_t *handle;
snd_mixer_elem_t *e;
- char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE;
+ const char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE;
if (snd_mixer_open (&handle, 0) >= 0)
{
static int
alsa_init (struct sound_device *sd)
{
- char *file;
+ const char *file;
snd_pcm_t *handle;
int err;
#endif /* HAVE_SOUND */
-/* arch-tag: dd850ad8-0433-4e2c-9cba-b7aeeccc0dbd
- (do not change this comment) */