mirror of https://github.com/GNOME/gimp.git
removed search_in_path() and the unused xstrsep().
2001-05-16 Michael Natterer <mitch@gimp.org> * app/general.[ch]: removed search_in_path() and the unused xstrsep(). * app/plug_in.c: added plug_in_search_in_path(), don't include "general.h". * app/gimprc.c * app/image_render.c * app/gui/convert-dialog.c * app/gui/palette-editor.c * app/gui/paths-dialog.c * app/pdb/paths_cmds.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppainttool.c * app/tools/gimppenciltool.c * app/tools/gimpperspectivetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * tools/pdbgen/pdb/paths.pdb: removed useless includes.
This commit is contained in:
parent
80c93edf16
commit
7dacaa1ddb
34
ChangeLog
34
ChangeLog
|
@ -1,3 +1,37 @@
|
|||
2001-05-16 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/general.[ch]: removed search_in_path() and the unused
|
||||
xstrsep().
|
||||
|
||||
* app/plug_in.c: added plug_in_search_in_path(), don't include
|
||||
"general.h".
|
||||
|
||||
* app/gimprc.c
|
||||
* app/image_render.c
|
||||
* app/gui/convert-dialog.c
|
||||
* app/gui/palette-editor.c
|
||||
* app/gui/paths-dialog.c
|
||||
* app/pdb/paths_cmds.c
|
||||
* app/tools/gimpairbrushtool.c
|
||||
* app/tools/gimpbezierselecttool.c
|
||||
* app/tools/gimpblendtool.c
|
||||
* app/tools/gimpbucketfilltool.c
|
||||
* app/tools/gimpclonetool.c
|
||||
* app/tools/gimpconvolvetool.c
|
||||
* app/tools/gimpdodgeburntool.c
|
||||
* app/tools/gimperasertool.c
|
||||
* app/tools/gimpfliptool.c
|
||||
* app/tools/gimppaintbrushtool.c
|
||||
* app/tools/gimppainttool.c
|
||||
* app/tools/gimppenciltool.c
|
||||
* app/tools/gimpperspectivetool.c
|
||||
* app/tools/gimprotatetool.c
|
||||
* app/tools/gimpscaletool.c
|
||||
* app/tools/gimpsheartool.c
|
||||
* app/tools/gimpsmudgetool.c
|
||||
* app/tools/gimptexttool.c
|
||||
* tools/pdbgen/pdb/paths.pdb: removed useless includes.
|
||||
|
||||
2001-05-15 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/gimpcontextpreview.[ch]: removed (was not used).
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpblendtool.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "floating_sel.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "scale.h"
|
||||
|
||||
|
||||
#define MAX_PREVIEW_SIZE 256 /* EEK */
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "scale.h"
|
||||
|
||||
|
||||
#define MAX_PREVIEW_SIZE 256 /* EEK */
|
||||
|
|
131
app/general.c
131
app/general.c
|
@ -26,95 +26,32 @@
|
|||
#include <time.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "general.h"
|
||||
|
||||
char*
|
||||
search_in_path (char *search_path,
|
||||
char *filename)
|
||||
{
|
||||
static char path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
int err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
return token;
|
||||
}
|
||||
|
||||
/*****/
|
||||
|
||||
/* FIXME: This is straight from the GNU libc sources. We should use
|
||||
* autoconf to test for a system having strsep() and similar
|
||||
* stuff... then use HAVE_STRSEP to decide whether to include or not
|
||||
* our own functions.
|
||||
*/
|
||||
|
||||
char *
|
||||
xstrsep (char **pp,
|
||||
char *delim)
|
||||
{
|
||||
char *p, *q;
|
||||
gchar *token_str;
|
||||
gchar *token_sym;
|
||||
gdouble token_num;
|
||||
gint token_int;
|
||||
|
||||
if (!(p = *pp))
|
||||
return NULL;
|
||||
if ((q = strpbrk (p, delim))) {
|
||||
*pp = q + 1;
|
||||
*q = '\0';
|
||||
} else
|
||||
*pp = NULL;
|
||||
|
||||
return p;
|
||||
} /* xstrsep */
|
||||
|
||||
|
||||
char *token_str;
|
||||
char *token_sym;
|
||||
double token_num;
|
||||
int token_int;
|
||||
|
||||
int
|
||||
gint
|
||||
get_token (ParseInfo *info)
|
||||
{
|
||||
char *buffer;
|
||||
char *tokenbuf;
|
||||
int tokenpos = 0;
|
||||
int state;
|
||||
int count;
|
||||
int slashed;
|
||||
gchar *buffer;
|
||||
gchar *tokenbuf;
|
||||
gint tokenpos = 0;
|
||||
gint state;
|
||||
gint count;
|
||||
gint slashed;
|
||||
|
||||
state = 0;
|
||||
buffer = info->buffer;
|
||||
state = 0;
|
||||
buffer = info->buffer;
|
||||
tokenbuf = info->tokenbuf;
|
||||
slashed = FALSE;
|
||||
slashed = FALSE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -286,14 +223,14 @@ get_token (ParseInfo *info)
|
|||
/* Parse "line" and look for a string of characters without spaces
|
||||
following a '(' and copy them into "token_r". Return the number of
|
||||
characters stored, or 0. */
|
||||
int
|
||||
find_token (char *line,
|
||||
char *token_r,
|
||||
int maxlen)
|
||||
gint
|
||||
find_token (gchar *line,
|
||||
gchar *token_r,
|
||||
gint maxlen)
|
||||
{
|
||||
char *sp;
|
||||
char *dp;
|
||||
int i;
|
||||
gchar *sp;
|
||||
gchar *dp;
|
||||
gint i;
|
||||
|
||||
/* FIXME: This should be replaced by a more intelligent parser which
|
||||
checks for '\', '"' and nested parentheses. See get_token(). */
|
||||
|
@ -329,25 +266,29 @@ find_token (char *line,
|
|||
buffer (21 bytes). If strict is FALSE, the 'T' between the date
|
||||
and the time is replaced by a space, which makes the format a bit
|
||||
more readable (IMHO). */
|
||||
char *
|
||||
iso_8601_date_format (char *user_buf, int strict)
|
||||
const gchar *
|
||||
iso_8601_date_format (gchar *user_buf,
|
||||
gint strict)
|
||||
{
|
||||
static char static_buf[21];
|
||||
char *buf;
|
||||
time_t clock;
|
||||
struct tm *now;
|
||||
static gchar static_buf[21];
|
||||
gchar *buf;
|
||||
time_t clock;
|
||||
struct tm *now;
|
||||
|
||||
if (user_buf != NULL)
|
||||
buf = user_buf;
|
||||
else
|
||||
buf = static_buf;
|
||||
|
||||
clock = time (NULL);
|
||||
now = gmtime (&clock);
|
||||
|
||||
/* date format derived from ISO 8601:1988 */
|
||||
sprintf(buf, "%04d-%02d-%02d%c%02d:%02d:%02d%c",
|
||||
now->tm_year + 1900, now->tm_mon + 1, now->tm_mday,
|
||||
(strict ? 'T' : ' '),
|
||||
now->tm_hour, now->tm_min, now->tm_sec,
|
||||
(strict ? 'Z' : '\000'));
|
||||
sprintf (buf, "%04d-%02d-%02d%c%02d:%02d:%02d%c",
|
||||
now->tm_year + 1900, now->tm_mon + 1, now->tm_mday,
|
||||
(strict ? 'T' : ' '),
|
||||
now->tm_hour, now->tm_min, now->tm_sec,
|
||||
(strict ? 'Z' : '\000'));
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GENERAL_H__
|
||||
#define __GENERAL_H__
|
||||
|
||||
|
@ -37,29 +38,31 @@ typedef struct _ParseInfo ParseInfo;
|
|||
|
||||
struct _ParseInfo
|
||||
{
|
||||
FILE *fp;
|
||||
char *buffer;
|
||||
char *tokenbuf;
|
||||
int linenum;
|
||||
int charnum;
|
||||
int position;
|
||||
int buffer_size;
|
||||
int tokenbuf_size;
|
||||
unsigned int inc_linenum : 1;
|
||||
unsigned int inc_charnum : 1;
|
||||
FILE *fp;
|
||||
gchar *buffer;
|
||||
gchar *tokenbuf;
|
||||
gint linenum;
|
||||
gint charnum;
|
||||
gint position;
|
||||
gint buffer_size;
|
||||
gint tokenbuf_size;
|
||||
guint inc_linenum : 1;
|
||||
guint inc_charnum : 1;
|
||||
};
|
||||
|
||||
|
||||
char * search_in_path (char *, char *);
|
||||
char * xstrsep (char **p, char *delim);
|
||||
int get_token (ParseInfo *info);
|
||||
int find_token (char *line, char *token_r, int maxlen);
|
||||
char * iso_8601_date_format (char *user_buf, int strict);
|
||||
gint get_token (ParseInfo *info);
|
||||
gint find_token (gchar *line,
|
||||
gchar *token_r,
|
||||
gint maxlen);
|
||||
const char * iso_8601_date_format (gchar *user_buf,
|
||||
gint strict);
|
||||
|
||||
extern char *token_str;
|
||||
extern char *token_sym;
|
||||
extern double token_num;
|
||||
extern int token_int;
|
||||
|
||||
extern gchar *token_str;
|
||||
extern gchar *token_sym;
|
||||
extern gdouble token_num;
|
||||
extern gint token_int;
|
||||
|
||||
|
||||
#endif /* __GENERAL_H__ */
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "gimpparasite.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
#include "gimage.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimputils.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "palette-select.h"
|
||||
|
||||
#include "context_manager.h"
|
||||
#include "floating_sel.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimage.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "ops_buttons.h"
|
||||
#include "paths-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
#include "gimprc.h"
|
||||
#include "image_render.h"
|
||||
#include "path.h"
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "gimprc.h"
|
||||
#include "gximage.h"
|
||||
#include "image_render.h"
|
||||
#include "scale.h"
|
||||
|
||||
|
||||
#define MAX_PREVIEW_SIZE 256 /* EEK */
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimpairbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include "core/gimpcontext.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimpdodgeburntool.h"
|
||||
#include "gimppainttool.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimperasertool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimppaintbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpdrawtool.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimppenciltool.h"
|
||||
#include "gimppainttool.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "procedural_db.h"
|
||||
|
||||
#include "core/gimpimage.h"
|
||||
#include "gimage.h"
|
||||
#include "path.h"
|
||||
#include "pathP.h"
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef G_WITH_CYGWIN
|
||||
|
@ -101,7 +104,6 @@
|
|||
#include "appenv.h"
|
||||
#include "datafiles.h"
|
||||
#include "errors.h"
|
||||
#include "general.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "plug_in.h"
|
||||
|
@ -188,6 +190,8 @@ static void plug_in_args_destroy (Argument *args,
|
|||
gboolean full_destroy);
|
||||
static void plug_in_init_shm (void);
|
||||
|
||||
static gchar * plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename);
|
||||
|
||||
PlugIn *current_plug_in = NULL;
|
||||
GSList *proc_defs = NULL;
|
||||
|
@ -849,10 +853,11 @@ plug_in_new (gchar *name)
|
|||
PlugIn *plug_in;
|
||||
gchar *path;
|
||||
|
||||
if (!g_path_is_absolute (name))
|
||||
if (! g_path_is_absolute (name))
|
||||
{
|
||||
path = search_in_path (plug_in_path, name);
|
||||
if (!path)
|
||||
path = plug_in_search_in_path (plug_in_path, name);
|
||||
|
||||
if (! path)
|
||||
{
|
||||
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
||||
return NULL;
|
||||
|
@ -3528,3 +3533,41 @@ plug_in_progress_update (PlugIn *plug_in,
|
|||
|
||||
progress_update (plug_in->progress, percentage);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
plug_in_search_in_path (gchar *search_path,
|
||||
gchar *filename)
|
||||
{
|
||||
static gchar path[256];
|
||||
gchar *local_path;
|
||||
gchar *token;
|
||||
gchar *next_token;
|
||||
struct stat buf;
|
||||
gint err;
|
||||
|
||||
local_path = g_strdup (search_path);
|
||||
next_token = local_path;
|
||||
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
||||
|
||||
while (token)
|
||||
{
|
||||
sprintf (path, "%s", token);
|
||||
|
||||
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
||||
strcat (path, G_DIR_SEPARATOR_S);
|
||||
strcat (path, filename);
|
||||
|
||||
err = stat (path, &buf);
|
||||
if (!err && S_ISREG (buf.st_mode))
|
||||
{
|
||||
token = path;
|
||||
break;
|
||||
}
|
||||
|
||||
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
||||
}
|
||||
|
||||
g_free (local_path);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimpairbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
|
||||
#include "gui/paths-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
|
||||
#include "gimpeditselectiontool.h"
|
||||
#include "gimpbezierselecttool.h"
|
||||
#include "selection_options.h"
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpblendtool.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpdrawtool.h"
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpbucketfilltool.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include "core/gimpcontext.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimpdodgeburntool.h"
|
||||
#include "gimppainttool.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimperasertool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -37,10 +37,8 @@
|
|||
#include "core/gimpimage-mask.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
#include "path_transform.h"
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimppaintbrushtool.h"
|
||||
#include "paint_options.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpdrawtool.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
|
||||
#include "gdisplay.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "gimppenciltool.h"
|
||||
#include "gimppainttool.h"
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "gdisplay.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gui/info-dialog.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpperspectivetool.h"
|
||||
|
|
|
@ -31,11 +31,9 @@
|
|||
|
||||
#include "gui/info-dialog.h"
|
||||
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
#include "path_transform.h"
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "drawable.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpscaletool.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpsheartool.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpui.h"
|
||||
#include "selection.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "plug_in.h"
|
||||
#include "selection.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "gimpeditselectiontool.h"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gimage.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -763,7 +763,7 @@ CODE
|
|||
}
|
||||
|
||||
|
||||
@headers = qw(<string.h> "gimage.h" "path.h" "pathP.h" "tools/tools-types.h");
|
||||
@headers = qw(<string.h> "path.h" "pathP.h" "tools/tools-types.h");
|
||||
|
||||
@procs = qw(path_list path_get_points path_get_current path_set_current
|
||||
path_set_points path_stroke_current path_get_point_at_dist
|
||||
|
|
Loading…
Reference in New Issue