2011-09-05 00:05:39 +02:00
|
|
|
$NetBSD: patch-ak,v 1.5 2011/09/04 22:05:39 dholland Exp $
|
1999-09-06 18:36:32 +02:00
|
|
|
|
2011-09-05 00:05:39 +02:00
|
|
|
- needs stdlib.h, not malloc.h
|
|
|
|
- support BSD cdroms
|
|
|
|
- move function "prototypes" outside of functions
|
|
|
|
- use malloc properly
|
|
|
|
|
|
|
|
--- program.c.orig 1993-01-12 18:59:49.000000000 +0000
|
|
|
|
+++ program.c
|
1999-09-06 18:36:32 +02:00
|
|
|
@@ -27,10 +27,13 @@
|
|
|
|
|
|
|
|
# include <stdio.h>
|
|
|
|
# include <string.h>
|
|
|
|
-# include <malloc.h>
|
2011-09-05 00:05:39 +02:00
|
|
|
+# include <stdlib.h>
|
1999-09-06 18:36:32 +02:00
|
|
|
|
|
|
|
# include "debug.h"
|
|
|
|
# include "cdrom_globs.h"
|
2005-12-11 21:48:46 +01:00
|
|
|
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
1999-09-06 18:36:32 +02:00
|
|
|
+# include "cdrom_freebsd.h"
|
|
|
|
+#endif
|
|
|
|
#ifdef sun
|
|
|
|
# include "cdrom_sun.h"
|
|
|
|
#endif
|
2011-09-05 00:05:39 +02:00
|
|
|
@@ -52,6 +55,15 @@ static Widget new_track_button;
|
1999-09-06 18:36:32 +02:00
|
|
|
static Boolean adding_to_new_track = False;
|
|
|
|
static struct prognode *current_node = NULL;
|
|
|
|
|
|
|
|
+static void cb_move_program_ptr();
|
|
|
|
+static void cb_clear_program();
|
|
|
|
+static void cb_cancel_program();
|
|
|
|
+static void cb_save_program();
|
|
|
|
+static void cb_trackbuttons();
|
|
|
|
+static void cb_add_10();
|
|
|
|
+static void cb_new_track();
|
|
|
|
+static void cb_program_all();
|
|
|
|
+
|
|
|
|
void
|
|
|
|
program_form_setup (parent_widget)
|
|
|
|
Widget parent_widget;
|
2011-09-05 00:05:39 +02:00
|
|
|
@@ -67,15 +79,6 @@ program_form_setup (parent_widget)
|
1999-09-06 18:36:32 +02:00
|
|
|
Widget save_button;
|
|
|
|
Widget all_button;
|
2011-09-05 00:05:39 +02:00
|
|
|
|
1999-09-06 18:36:32 +02:00
|
|
|
- extern void cb_move_program_ptr();
|
|
|
|
- extern void cb_clear_program();
|
|
|
|
- extern void cb_cancel_program();
|
|
|
|
- extern void cb_save_program();
|
|
|
|
- extern void cb_trackbuttons();
|
|
|
|
- extern void cb_add_10();
|
|
|
|
- extern void cb_new_track();
|
|
|
|
- extern void cb_program_all();
|
2011-09-05 00:05:39 +02:00
|
|
|
-
|
1999-09-06 18:36:32 +02:00
|
|
|
/*
|
|
|
|
* create program form as a non-managed widget, because this
|
2011-09-05 00:05:39 +02:00
|
|
|
* form "pops up" when requested, as part of the main form, and
|
|
|
|
@@ -291,7 +294,7 @@ unsigned char track;
|
|
|
|
|
|
|
|
if (cdi.program == NULL)
|
|
|
|
{
|
|
|
|
- new = (struct prognode *) malloc(sizeof(struct prognode));
|
|
|
|
+ new = malloc(sizeof(struct prognode));
|
|
|
|
new->track = track;
|
|
|
|
new->next = NULL;
|
|
|
|
new->prev = NULL;
|
|
|
|
@@ -304,7 +307,7 @@ unsigned char track;
|
|
|
|
|
|
|
|
else if (current_node == NULL) /* pre-insert */
|
|
|
|
{
|
|
|
|
- new = (struct prognode *) malloc(sizeof(struct prognode));
|
|
|
|
+ new = malloc(sizeof(struct prognode));
|
|
|
|
new->track = track;
|
|
|
|
new->next = cdi.program;
|
|
|
|
new->prev = NULL;
|
|
|
|
@@ -327,7 +330,7 @@ unsigned char track;
|
|
|
|
(insert_point != current_node))
|
|
|
|
insert_point = insert_point->next;
|
|
|
|
|
|
|
|
- new = (struct prognode *) malloc(sizeof(struct prognode));
|
|
|
|
+ new = malloc(sizeof(struct prognode));
|
|
|
|
new->track = track;
|
|
|
|
new->next = insert_point->next;
|
|
|
|
new->prev = insert_point;
|