CDVDiso: Now uses automake, is C++, isn't split into two files, and doesn't change around the working directory on us.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1118 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-05-02 13:42:13 +00:00
parent 0250605329
commit 92ac589187
21 changed files with 1542 additions and 603 deletions

View File

@ -637,7 +637,7 @@ int InitPlugins()
// throw Exception::InvalidOperation( "Bad coder mojo - InitPlugins called prior to plugins having been loaded." );
#ifndef _WIN32
chdir(MAIN_DIR);
//chdir(MAIN_DIR);
#endif
int ret;
@ -712,7 +712,7 @@ int OpenPlugins(const char* pTitleFilename)
#ifndef _WIN32
// change dir so that CDVD can find its config file
char file[255], pNewTitle[255];
/*char file[255], pNewTitle[255];
chdir(MAIN_DIR);
chdir(Config.PluginsDir);
@ -721,7 +721,7 @@ int OpenPlugins(const char* pTitleFilename)
// because we are changing the dir, we have to set a new title if it is a relative dir
sprintf(pNewTitle, "%s/%s", file, pTitleFilename);
pTitleFilename = pNewTitle;
}
}*/
#endif
if( !OpenStatus.CDVD )
@ -808,14 +808,14 @@ int OpenPlugins(const char* pTitleFilename)
}
#ifndef _WIN32
chdir(MAIN_DIR);
//chdir(MAIN_DIR);
#endif
return 0;
OpenError:
ClosePlugins( true );
#ifndef _WIN32
chdir(MAIN_DIR);
//chdir(MAIN_DIR);
#endif
return -1;

View File

@ -1,17 +1,34 @@
#!/bin/sh
curdir=`pwd`
echo ----------------
echo Building CDVDiso
echo ----------------
cd ${curdir}/src/Linux
make clean
make $@
curdir=`pwd`
# copy the files
if [ -s cfgCDVDiso ] && [ -s libCDVDiso.so ]
then
cp cfgCDVDiso libCDVDiso.so ${PCSX2PLUGINS}
if test "${CDVDisoOPTIONS+set}" != set ; then
export CDVDisoOPTIONS=""
fi
cd src
if [ $# -gt 0 ] && [ $1 = "all" ]
then
aclocal
automake -a
autoconf
./configure ${CDVDisoOPTIONS} --prefix=${PCSX2PLUGINS}
make clean
make install
else
make $@
fi
if [ $? -ne 0 ]
then
exit 1
fi

View File

@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __CDVDISO_H__
#define __CDVDISO_H__
#ifdef _MSC_VER
#pragma warning(disable:4018)
@ -28,50 +30,50 @@
#ifdef __cplusplus
#ifdef _MSC_VER
#define EXPORT_C(type) extern "C" __declspec(dllexport) type CALLBACK
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C(type) extern "C" type
#define EXPORT_C_(type) extern "C" type
#endif
#else
#ifdef _MSC_VER
#define EXPORT_C(type) __declspec(dllexport) type __stdcall
#define EXPORT_C_(type) __declspec(dllexport) type __stdcall
#else
#define EXPORT_C(type) type
#define EXPORT_C_(type) type
#endif
#endif
EXPORT_C(u32) PS2EgetLibType();
EXPORT_C(u32) PS2EgetLibVersion2(u32 type);
EXPORT_C(char*) PS2EgetLibName();
EXPORT_C_(u32) PS2EgetLibType();
EXPORT_C_(u32) PS2EgetLibVersion2(u32 type);
EXPORT_C_(char*) PS2EgetLibName();
EXPORT_C(s32) CDVDinit();
EXPORT_C(s32) CDVDopen(const char* pTitleFilename);
EXPORT_C(void) CDVDclose();
EXPORT_C(void) CDVDshutdown();
EXPORT_C(s32) CDVDreadTrack(u32 lsn, int mode);
EXPORT_C_(s32) CDVDinit();
EXPORT_C_(s32) CDVDopen(const char* pTitleFilename);
EXPORT_C_(void) CDVDclose();
EXPORT_C_(void) CDVDshutdown();
EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode);
// return can be NULL (for async modes)
EXPORT_C(u8*) CDVDgetBuffer();
EXPORT_C_(u8*) CDVDgetBuffer();
EXPORT_C(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq);//read subq from disc (only cds have subq data)
EXPORT_C(s32) CDVDgetTN(cdvdTN *Buffer); //disk information
EXPORT_C(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type
EXPORT_C(s32) CDVDgetTOC(void* toc); //gets ps2 style toc from disc
EXPORT_C(s32) CDVDgetDiskType(); //CDVD_TYPE_xxxx
EXPORT_C(s32) CDVDgetTrayStatus(); //CDVD_TRAY_xxxx
EXPORT_C(s32) CDVDctrlTrayOpen(); //open disc tray
EXPORT_C(s32) CDVDctrlTrayClose(); //close disc tray
EXPORT_C_(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq);//read subq from disc (only cds have subq data)
EXPORT_C_(s32) CDVDgetTN(cdvdTN *Buffer); //disk information
EXPORT_C_(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type
EXPORT_C_(s32) CDVDgetTOC(void* toc); //gets ps2 style toc from disc
EXPORT_C_(s32) CDVDgetDiskType(); //CDVD_TYPE_xxxx
EXPORT_C_(s32) CDVDgetTrayStatus(); //CDVD_TRAY_xxxx
EXPORT_C_(s32) CDVDctrlTrayOpen(); //open disc tray
EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray
// extended funcs
EXPORT_C(void) CDVDconfigure();
EXPORT_C(void) CDVDabout();
EXPORT_C(s32) CDVDtest();
EXPORT_C(void) CDVDnewDiskCB(void (*callback)());
EXPORT_C_(void) CDVDconfigure();
EXPORT_C_(void) CDVDabout();
EXPORT_C_(s32) CDVDtest();
EXPORT_C_(void) CDVDnewDiskCB(void (*callback)());
#define CDVD_LOG __Log
extern FILE *cdvdLog;
@ -104,6 +106,10 @@ extern _cdIso cdIso[8];
#define MSF2SECT(m,s,f) (((m)*60+(s)-2)*75+(f))
extern const unsigned char version;
extern const unsigned char revision;
extern const unsigned char build;
extern char IsoFile[256];
extern char IsoCWD[256];
extern char CdDev[256];
@ -130,3 +136,4 @@ void UpdateZmode();
void CfgOpenFile();
void SysMessage(char *fmt, ...);
#endif

View File

@ -55,7 +55,7 @@ char *LibName = "Linuz Iso CDVD ";
const unsigned char version = PS2E_CDVD_VERSION;
const unsigned char revision = 0;
const unsigned char build = 8;
const unsigned char build = 9;
unsigned char cdbuffer[CD_FRAMESIZE_RAW * 10] = {0};
@ -80,17 +80,17 @@ void lba_to_msf(s32 lba, u8* m, u8* s, u8* f)
#define itob(i) ((i)/10*16 + (i)%10) /* u_char to BCD */
EXPORT_C(char*) PS2EgetLibName()
EXPORT_C_(char*) PS2EgetLibName()
{
return LibName;
}
EXPORT_C(u32) PS2EgetLibType()
EXPORT_C_(u32) PS2EgetLibType()
{
return PS2E_LT_CDVD;
}
EXPORT_C(u32) PS2EgetLibVersion2(u32 type)
EXPORT_C_(u32) PS2EgetLibVersion2(u32 type)
{
return (version << 16) | (revision << 8) | build;
}
@ -111,7 +111,7 @@ void __Log(char *fmt, ...)
#endif
EXPORT_C(s32) CDVDinit()
EXPORT_C_(s32) CDVDinit()
{
#ifdef _DEBUG
cdvdLog = fopen("logs/cdvdLog.txt", "w");
@ -133,7 +133,7 @@ EXPORT_C(s32) CDVDinit()
return 0;
}
EXPORT_C(void) CDVDshutdown()
EXPORT_C_(void) CDVDshutdown()
{
cdvdCurrentIso[0] = 0;
#ifdef CDVD_LOG
@ -141,7 +141,7 @@ EXPORT_C(void) CDVDshutdown()
#endif
}
EXPORT_C(s32) CDVDopen(const char* pTitle)
EXPORT_C_(s32) CDVDopen(const char* pTitle)
{
LoadConf();
@ -224,7 +224,7 @@ EXPORT_C(s32) CDVDopen(const char* pTitle)
return 0;
}
EXPORT_C(void) CDVDclose()
EXPORT_C_(void) CDVDclose()
{
strcpy(cdvdCurrentIso, IsoFile);
@ -233,7 +233,7 @@ EXPORT_C(void) CDVDclose()
if (fdump != NULL) isoClose(fdump);
}
EXPORT_C(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq)
EXPORT_C_(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq)
{
// fake it
u8 min, sec, frm;
@ -256,7 +256,7 @@ EXPORT_C(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq)
return 0;
}
EXPORT_C(s32) CDVDgetTN(cdvdTN *Buffer)
EXPORT_C_(s32) CDVDgetTN(cdvdTN *Buffer)
{
Buffer->strack = 1;
Buffer->etrack = 1;
@ -264,7 +264,7 @@ EXPORT_C(s32) CDVDgetTN(cdvdTN *Buffer)
return 0;
}
EXPORT_C(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer)
EXPORT_C_(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer)
{
if (Track == 0)
{
@ -280,7 +280,7 @@ EXPORT_C(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer)
}
static int layer1start = -1;
EXPORT_C(s32) CDVDgetTOC(void* toc)
EXPORT_C_(s32) CDVDgetTOC(void* toc)
{
u8 type = CDVDgetDiskType();
u8* tocBuff = (u8*)toc;
@ -289,8 +289,6 @@ EXPORT_C(s32) CDVDgetTOC(void* toc)
if (type == CDVD_TYPE_DVDV || type == CDVD_TYPE_PS2DVD)
{
int i;
// get dvd structure format
// scsi command 0x43
memset(tocBuff, 0, 2048);
@ -424,7 +422,7 @@ EXPORT_C(s32) CDVDgetTOC(void* toc)
return 0;
}
EXPORT_C(s32) CDVDreadTrack(u32 lsn, int mode)
EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode)
{
int _lsn = lsn;
@ -461,32 +459,32 @@ EXPORT_C(s32) CDVDreadTrack(u32 lsn, int mode)
return 0;
}
EXPORT_C(u8*) CDVDgetBuffer()
EXPORT_C_(u8*) CDVDgetBuffer()
{
return pbuffer;
}
EXPORT_C(s32) CDVDgetDiskType()
EXPORT_C_(s32) CDVDgetDiskType()
{
return cdtype;
}
EXPORT_C(s32) CDVDgetTrayStatus()
EXPORT_C_(s32) CDVDgetTrayStatus()
{
return CDVD_TRAY_CLOSE;
}
EXPORT_C(s32) CDVDctrlTrayOpen()
EXPORT_C_(s32) CDVDctrlTrayOpen()
{
return 0;
}
EXPORT_C(s32) CDVDctrlTrayClose()
EXPORT_C_(s32) CDVDctrlTrayClose()
{
return 0;
}
EXPORT_C(s32) CDVDtest()
EXPORT_C_(s32) CDVDtest()
{
if (*IsoFile == 0) return 0;

View File

@ -1,82 +0,0 @@
/* CDVDiso
* Copyright (C) 2002-2004 CDVDiso Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include "CDVDiso.h"
const char *s_strIniPath="../inis/CDVDiso.ini";
void LoadConf()
{
FILE *f;
char cfg[256];
//sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME"));
strcpy(cfg, s_strIniPath);
f = fopen(cfg, "r");
if (f == NULL)
{
printf("Unable to load %s\n", cfg);
strcpy(IsoFile, DEV_DEF);
strcpy(CdDev, CDDEV_DEF);
BlockDump = 0;
SaveConf();
return;
}
fscanf(f, "IsoFile = %[^\n]\n", IsoFile);
fscanf(f, "CdDev = %[^\n]\n", CdDev);
fscanf(f, "BlockDump = %d\n", &BlockDump);
if (!strncmp(IsoFile, "CdDev =", 9)) *IsoFile = 0; // quick fix
if (*CdDev == 0) strcpy(CdDev, CDDEV_DEF);
fclose(f);
}
void SaveConf()
{
FILE *f;
char cfg[256];
//sprintf(cfg, "%s/.PS2E", getenv("HOME"));
//mkdir(cfg, 0755);
//sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME"));
strcpy(cfg, s_strIniPath);
f = fopen(cfg, "w");
if (f == NULL)
{
printf("Unable to save %s\n", cfg);
return;
}
fprintf(f, "IsoFile = %s\n", IsoFile);
fprintf(f, "CdDev = %s\n", CdDev);
fprintf(f, "BlockDump = %d\n", BlockDump);
fclose(f);
}

View File

@ -0,0 +1,326 @@
/* CDVDiso
* Copyright (C) 2002-2004 CDVDiso Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Config.h"
const char *s_strIniPath="./inis/CDVDiso.ini";
GtkWidget *AboutDlg, *ConfDlg, *MsgDlg, *FileSel;
GtkWidget *Edit, *CdEdit;
void LoadConf()
{
FILE *f;
char cfg[256];
//sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME"));
strcpy(cfg, s_strIniPath);
f = fopen(cfg, "r");
if (f == NULL)
{
printf("Unable to load %s\n", cfg);
strcpy(IsoFile, DEV_DEF);
strcpy(CdDev, CDDEV_DEF);
BlockDump = 0;
SaveConf();
return;
}
fscanf(f, "IsoFile = %[^\n]\n", IsoFile);
fscanf(f, "CdDev = %[^\n]\n", CdDev);
fscanf(f, "BlockDump = %d\n", &BlockDump);
if (!strncmp(IsoFile, "CdDev =", 9)) *IsoFile = 0; // quick fix
if (*CdDev == 0) strcpy(CdDev, CDDEV_DEF);
fclose(f);
}
void SaveConf()
{
FILE *f;
char cfg[256];
//sprintf(cfg, "%s/.PS2E", getenv("HOME"));
//mkdir(cfg, 0755);
//sprintf(cfg, "%s/.PS2E/CDVDiso.cfg", getenv("HOME"));
strcpy(cfg, s_strIniPath);
f = fopen(cfg, "w");
if (f == NULL)
{
printf("Unable to save %s\n", cfg);
return;
}
fprintf(f, "IsoFile = %s\n", IsoFile);
fprintf(f, "CdDev = %s\n", CdDev);
fprintf(f, "BlockDump = %d\n", BlockDump);
fclose(f);
}
void SysMessage(char *fmt, ...)
{
va_list list;
char tmp[256];
char cmd[256];
va_start(list, fmt);
vsprintf(tmp, fmt, list);
va_end(list);
sprintf(cmd, "message \"%s\"", tmp);
SysMessageLoc(tmp);
}
void OnFile_Ok()
{
gchar *File;
gtk_widget_hide(FileSel);
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
strcpy(IsoFile, File);
gtk_main_quit();
}
void OnFile_Cancel()
{
gtk_widget_hide(FileSel);
gtk_main_quit();
}
void CfgOpenFile()
{
GtkWidget *Ok, *Cancel;
FileSel = gtk_file_selection_new("Select Iso File");
Ok = GTK_FILE_SELECTION(FileSel)->ok_button;
gtk_signal_connect(GTK_OBJECT(Ok), "clicked",
GTK_SIGNAL_FUNC(OnFile_Ok), NULL);
gtk_widget_show(Ok);
Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button;
gtk_signal_connect(GTK_OBJECT(Cancel), "clicked",
GTK_SIGNAL_FUNC(OnFile_Cancel), NULL);
gtk_widget_show(Cancel);
gtk_widget_show(FileSel);
gdk_window_raise(FileSel->window);
gtk_main();
SaveConf();
}
void OnMsg_Ok()
{
gtk_widget_destroy(MsgDlg);
gtk_main_quit();
}
void SysMessageLoc(char *fmt, ...)
{
GtkWidget *Ok, *Txt;
GtkWidget *Box, *Box1;
va_list list;
int w;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
w = strlen(msg) * 6 + 20;
MsgDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(MsgDlg, w, 70);
gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER);
gtk_window_set_title(GTK_WINDOW(MsgDlg), "cdriso Msg");
gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 0);
Box = gtk_vbox_new(0, 0);
gtk_container_add(GTK_CONTAINER(MsgDlg), Box);
gtk_widget_show(Box);
Txt = gtk_label_new(msg);
gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5);
gtk_widget_show(Txt);
Box1 = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0);
gtk_widget_show(Box1);
Ok = gtk_button_new_with_label("Ok");
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL);
gtk_container_add(GTK_CONTAINER(Box1), Ok);
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
gtk_widget_show(Ok);
gtk_widget_show(MsgDlg);
gtk_main();
}
void OnOk (GtkButton *button, gpointer user_data)
{
char *tmp;
stop = true;
tmp = gtk_entry_get_text(GTK_ENTRY(Edit));
strcpy(IsoFile, tmp);
tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit));
strcpy(CdDev, tmp);
if is_checked(ConfDlg, "checkBlockDump")
BlockDump = 1;
else
BlockDump = 0;
SaveConf();
gtk_widget_destroy(ConfDlg);
gtk_main_quit();
}
void OnCancel(GtkButton *button, gpointer user_data)
{
stop = true;
gtk_widget_destroy(ConfDlg);
gtk_main_quit();
}
void OnFileSel_Ok()
{
gchar *File;
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
gtk_entry_set_text(GTK_ENTRY(Edit), File);
gtk_widget_destroy(FileSel);
}
void OnFileSel_Cancel()
{
gtk_widget_destroy(FileSel);
}
void OnFileSel(GtkButton *button, gpointer user_data)
{
GtkWidget *Ok, *Cancel;
FileSel = gtk_file_selection_new("Select Psx Iso File");
gtk_file_selection_set_filename(GTK_FILE_SELECTION(FileSel), IsoFile);
Ok = GTK_FILE_SELECTION(FileSel)->ok_button;
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Ok), NULL);
gtk_widget_show(Ok);
Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button;
gtk_signal_connect(GTK_OBJECT(Cancel), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Cancel), NULL);
gtk_widget_show(Cancel);
gtk_widget_show(FileSel);
gdk_window_raise(FileSel->window);
}
EXPORT_C_(void) CDVDconfigure()
{
int i;
LoadConf();
ConfDlg = create_Config();
Edit = lookup_widget(ConfDlg, "GtkEntry_Iso");
gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile);
CdEdit = lookup_widget(ConfDlg, "GtkEntry_CdDev");
gtk_entry_set_text(GTK_ENTRY(CdEdit), CdDev);
Progress = lookup_widget(ConfDlg, "GtkProgressBar_Progress");
BtnCompress = lookup_widget(ConfDlg, "GtkButton_Compress");
BtnDecompress = lookup_widget(ConfDlg, "GtkButton_Decompress");
BtnCreate = lookup_widget(ConfDlg, "GtkButton_Create");
BtnCreateZ = lookup_widget(ConfDlg, "GtkButton_CreateZ");
methodlist = NULL;
for (i = 0; i < 2; i++)
methodlist = g_list_append(methodlist, methods[i]);
Method = lookup_widget(ConfDlg, "GtkCombo_Method");
gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist);
if (strstr(IsoFile, ".Z") != NULL)
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[0]);
else
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[1]);
set_checked(ConfDlg, "checkBlockDump", (BlockDump == 1));
gtk_widget_show_all(ConfDlg);
gtk_main();
return 0;
}
void OnAboutOk(GtkMenuItem * menuitem, gpointer userdata)
{
gtk_widget_hide(AboutDlg);
gtk_main_quit();
}
EXPORT_C_(void) CDVDabout()
{
GtkWidget *Label;
GtkWidget *Ok;
GtkWidget *Box, *BBox;
char AboutText[255];
sprintf(AboutText, "%s %d.%d\n", LibName, revision, build);
AboutDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(AboutDlg, 260, 80);
gtk_window_set_title(GTK_WINDOW(AboutDlg), "CDVD About Dialog");
gtk_window_set_position(GTK_WINDOW(AboutDlg), GTK_WIN_POS_CENTER);
gtk_container_set_border_width(GTK_CONTAINER(AboutDlg), 10);
Box = gtk_vbox_new(0, 0);
gtk_container_add(GTK_CONTAINER(AboutDlg), Box);
gtk_widget_show(Box);
Label = gtk_label_new(AboutText);
gtk_box_pack_start(GTK_BOX(Box), Label, FALSE, FALSE, 0);
gtk_widget_show(Label);
BBox = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(Box), BBox, FALSE, FALSE, 0);
gtk_widget_show(BBox);
Ok = gtk_button_new_with_label("Ok");
gtk_signal_connect(GTK_OBJECT(Ok), "clicked",
GTK_SIGNAL_FUNC(OnAboutOk), NULL);
gtk_container_add(GTK_CONTAINER(BBox), Ok);
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
gtk_widget_show(Ok);
gtk_widget_show(AboutDlg);
gtk_main();
}

View File

@ -16,5 +16,66 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
#include <zlib.h>
#include <bzlib.h>
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "support.h"
#include "callbacks.h"
#include "interface.h"
#ifdef __cplusplus
}
#endif
#include "CDVDiso.h"
void SaveConf();
void LoadConf();
extern void SysMessageLoc(char *fmt, ...);
extern char *LibName;
extern const unsigned char revision;
extern const unsigned char build;
extern GtkWidget *AboutDlg, *ConfDlg, *MsgDlg, *FileSel;
extern GtkWidget *Edit, *CdEdit;
extern bool stop;
extern GtkWidget *Method,*Progress;
extern GtkWidget *BtnCompress, *BtnDecompress;
extern GtkWidget *BtnCreate, *BtnCreateZ;
extern GList *methodlist;
// Make it easier to check and set checkmarks in the gui
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
extern void OnFileSel(GtkButton *button, gpointer user_data);
extern void OnStop(GtkButton *button, gpointer user_data);
extern void OnCompress(GtkButton *button, gpointer user_data);
extern void OnDecompress(GtkButton *button, gpointer user_data);
extern void OnCreate(GtkButton *button, gpointer user_data);
extern void OnCreateZ(GtkButton *button, gpointer user_data);
extern void OnOk(GtkButton *button, gpointer user_data);
extern void OnCancel(GtkButton *button, gpointer user_data);

View File

@ -1,108 +0,0 @@
/* CDVDiso
* Copyright (C) 2002-2004 CDVDiso Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "Config.h"
#include "CDVDiso.h"
void ExecCfg(char *arg)
{
char cfg[256];
struct stat buf;
strcpy(cfg, "./cfgCDVDiso");
if (stat(cfg, &buf) != -1)
{
sprintf(cfg, "%s %s", cfg, arg);
system(cfg);
return;
}
strcpy(cfg, "./plugins/cfgCDVDiso");
if (stat(cfg, &buf) != -1)
{
sprintf(cfg, "%s %s", cfg, arg);
system(cfg);
return;
}
strcpy(cfg, "./cfg/cfgCDVDiso");
if (stat(cfg, &buf) != -1)
{
sprintf(cfg, "%s %s", cfg, arg);
system(cfg);
return;
}
sprintf(cfg, "%s/cfgCDVDiso", getenv("HOME"));
if (stat(cfg, &buf) != -1)
{
sprintf(cfg, "%s %s", cfg, arg);
system(cfg);
return;
}
printf("cfgCDVDiso file not found!\n");
}
void CDVDconfigure()
{
char *file;
getcwd(file, ArraySize(file));
chdir("plugins");
ExecCfg("configure");
chdir(file);
}
void CDVDabout()
{
char *file;
getcwd(file, ArraySize(file));
chdir("plugins");
ExecCfg("about");
chdir(file);
}
void CfgOpenFile()
{
char *file;
getcwd(file, ArraySize(file));
chdir("plugins");
ExecCfg("open");
chdir(file);
}
void SysMessage(char *fmt, ...)
{
va_list list;
char tmp[256];
char cmd[256];
va_start(list, fmt);
vsprintf(tmp, fmt, list);
va_end(list);
sprintf(cmd, "message \"%s\"", tmp);
ExecCfg(cmd);
}

View File

@ -16,211 +16,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/cdrom.h>
#include <time.h>
#include <string.h>
#include <zlib.h>
#include <bzlib.h>
#include <gtk/gtk.h>
#include "interface.h"
#include "support.h"
#include "CDVDiso.h"
#include "Config.h"
// Make it easier to check and set checkmarks in the gui
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
unsigned char Zbuf[CD_FRAMESIZE_RAW * 10 * 2];
extern char *LibName;
extern const unsigned char revision;
extern const unsigned char build;
GtkWidget *FileSel;
void OnFile_Ok()
{
gchar *File;
gtk_widget_hide(FileSel);
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
strcpy(IsoFile, File);
gtk_main_quit();
}
void OnFile_Cancel()
{
gtk_widget_hide(FileSel);
gtk_main_quit();
}
void _CDRopen()
{
GtkWidget *Ok, *Cancel;
FileSel = gtk_file_selection_new("Select Iso File");
Ok = GTK_FILE_SELECTION(FileSel)->ok_button;
gtk_signal_connect(GTK_OBJECT(Ok), "clicked",
GTK_SIGNAL_FUNC(OnFile_Ok), NULL);
gtk_widget_show(Ok);
Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button;
gtk_signal_connect(GTK_OBJECT(Cancel), "clicked",
GTK_SIGNAL_FUNC(OnFile_Cancel), NULL);
gtk_widget_show(Cancel);
gtk_widget_show(FileSel);
gdk_window_raise(FileSel->window);
gtk_main();
SaveConf();
}
GtkWidget *MsgDlg;
void OnMsg_Ok()
{
gtk_widget_destroy(MsgDlg);
gtk_main_quit();
}
static void SysMessageLoc(char *fmt, ...)
{
GtkWidget *Ok, *Txt;
GtkWidget *Box, *Box1;
va_list list;
int w;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
w = strlen(msg) * 6 + 20;
MsgDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(MsgDlg, w, 70);
gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER);
gtk_window_set_title(GTK_WINDOW(MsgDlg), "cdriso Msg");
gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 0);
Box = gtk_vbox_new(0, 0);
gtk_container_add(GTK_CONTAINER(MsgDlg), Box);
gtk_widget_show(Box);
Txt = gtk_label_new(msg);
gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5);
gtk_widget_show(Txt);
Box1 = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0);
gtk_widget_show(Box1);
Ok = gtk_button_new_with_label("Ok");
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL);
gtk_container_add(GTK_CONTAINER(Box1), Ok);
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
gtk_widget_show(Ok);
gtk_widget_show(MsgDlg);
gtk_main();
}
GtkWidget *ConfDlg;
GtkWidget *Edit, *CdEdit;
GtkWidget *FileSel;
GtkWidget *Progress;
GtkWidget *BtnCompress;
GtkWidget *BtnDecompress;
GtkWidget *BtnCreate;
GtkWidget *BtnCreateZ;
GtkWidget *Method;
GtkWidget *Method,*Progress;
GtkWidget *BtnCompress, *BtnDecompress;
GtkWidget *BtnCreate, *BtnCreateZ;
GList *methodlist;
extern char *methods[];
unsigned char param[4];
int cddev = -1;
bool stop;
int stop;
#define CD_LEADOUT (0xaa)
void OnOk(GtkMenuItem * menuitem, gpointer userdata)
union
{
char *tmp;
struct cdrom_msf msf;
unsigned char buf[CD_FRAMESIZE_RAW];
} cr;
stop = 1;
tmp = gtk_entry_get_text(GTK_ENTRY(Edit));
strcpy(IsoFile, tmp);
tmp = gtk_entry_get_text(GTK_ENTRY(CdEdit));
strcpy(CdDev, tmp);
if is_checked(ConfDlg, "checkBlockDump")
BlockDump = 1;
else
BlockDump = 0;
SaveConf();
gtk_widget_destroy(ConfDlg);
gtk_main_quit();
}
void OnCancel(GtkMenuItem * menuitem, gpointer userdata)
void OnStop(GtkButton *button, gpointer user_data)
{
stop = 1;
gtk_widget_destroy(ConfDlg);
gtk_main_quit();
}
void OnFileSel_Ok()
{
gchar *File;
File = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
gtk_entry_set_text(GTK_ENTRY(Edit), File);
gtk_widget_destroy(FileSel);
}
void OnFileSel_Cancel()
{
gtk_widget_destroy(FileSel);
}
void OnFileSel()
{
GtkWidget *Ok, *Cancel;
FileSel = gtk_file_selection_new("Select Psx Iso File");
gtk_file_selection_set_filename(GTK_FILE_SELECTION(FileSel), IsoFile);
Ok = GTK_FILE_SELECTION(FileSel)->ok_button;
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Ok), NULL);
gtk_widget_show(Ok);
Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button;
gtk_signal_connect(GTK_OBJECT(Cancel), "clicked", GTK_SIGNAL_FUNC(OnFileSel_Cancel), NULL);
gtk_widget_show(Cancel);
gtk_widget_show(FileSel);
gdk_window_raise(FileSel->window);
}
void OnStop()
{
stop = 1;
stop = true;
}
void UpdZmode()
@ -234,7 +54,7 @@ void UpdZmode()
char buffer[2352 * 10];
void OnCompress()
void OnCompress(GtkButton *button, gpointer user_data)
{
struct stat buf;
u32 lsn;
@ -271,7 +91,7 @@ void OnCompress()
gtk_widget_set_sensitive(BtnDecompress, FALSE);
gtk_widget_set_sensitive(BtnCreate, FALSE);
gtk_widget_set_sensitive(BtnCreateZ, FALSE);
stop = 0;
stop = false;
for (lsn = 0; lsn < src->blocks; lsn++)
{
@ -310,7 +130,7 @@ void OnCompress()
}
}
void OnDecompress()
void OnDecompress(GtkButton *button, gpointer user_data)
{
#if 0
struct stat buf;
@ -366,7 +186,7 @@ void OnDecompress()
gtk_widget_set_sensitive(BtnDecompress, FALSE);
gtk_widget_set_sensitive(BtnCreate, FALSE);
gtk_widget_set_sensitive(BtnCreateZ, FALSE);
stop = 0;
stop = false;
if (Zmode == 1)
{
@ -433,16 +253,6 @@ void OnDecompress()
#endif
}
#define CD_LEADOUT (0xaa)
unsigned char param[4];
int cddev = -1;
union
{
struct cdrom_msf msf;
unsigned char buf[CD_FRAMESIZE_RAW];
} cr;
void incSector()
{
param[2]++;
@ -535,7 +345,7 @@ char *CDR_readTrack(unsigned char *time)
}
void OnCreate()
void OnCreate(GtkButton *button, gpointer user_data)
{
FILE *f;
struct stat buf;
@ -600,7 +410,7 @@ void OnCreate()
time(&Ttime);
stop = 0;
stop = false;
s = MSF2SECT(end[0], end[1], end[2]);
gtk_widget_set_sensitive(BtnCompress, FALSE);
gtk_widget_set_sensitive(BtnDecompress, FALSE);
@ -672,7 +482,7 @@ void OnCreate()
if (!stop) SysMessageLoc("Iso Image Created OK");
}
void OnCreateZ()
void OnCreateZ(GtkButton *button, gpointer user_data)
{
FILE *f;
FILE *t;
@ -758,7 +568,7 @@ void OnCreateZ()
time(&Ttime);
stop = 0;
stop = false;
s = MSF2SECT(end[0], end[1], end[2]) / blocks;
gtk_widget_set_sensitive(BtnCompress, FALSE);
gtk_widget_set_sensitive(BtnDecompress, FALSE);
@ -857,110 +667,3 @@ void OnCreateZ()
if (!stop) SysMessageLoc("Compressed Iso Image Created OK");
}
long CDRconfigure(void)
{
int i;
LoadConf();
ConfDlg = create_Config();
Edit = lookup_widget(ConfDlg, "GtkEntry_Iso");
gtk_entry_set_text(GTK_ENTRY(Edit), IsoFile);
CdEdit = lookup_widget(ConfDlg, "GtkEntry_CdDev");
gtk_entry_set_text(GTK_ENTRY(CdEdit), CdDev);
Progress = lookup_widget(ConfDlg, "GtkProgressBar_Progress");
BtnCompress = lookup_widget(ConfDlg, "GtkButton_Compress");
BtnDecompress = lookup_widget(ConfDlg, "GtkButton_Decompress");
BtnCreate = lookup_widget(ConfDlg, "GtkButton_Create");
BtnCreateZ = lookup_widget(ConfDlg, "GtkButton_CreateZ");
methodlist = NULL;
for (i = 0; i < 2; i++)
methodlist = g_list_append(methodlist, methods[i]);
Method = lookup_widget(ConfDlg, "GtkCombo_Method");
gtk_combo_set_popdown_strings(GTK_COMBO(Method), methodlist);
if (strstr(IsoFile, ".Z") != NULL)
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[0]);
else
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(Method)->entry), methods[1]);
set_checked(ConfDlg, "checkBlockDump", (BlockDump == 1));
gtk_widget_show_all(ConfDlg);
gtk_main();
return 0;
}
GtkWidget *AboutDlg;
void OnAboutOk(GtkMenuItem * menuitem, gpointer userdata)
{
gtk_widget_hide(AboutDlg);
gtk_main_quit();
}
void CDRabout(void)
{
GtkWidget *Label;
GtkWidget *Ok;
GtkWidget *Box, *BBox;
char AboutText[255];
sprintf(AboutText, "%s %d.%d\n", LibName, revision, build);
AboutDlg = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(AboutDlg, 260, 80);
gtk_window_set_title(GTK_WINDOW(AboutDlg), "CDVD About Dialog");
gtk_window_set_position(GTK_WINDOW(AboutDlg), GTK_WIN_POS_CENTER);
gtk_container_set_border_width(GTK_CONTAINER(AboutDlg), 10);
Box = gtk_vbox_new(0, 0);
gtk_container_add(GTK_CONTAINER(AboutDlg), Box);
gtk_widget_show(Box);
Label = gtk_label_new(AboutText);
gtk_box_pack_start(GTK_BOX(Box), Label, FALSE, FALSE, 0);
gtk_widget_show(Label);
BBox = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(Box), BBox, FALSE, FALSE, 0);
gtk_widget_show(BBox);
Ok = gtk_button_new_with_label("Ok");
gtk_signal_connect(GTK_OBJECT(Ok), "clicked",
GTK_SIGNAL_FUNC(OnAboutOk), NULL);
gtk_container_add(GTK_CONTAINER(BBox), Ok);
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
gtk_widget_show(Ok);
gtk_widget_show(AboutDlg);
gtk_main();
}
int main(int argc, char *argv[])
{
if (argc < 2) return 0;
gtk_init(NULL, NULL);
if (!strcmp(argv[1], "open"))
_CDRopen();
else if (!strcmp(argv[1], "configure"))
CDRconfigure();
else if (!strcmp(argv[1], "message"))
{
if (argc > 2) SysMessageLoc(argv[2]);
}
else
CDRabout();
return 0;
}

View File

@ -57,43 +57,53 @@ create_Config (void)
GtkWidget *button2;
Config = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (Config, "Config");
gtk_container_set_border_width (GTK_CONTAINER (Config), 5);
gtk_window_set_title (GTK_WINDOW (Config), _("CDVD Config Dialog"));
vbox1 = gtk_vbox_new (FALSE, 5);
gtk_widget_set_name (vbox1, "vbox1");
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (Config), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
hbox1 = gtk_hbox_new (FALSE, 10);
gtk_widget_set_name (hbox1, "hbox1");
gtk_widget_show (hbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
GtkEntry_Iso = gtk_entry_new ();
gtk_widget_set_name (GtkEntry_Iso, "GtkEntry_Iso");
gtk_widget_show (GtkEntry_Iso);
gtk_box_pack_start (GTK_BOX (hbox1), GtkEntry_Iso, TRUE, TRUE, 0);
button5 = gtk_button_new_with_mnemonic (_("Select Iso"));
gtk_widget_set_name (button5, "button5");
gtk_widget_show (button5);
gtk_box_pack_start (GTK_BOX (hbox1), button5, FALSE, FALSE, 0);
hbox2 = gtk_hbox_new (FALSE, 10);
gtk_widget_set_name (hbox2, "hbox2");
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, FALSE, 0);
GtkProgressBar_Progress = gtk_progress_bar_new ();
gtk_widget_set_name (GtkProgressBar_Progress, "GtkProgressBar_Progress");
gtk_widget_show (GtkProgressBar_Progress);
gtk_box_pack_start (GTK_BOX (hbox2), GtkProgressBar_Progress, TRUE, FALSE, 0);
button6 = gtk_button_new_with_mnemonic (_("Stop"));
gtk_widget_set_name (button6, "button6");
gtk_widget_show (button6);
gtk_box_pack_end (GTK_BOX (hbox2), button6, FALSE, FALSE, 0);
hbox4 = gtk_hbox_new (FALSE, 5);
gtk_widget_set_name (hbox4, "hbox4");
gtk_widget_show (hbox4);
gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0);
label2 = gtk_label_new (_("Compression Method:"));
gtk_widget_set_name (label2, "label2");
gtk_widget_show (label2);
gtk_box_pack_start (GTK_BOX (hbox4), label2, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
@ -101,6 +111,7 @@ create_Config (void)
GtkCombo_Method = gtk_combo_new ();
g_object_set_data (G_OBJECT (GTK_COMBO (GtkCombo_Method)->popwin),
"GladeParentKey", GtkCombo_Method);
gtk_widget_set_name (GtkCombo_Method, "GtkCombo_Method");
gtk_widget_show (GtkCombo_Method);
gtk_box_pack_start (GTK_BOX (hbox4), GtkCombo_Method, TRUE, FALSE, 0);
GtkCombo_Method_items = g_list_append (GtkCombo_Method_items, (gpointer) "");
@ -108,63 +119,77 @@ create_Config (void)
g_list_free (GtkCombo_Method_items);
combo_entry1 = GTK_COMBO (GtkCombo_Method)->entry;
gtk_widget_set_name (combo_entry1, "combo_entry1");
gtk_widget_show (combo_entry1);
hbuttonbox2 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox2, "hbuttonbox2");
gtk_widget_show (hbuttonbox2);
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox2, TRUE, TRUE, 0);
GtkButton_Compress = gtk_button_new_with_mnemonic (_("Compress Iso"));
gtk_widget_set_name (GtkButton_Compress, "GtkButton_Compress");
gtk_widget_show (GtkButton_Compress);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Compress);
GTK_WIDGET_SET_FLAGS (GtkButton_Compress, GTK_CAN_DEFAULT);
GtkButton_Decompress = gtk_button_new_with_mnemonic (_("Decompress Iso"));
gtk_widget_set_name (GtkButton_Decompress, "GtkButton_Decompress");
gtk_widget_show (GtkButton_Decompress);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), GtkButton_Decompress);
GTK_WIDGET_SET_FLAGS (GtkButton_Decompress, GTK_CAN_DEFAULT);
hbox3 = gtk_hbox_new (FALSE, 5);
gtk_widget_set_name (hbox3, "hbox3");
gtk_widget_show (hbox3);
gtk_box_pack_start (GTK_BOX (vbox1), hbox3, FALSE, FALSE, 0);
label1 = gtk_label_new (_("Cdrom Device: "));
gtk_widget_set_name (label1, "label1");
gtk_widget_show (label1);
gtk_box_pack_start (GTK_BOX (hbox3), label1, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
GtkEntry_CdDev = gtk_entry_new ();
gtk_widget_set_name (GtkEntry_CdDev, "GtkEntry_CdDev");
gtk_widget_show (GtkEntry_CdDev);
gtk_box_pack_start (GTK_BOX (hbox3), GtkEntry_CdDev, TRUE, TRUE, 0);
hbuttonbox3 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox3, "hbuttonbox3");
gtk_widget_show (hbuttonbox3);
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox3, TRUE, TRUE, 0);
GtkButton_Create = gtk_button_new_with_mnemonic (_("Create Iso"));
gtk_widget_set_name (GtkButton_Create, "GtkButton_Create");
gtk_widget_show (GtkButton_Create);
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_Create);
GTK_WIDGET_SET_FLAGS (GtkButton_Create, GTK_CAN_DEFAULT);
GtkButton_CreateZ = gtk_button_new_with_mnemonic (_("Create Compressed Iso"));
gtk_widget_set_name (GtkButton_CreateZ, "GtkButton_CreateZ");
gtk_widget_show (GtkButton_CreateZ);
gtk_container_add (GTK_CONTAINER (hbuttonbox3), GtkButton_CreateZ);
GTK_WIDGET_SET_FLAGS (GtkButton_CreateZ, GTK_CAN_DEFAULT);
checkBlockDump = gtk_check_button_new_with_mnemonic (_("Create a dump of the running iso"));
gtk_widget_set_name (checkBlockDump, "checkBlockDump");
gtk_widget_show (checkBlockDump);
gtk_box_pack_start (GTK_BOX (vbox1), checkBlockDump, FALSE, FALSE, 0);
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
button1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_set_name (button1, "button1");
gtk_widget_show (button1);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button1);
GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
button2 = gtk_button_new_from_stock ("gtk-cancel");
gtk_widget_set_name (button2, "button2");
gtk_widget_show (button2);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);

31
plugins/CDVDiso/src/Makefile.am Executable file
View File

@ -0,0 +1,31 @@
# Create a shared library libCDVDiso
AUTOMAKE_OPTIONS = foreign
noinst_LIBRARIES = libCDVDiso.a
INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../../../common/include -I@srcdir@/../../../3rdparty -I@srcdir@/Linux -I../../../../3rdparty/zlib
# Create a shared object by faking an exe (thanks to ODE makefiles)
traplibdir=$(prefix)
if DEBUGBUILD
preext=d
endif
EXEEXT=$(preext)@so_ext@
traplib_PROGRAMS=libCDVDiso
libCDVDiso_SOURCES=
libCDVDiso_DEPENDENCIES = libCDVDiso.a
libCDVDiso_LDFLAGS= @SHARED_LDFLAGS@
libCDVDiso_LDFLAGS+=-Wl,-soname,@libCDVDiso_SONAME@
libCDVDiso_LDADD=$(libCDVDiso_a_OBJECTS)
libCDVDiso_a_SOURCES = CDVDisop.cpp CDVDiso.h libiso.cpp libiso.h mkiso/mkiso.cpp
libCDVDiso_a_SOURCES += \
Linux/Config.cpp Linux/Config.h Linux/Linux.cpp \
Linux/interface.h Linux/support.c \
Linux/interface.c Linux/support.h \
Linux/callbacks.h
#Linux/callbacks.c
#SUBDIRS = Linux

View File

@ -265,7 +265,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\CDVDisop.c"
RelativePath="..\CDVDisop.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@ -293,7 +293,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\Config.c"
RelativePath=".\Config.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@ -321,7 +321,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\libiso.c"
RelativePath="..\libiso.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@ -349,7 +349,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\Win32.c"
RelativePath=".\Win32.cpp"
>
<FileConfiguration
Name="Debug|Win32"

View File

@ -354,7 +354,7 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
EXPORT_C(void) CDVDconfigure()
EXPORT_C_(void) CDVDconfigure()
{
DialogBox(hInst,
MAKEINTRESOURCE(IDD_CONFIG),
@ -380,7 +380,7 @@ BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
EXPORT_C(void) CDVDabout()
EXPORT_C_(void) CDVDabout()
{
DialogBox(hInst,
MAKEINTRESOURCE(IDD_ABOUT),

View File

@ -0,0 +1,18 @@
// svnrev_template.h --> svnrev.h
//
// This file acts as a template for the automatic SVN revision/version tag.
// It is used by the utility SubWCrev.exe to create an "svnrev.h" file for
// whichever project is being compiled (as indicated by command line options
// passed to SubWCRev.exe during the project's pre-build step).
//
// The SubWCRev.exe utility is part of TortoiseSVN and requires several DLLs
// installed by TortoiseSVN, so it will only be available if you have TortoiseSVN
// installed on your system. If you do not have it installed, a generic template
// is used instead (see svnrev_generic.h). Having TortoiseSVN is handy but not
// necessary. If you do not have it installed, everything will still compile
// fine except without the SVN revision tagged to the application/dll version.
//
// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org
#define SVN_REV 798
#define SVN_MODS 1

View File

@ -0,0 +1,83 @@
AC_INIT(CDVDiso, 0.9,arcum42@gmail.com)
AM_INIT_AUTOMAKE(CDVDiso,0.9)
AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CPP([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl necessary for compiling assembly
AM_PROG_AS
AC_SUBST(CDVDiso_CURRENT, 0)
AC_SUBST(CDVDiso_REVISION, 9)
AC_SUBST(CDVDiso_AGE, 0)
AC_SUBST(CDVDiso_RELEASE,[$CDVDiso_CURRENT].[$CDVDiso_REVISION].[$CDVDiso_AGE])
AC_SUBST(CDVDiso_SONAME,libCDVDiso.so.[$CDVDiso_CURRENT].[$CDVDiso_REVISION].[$CDVDiso_AGE])
CFLAGS=
CPPFLAGS=
CXXFLAGS=
dnl Check for debug build
AC_MSG_CHECKING(debug build)
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [debug build]),
debug=$enableval,debug=no)
if test "x$debug" == xyes
then
AC_DEFINE(_DEBUG,1,[_DEBUG])
CFLAGS+=" -g -fPIC -Wall -Wno-unused-value "
CPPFLAGS+=" -g -fPIC -Wall -Wno-unused-value "
CXXFLAGS+=" -g -fPIC -Wall -Wno-unused-value -fpermissive "
else
AC_DEFINE(NDEBUG,1,[NDEBUG])
CFLAGS+=" -O3 -fomit-frame-pointer -fPIC -Wno-unused-value "
CPPFLAGS+=" -O3 -fomit-frame-pointer -fPIC -Wno-unused-value "
CXXFLAGS+=" -O3 -fomit-frame-pointer -fPIC -Wno-unused-value -fpermissive "
fi
AM_CONDITIONAL(DEBUGBUILD, test x$debug = xyes)
AC_MSG_RESULT($debug)
AC_DEFINE(__LINUX__,1,[__LINUX__])
AC_DEFINE(_FILE_OFFSET_BITS,64,[_FILE_OFFSET_BITS])
dnl Check for dev build
AC_MSG_CHECKING(for development build...)
AC_ARG_ENABLE(devbuild, AC_HELP_STRING([--enable-devbuild], [Special Build for developers that simplifies testing and adds extra checks]),
devbuild=$enableval,devbuild=no)
if test "x$devbuild" == xyes
then
AC_DEFINE(CDVDiso_DEVBUILD,1,[CDVDiso_DEVBUILD])
fi
AC_MSG_RESULT($devbuild)
AM_CONDITIONAL(RELEASE_TO_PUBLIC, test x$devbuild = xno)
AC_CHECK_FUNCS([ _aligned_malloc _aligned_free ], AC_DEFINE(HAVE_ALIGNED_MALLOC))
dnl gtk
AC_MSG_CHECKING(gtk2+)
AC_CHECK_PROG(GTK_CONFIG, pkg-config, pkg-config)
LIBS+=$(pkg-config --libs gtk+-2.0)
dnl bindir = pcsx2exe
dnl assuming linux environment
so_ext=".so.$CDVDiso_RELEASE"
SHARED_LDFLAGS="-shared"
AC_SUBST(so_ext)
AC_SUBST(SHARED_LDFLAGS)
AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"])
AC_CHECK_LIB(bz2,main,[LIBS="$LIBS -lbz2"])
AC_OUTPUT([
Makefile
])
echo "Configuration:"
echo " Debug build? $debug"
echo " Dev build? $devbuild"

519
plugins/CDVDiso/src/install-sh Executable file
View File

@ -0,0 +1,519 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

367
plugins/CDVDiso/src/missing Executable file
View File

@ -0,0 +1,367 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -1,27 +0,0 @@
CC = gcc
MKISO = mkiso
CFLAGS = -fPIC -Wall -O2 -fomit-frame-pointer -I.. -I. -D__LINUX__ -I../../../../3rdparty/zlib -D_FILE_OFFSET_BITS=64
OBJS = mkiso.o ../libiso.o
LIBS =
OBJS+= ../../../../3rdparty/zlib/adler32.o ../../../../3rdparty/zlib/compress.o ../../../../3rdparty/zlib/crc32.o ../../../../3rdparty/zlib/gzio.o \
../../../../3rdparty/zlib/uncompr.o ../../../../3rdparty/zlib/deflate.o ../../../../3rdparty/zlib/trees.o ../../../../3rdparty/zlib/zutil.o \
../../../../3rdparty/zlib/inflate.o ../../../../3rdparty/zlib/infback.o ../../../../3rdparty/zlib/inftrees.o ../../../../3rdparty/zlib/inffast.o
DEPS:= $(OBJS:.o=.d)
all: mkiso
mkiso: ${OBJS}
rm -f ${MKISO}
${CC} ${CFLAGS} ${OBJS} -o ${MKISO} ${LIBS}
strip ${MKISO}
clean:
rm -f ${OBJS} ${DEPS} ${MKISO}
%.o: %.c
${CC} ${CFLAGS} -c -o $@ $< -MD -MF $(patsubst %.o,%.d,$@)
-include ${DEPS}

View File

@ -20,6 +20,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "string.h"
#include "CDVDiso.h"
@ -150,7 +151,7 @@ void Decompress(char *filename)
}
int main(int argc, char *argv[])
/*int main(int argc, char *argv[])
{
if (argc < 3) return 0;
@ -169,4 +170,4 @@ int main(int argc, char *argv[])
}
return 0;
}
}*/