parent
a03689744e
commit
ee7cfd147d
18
api/epplet.c
18
api/epplet.c
|
@ -200,7 +200,7 @@ GadGeneral;
|
|||
|
||||
#define GADGET_GET_TYPE(gad) (((GadGeneral *) (gad))->type)
|
||||
#ifdef __GNUC__
|
||||
# define GADGET_CONFIRM_TYPE(gad, type) \
|
||||
#define GADGET_CONFIRM_TYPE(gad, type) \
|
||||
do { \
|
||||
if (GADGET_GET_TYPE(gad) != (type)) { \
|
||||
fprintf(stderr, "ALERT: %s() called with invalid gadget " \
|
||||
|
@ -209,7 +209,7 @@ GadGeneral;
|
|||
return; \
|
||||
} \
|
||||
} while (0)
|
||||
# define GADGET_CONFIRM_TYPE_RVAL(gad, type, rval) \
|
||||
#define GADGET_CONFIRM_TYPE_RVAL(gad, type, rval) \
|
||||
do { \
|
||||
if (GADGET_GET_TYPE(gad) != (type)) { \
|
||||
fprintf(stderr, "ALERT: %s() called with invalid gadget " \
|
||||
|
@ -219,9 +219,9 @@ GadGeneral;
|
|||
} \
|
||||
} while (0)
|
||||
#else
|
||||
# define GADGET_CONFIRM_TYPE(gad, type) do { \
|
||||
#define GADGET_CONFIRM_TYPE(gad, type) do { \
|
||||
if (GADGET_GET_TYPE(gad) != (type)) return;} while (0)
|
||||
# define GADGET_CONFIRM_TYPE_RVAL(gad, type, rval) do { \
|
||||
#define GADGET_CONFIRM_TYPE_RVAL(gad, type, rval) do { \
|
||||
if (GADGET_GET_TYPE(gad) != (type)) return (rval);} while (0)
|
||||
#endif
|
||||
|
||||
|
@ -912,7 +912,9 @@ Epplet_window_push_context(Window newwin)
|
|||
if (!win)
|
||||
return;
|
||||
|
||||
if ((!(window_stack = realloc(window_stack, sizeof(Epplet_window) * (window_stack_pos + 1)))))
|
||||
window_stack = realloc(window_stack,
|
||||
sizeof(Epplet_window) * (window_stack_pos + 1));
|
||||
if (!window_stack)
|
||||
exit(1);
|
||||
window_stack[window_stack_pos] = win;
|
||||
window_stack_pos++;
|
||||
|
@ -926,7 +928,9 @@ Epplet_window_pop_context(void)
|
|||
|
||||
window_stack_pos--;
|
||||
ret = window_stack[window_stack_pos];
|
||||
if ((!(window_stack = realloc(window_stack, sizeof(Epplet_window) * (window_stack_pos)))))
|
||||
window_stack = realloc(window_stack,
|
||||
sizeof(Epplet_window) * (window_stack_pos));
|
||||
if (!window_stack)
|
||||
exit(1);
|
||||
/* Window stack pos == 0 corresponds to the main epplet window */
|
||||
if (window_stack_pos < 1)
|
||||
|
@ -2330,7 +2334,7 @@ Epplet_draw_textbox(Epplet_gadget eg)
|
|||
GC gc;
|
||||
|
||||
GADGET_CONFIRM_TYPE(eg, E_TEXTBOX);
|
||||
if (!(g = (GadTextBox *)eg))
|
||||
if (!(g = (GadTextBox *) eg))
|
||||
return;
|
||||
|
||||
if (g->hilited)
|
||||
|
|
|
@ -44,6 +44,7 @@ Epplet_bind_single_GL(Epplet_gadget da, int red, int green, int blue,
|
|||
XVisualInfo *vi;
|
||||
GLXContext cx;
|
||||
Window win;
|
||||
|
||||
int attributeListSgl[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, red, GLX_GREEN_SIZE, green, GLX_BLUE_SIZE, blue,
|
||||
GLX_ALPHA_SIZE, alpha, GLX_AUX_BUFFERS, aux_buffers,
|
||||
|
|
|
@ -58,7 +58,7 @@ out_cb(void *data, Window w)
|
|||
data = NULL;
|
||||
}
|
||||
|
||||
static Epplet_gadget
|
||||
static Epplet_gadget
|
||||
epp_create_std_button(int x, int y, char *std,
|
||||
void (*func) (void *data), void *data)
|
||||
{
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
#include "net.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -38,9 +38,9 @@ extern void Epplet_redraw(void);
|
|||
#define SEVEN_IMAGE "7of9.png"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
extern void get_load_average(double *, double *, double *);
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#endif
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -22,6 +22,7 @@ int *vspread, *hspread, *residual;
|
|||
unsigned char rm[255], gm[255], bm[255];
|
||||
char *netdev;
|
||||
double stream_max = 2000;
|
||||
|
||||
double bandwidths[] = {
|
||||
1000000000, 100000000, 10000000, 2000000,
|
||||
1540000, 1000000, 512000, 256000,
|
||||
|
|
|
@ -564,12 +564,14 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
int i, prio;
|
||||
|
||||
char *button_stds[] = {
|
||||
"CLOSE", "PLAY", "STOP", "PREVIOUS", "NEXT", "ARROW_UP",
|
||||
"HELP", "REWIND", "FAST_FORWARD", "REPEAT", "CONFIGURE",
|
||||
"EJECT"
|
||||
};
|
||||
typedef void (*callback_func) (void *data);
|
||||
|
||||
callback_func button_funcs[] = {
|
||||
cb_close, play_cd, stop_cd, prev_track, next_track,
|
||||
popup_tracks, do_help, rew_cd, ff_cd, NULL, cddb_update,
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
@ -277,9 +277,7 @@ change_image(void *data)
|
|||
return;
|
||||
|
||||
/* Test-load each image to make sure it's a valid image file. */
|
||||
for (;
|
||||
((!filenames[idx])
|
||||
|| (!(im = imlib_load_image(filenames[idx]))));)
|
||||
for (; ((!filenames[idx]) || (!(im = imlib_load_image(filenames[idx]))));)
|
||||
{
|
||||
/* It isn't, so NULL out its name. */
|
||||
filenames[idx] = NULL;
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
#endif
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#ifndef __GNUC__
|
||||
# define __attribute__(x)
|
||||
#define __attribute__(x)
|
||||
#endif
|
||||
|
||||
#define ACT_EXIT "<exit>"
|
||||
|
@ -41,9 +41,9 @@
|
|||
#define ACT_SHADE "<shade>"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#include "epplet.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
|
|
@ -22,7 +22,7 @@ void initialize_channels(void);
|
|||
|
||||
#define MIXER_DEV "/dev/mixer"
|
||||
#if 0
|
||||
# define debug
|
||||
#define debug
|
||||
#endif
|
||||
|
||||
typedef struct _MIX_CHANNEL
|
||||
|
|
|
@ -446,6 +446,7 @@ draw_rotator(void)
|
|||
int i;
|
||||
double tx, ty;
|
||||
double xcopy, ycopy, zcopy;
|
||||
|
||||
int from[84] =
|
||||
{ 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22,
|
||||
23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43,
|
||||
|
@ -534,6 +535,7 @@ draw_funky_rotator(void)
|
|||
int i;
|
||||
double tx, ty;
|
||||
double xcopy, ycopy, zcopy;
|
||||
|
||||
int from[84] =
|
||||
{ 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22,
|
||||
23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -35,9 +35,9 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
#define BEGMATCH(a, b) (!strncasecmp((a), (b), (sizeof(b) - 1)))
|
||||
#define NONULL(x) ((x) ? (x) : (""))
|
||||
|
@ -46,9 +46,9 @@
|
|||
#define SET_AND_RETURN(o, f, t) do {SET_PTR(one, o); SET_PTR(five, f); SET_PTR(fifteen, t); return;} while (0)
|
||||
|
||||
#ifdef __sun__
|
||||
# ifndef FSCALE
|
||||
# define FSCALE 100.0
|
||||
# endif
|
||||
#ifndef FSCALE
|
||||
#define FSCALE 100.0
|
||||
#endif
|
||||
void
|
||||
get_load_average(double *one, double *five, double *fifteen)
|
||||
{
|
||||
|
|
|
@ -39,21 +39,21 @@
|
|||
#define SKIPWS(c) while (*(c) && isspace((unsigned char) *(c))) c++;
|
||||
#define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0
|
||||
#ifndef TRUE
|
||||
# define TRUE (1)
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
# define FALSE (0)
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#define BUFFSIZE 256
|
||||
#ifndef _POSIX_PATH_MAX
|
||||
# define _POSIX_PATH_MAX 255
|
||||
#define _POSIX_PATH_MAX 255
|
||||
#endif
|
||||
#define NONULL(x) ((x) ? (x) : "")
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
|
||||
int ebiff_utimes(const char *file, struct timeval tvp[2]);
|
||||
|
|
|
@ -31,20 +31,20 @@
|
|||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#ifdef __sun__
|
||||
# include <unistd.h>
|
||||
# include <kstat.h>
|
||||
# include <sys/sysinfo.h>
|
||||
#include <unistd.h>
|
||||
#include <kstat.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#endif
|
||||
#ifdef linux
|
||||
# include <linux/version.h>
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
#include "epplet.h"
|
||||
#include "net.h"
|
||||
|
||||
#if 0
|
||||
# define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#define D(x) do {printf("%10s | %7d: [debug] ", __FILE__, __LINE__); printf x; fflush(stdout);} while (0)
|
||||
#else
|
||||
# define D(x) ((void) 0)
|
||||
#define D(x) ((void) 0)
|
||||
#endif
|
||||
|
||||
char **
|
||||
|
@ -151,12 +151,12 @@ net_get_bytes_inout(const char *device, double *in_bytes, double *out_bytes)
|
|||
{
|
||||
*colon = ' ';
|
||||
}
|
||||
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
|
||||
sscanf(buff, "%s %s %*s %*s %*s %*s %s", dev, in_str, out_str);
|
||||
# else
|
||||
#else
|
||||
sscanf(buff, "%s %s %*s %*s %*s %*s %*s %*s %*s %s", dev, in_str,
|
||||
out_str);
|
||||
# endif
|
||||
#endif
|
||||
if (!strcmp(dev, device))
|
||||
{
|
||||
match = 1;
|
||||
|
|
Loading…
Reference in New Issue