summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-16 19:45:26 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-16 19:45:26 +0000
commitabb4bd4b3a8838bdca16cd849a4cf0640c6b96db (patch)
tree772e9ad9b9ec5769ad69b75d6835d727b5d289e1
parentc11c92cf71e0cfcfdcf3428a76b9e792e2f209c8 (diff)
src/rmd_types.h: Add a rescue_path member to ProgArgs.
src/rmd_initialize_data.c: Initialize rescue_path. src/rmd_parseargs.c: Don't rmdRescue() in ParseArgs(). We want the parse args functionality to be free from depdenencies. ParseArgs() should only parse args. Instead set the new rescue_path ProgArgs member. src/rmd.c: If a rescue_path was given, call rmdRescue() with that path. By doing this rmd_parseargs.c becomes more self-contained. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@553 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/src/rmd.c10
-rw-r--r--recordmydesktop/src/rmd_initialize_data.c1
-rw-r--r--recordmydesktop/src/rmd_parseargs.c4
-rw-r--r--recordmydesktop/src/rmd_types.h1
4 files changed, 10 insertions, 6 deletions
diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c
index bb513a2..98b3862 100644
--- a/recordmydesktop/src/rmd.c
+++ b/recordmydesktop/src/rmd.c
@@ -28,15 +28,16 @@
#include "rmd_types.h"
+#include "rmd_cache.h"
#include "rmd_encode_cache.h"
+#include "rmd_error.h"
#include "rmd_initialize_data.h"
#include "rmd_parseargs.h"
#include "rmd_queryextensions.h"
-#include "rmd_cache.h"
-#include "rmd_error.h"
-#include "rmd_threads.h"
+#include "rmd_rescue.h"
#include "rmd_setbrwindow.h"
#include "rmd_shortcuts.h"
+#include "rmd_threads.h"
#include "rmd_wm_check.h"
@@ -49,6 +50,9 @@ int main(int argc,char **argv){
if (!ParseArgs(argc, argv, &pdata.args)) {
exit(1);
}
+ if (pdata.args.rescue_path != NULL) {
+ exit(rmdRescue(pdata.args.rescue_path));
+ }
if(XInitThreads ()==0){
fprintf(stderr,"Couldn't initialize thread support!\n");
exit(7);
diff --git a/recordmydesktop/src/rmd_initialize_data.c b/recordmydesktop/src/rmd_initialize_data.c
index 631e725..5ec8bc3 100644
--- a/recordmydesktop/src/rmd_initialize_data.c
+++ b/recordmydesktop/src/rmd_initialize_data.c
@@ -199,6 +199,7 @@ void SetupDefaultArgs(ProgArgs *args) {
args->y = 0;
args->width = 0;
args->height = 0;
+ args->rescue_path = NULL;
args->nosound = 0;
args->full_shots = 0;
args->follow_mouse = 0;
diff --git a/recordmydesktop/src/rmd_parseargs.c b/recordmydesktop/src/rmd_parseargs.c
index 4fa1eac..ab1f4f7 100644
--- a/recordmydesktop/src/rmd_parseargs.c
+++ b/recordmydesktop/src/rmd_parseargs.c
@@ -29,7 +29,6 @@
#include "rmd_types.h"
#include "rmd_macro.h"
-#include "rmd_rescue.h"
static void PrintConfig(void) {
@@ -524,8 +523,7 @@ boolean ParseArgs(int argc, char **argv, ProgArgs *arg_return) {
}
else if(!strcmp(argv[i],"-rescue")){
if(i+1<argc){
- int ex_st=rmdRescue(argv[i+1]);
- exit(ex_st);
+ arg_return->rescue_path = argv[i + 1];
}
else{
fprintf(stderr,"Argument Usage: -rescue path_to_data\n");
diff --git a/recordmydesktop/src/rmd_types.h b/recordmydesktop/src/rmd_types.h
index 4cd9548..c93b8b7 100644
--- a/recordmydesktop/src/rmd_types.h
+++ b/recordmydesktop/src/rmd_types.h
@@ -129,6 +129,7 @@ typedef struct _ProgArgs{
#else
u_int32_t buffsize;
#endif
+ const char* rescue_path;
int nosound; //do not record sound(default 0)
int noshared; //do not use shared memory extension(default 0)
int nowmcheck; //do not check if there's a 3d comp window manager
© All Rights Reserved