summaryrefslogtreecommitdiff
path: root/coders/ghostscript-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'coders/ghostscript-private.h')
-rw-r--r--coders/ghostscript-private.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/coders/ghostscript-private.h b/coders/ghostscript-private.h
index 0bb14218c..66eff852b 100644
--- a/coders/ghostscript-private.h
+++ b/coders/ghostscript-private.h
@@ -58,6 +58,24 @@ static double GhostscriptVersion(const GhostInfo *ghost_info)
}
#endif
+static inline MagickBooleanType ExecuteGhostscriptCommand(
+ const MagickBooleanType verbose,const char *command,char *message,
+ ExceptionInfo *exception)
+{
+ int
+ status;
+
+ status=ExternalDelegateCommand(MagickFalse,verbose,command,message,
+ exception);
+ if (status == 0)
+ return(MagickTrue);
+ if (status < 0)
+ return(MagickFalse);
+ (void) ThrowMagickException(exception,GetMagickModule(),DelegateError,
+ "FailedToExecuteCommand","`%s' (%d)",command,status);
+ return(MagickFalse);
+}
+
static inline MagickBooleanType InvokeGhostscriptDelegate(
const MagickBooleanType verbose,const char *command,char *message,
ExceptionInfo *exception)
@@ -79,19 +97,6 @@ static inline MagickBooleanType InvokeGhostscriptDelegate(
} \
}
-#define ExecuteGhostscriptCommand(command,status) \
-{ \
- status=ExternalDelegateCommand(MagickFalse,verbose,command,message, \
- exception); \
- if (status == 0) \
- return(MagickTrue); \
- if (status < 0) \
- return(MagickFalse); \
- (void) ThrowMagickException(exception,GetMagickModule(),DelegateError, \
- "FailedToExecuteCommand","`%s' (%d)",command,status); \
- return(MagickFalse); \
-}
-
char
**argv,
*errors;
@@ -135,7 +140,7 @@ static inline MagickBooleanType InvokeGhostscriptDelegate(
ghost_info_struct.revision=(int (*)(gsapi_revision_t *,int)) gsapi_revision;
#endif
if (ghost_info == (GhostInfo *) NULL)
- ExecuteGhostscriptCommand(command,status);
+ return(ExecuteGhostscriptCommand(verbose,command,message,exception));
if (verbose != MagickFalse)
{
(void) fprintf(stdout,"[ghostscript library %.2f]",
@@ -147,7 +152,7 @@ static inline MagickBooleanType InvokeGhostscriptDelegate(
errors=(char *) NULL;
status=(ghost_info->new_instance)(&interpreter,(void *) &errors);
if (status < 0)
- ExecuteGhostscriptCommand(command,status);
+ return(ExecuteGhostscriptCommand(verbose,command,message,exception));
code=0;
argv=StringToArgv(command,&argc);
if (argv == (char **) NULL)