diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-12-28 20:24:50 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-12-28 20:24:50 +0100 |
commit | 09795a01ef859f072920de9df974d1b03b9ab9a4 (patch) | |
tree | 4d05907fc37f1bd781e506f5e196f7435aeec0ab /app/bin/macro.c | |
parent | 5b4163d8c76b03f0d31b09866aa4bd06b4d8d804 (diff) |
New upstream version 4.2.4aupstream/4.2.4a
Diffstat (limited to 'app/bin/macro.c')
-rw-r--r-- | app/bin/macro.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/app/bin/macro.c b/app/bin/macro.c index 88ee928..2147eff 100644 --- a/app/bin/macro.c +++ b/app/bin/macro.c @@ -1,5 +1,5 @@ -/* - * $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/bin/macro.c,v 1.7 2009-06-15 19:29:57 m_fischer Exp $ +/** \file macro.c + * Macros */ /* XTrkCad - Model Railroad CAD @@ -154,15 +154,17 @@ EXPORT void RecordMouse( char * name, wAction_t action, POS_T px, POS_T py ) } -static int StartRecord( const char * pathName, const char * fileName, void * context ) +static int StartRecord( int cnt, char ** pathName, void * context ) { time_t clock; - if (pathName == NULL) - return TRUE; - SetCurDir( pathName, fileName ); - recordF = fopen(pathName, "w"); + + assert( pathName != NULL ); + assert( cnt == 1 ); + + SetCurrentPath( MACROPATHKEY, pathName[0] ); + recordF = fopen(pathName[0], "w"); if (recordF==NULL) { - NoticeMessage( MSG_OPEN_FAIL, _("Continue"), NULL, _("Recording"), fileName, strerror(errno) ); + NoticeMessage( MSG_OPEN_FAIL, _("Continue"), NULL, _("Recording"), pathName[0], strerror(errno) ); return FALSE; } time(&clock); @@ -484,7 +486,7 @@ static void PlaybackCursor( case C_REDRAW: MacroDrawBitMap( playbackD, playbackBm, playbackX, playbackY, playbackColor ); break; - + default: ; } @@ -1027,7 +1029,7 @@ static void Playback( void ) continue; snapshot_d.dpi=snapshot_d.scale=snapshot_d.orig.x=snapshot_d.orig.y=snapshot_d.size.x=snapshot_d.size.y=-1; cp = paramLine+8; - while (*cp && isspace(*cp)) cp++; + while (*cp && isspace((unsigned char)*cp)) cp++; if (snapshot_d.dpi = strtod( cp, &cq ), cp == cq) snapshot_d.dpi = -1; else if (snapshot_d.scale = strtod( cq, &cp ), cp == cq) @@ -1141,19 +1143,19 @@ static void Playback( void ) } -static int StartPlayback( const char * pathName, const char * fileName, void * context ) +static int StartPlayback( int cnt, char **pathName, void * context ) { - if (pathName == NULL) - return TRUE; + assert( pathName != NULL ); + assert( cnt ==1 ); - SetCurDir( pathName, fileName ); - paramFile = fopen( pathName, "r" ); + SetCurrentPath( MACROPATHKEY, pathName[0] ); + paramFile = fopen( pathName[0], "r" ); if ( paramFile == NULL ) { - NoticeMessage( MSG_OPEN_FAIL, _("Continue"), NULL, _("Playback"), pathName, strerror(errno) ); + NoticeMessage( MSG_OPEN_FAIL, _("Continue"), NULL, _("Playback"), pathName[0], strerror(errno) ); return FALSE; } - strcpy( paramFileName, pathName ); + strcpy( paramFileName, pathName[0] ); PlaybackSetup(); curDemo = -1; @@ -1352,7 +1354,7 @@ static void DemoInitValues( void ) for ( cpp = demoInitParams; *cpp; cpp++ ) paramPlaybackProc( *cpp ); } - + static void DoDemo( void * demoNumber ) { |