コード例 #1
0
ファイル: perl.c プロジェクト: JordanKinsley/hexchat
static int
perl_auto_load (void *unused)
{
	const char *xdir;
	char *sub_dir;
#ifdef WIN32
	int copied = 0;
	char *slash = NULL;
#endif

	/* get the dir in local filesystem encoding (what opendir() expects!) */
	xdir = xchat_get_info (ph, "xchatdirfs");
	if (!xdir)			/* xchatdirfs is new for 2.0.9, will fail on older */
		xdir = xchat_get_info (ph, "xchatdir");

	/* don't pollute the filesystem with script files, this only causes misuse of the folders
	 * only use ~/.config/hexchat/addons/ and %APPDATA%\HexChat\addons */
#if 0
	/* autoload from ~/.config/hexchat/ or %APPDATA%\HexChat\ on win32 */
	perl_auto_load_from_path (xdir);
#endif

	sub_dir = malloc (strlen (xdir) + 8);
	strcpy (sub_dir, xdir);
	strcat (sub_dir, "/addons");
	perl_auto_load_from_path (sub_dir);
	free (sub_dir);

#if 0
#ifdef WIN32
	/* autoload from  C:\Program Files\HexChat\plugins\ */
	sub_dir = malloc (1025 + 9);
	copied = GetModuleFileName( 0, sub_dir, 1024 );
	sub_dir[copied] = '\0';
	slash = strrchr( sub_dir, '\\' );
	if( slash != NULL ) {
		*slash = '\0';
	}
	perl_auto_load_from_path ( strncat (sub_dir, "\\plugins", 9));
	free (sub_dir);
#endif
#endif
	return 0;
}
コード例 #2
0
ファイル: perl.c プロジェクト: hananh/xchat-aqua
static int
perl_auto_load (void *unused)
{
	const char *xdir;

	/* get the dir in local filesystem encoding (what opendir() expects!) */
	xdir = xchat_get_info (ph, "xchatdirfs");
	if (!xdir)						  /* xchatdirfs is new for 2.0.9, will fail on older */
		xdir = xchat_get_info (ph, "xchatdir");

	/* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */
	perl_auto_load_from_path (xdir);

#ifdef WIN32
	/* autoload from  C:\program files\xchat\plugins\ */
	perl_auto_load_from_path (XCHATLIBDIR"/plugins");
#endif
	return 0;
}
コード例 #3
0
ファイル: perl.c プロジェクト: KhitryyGruzinGivi/xchat
static int
perl_auto_load (void *unused)
{
	const char *xdir;
	char *sub_dir;
#ifdef WIN32
	int copied = 0;
	char *slash = NULL;
#endif

	/* get the dir in local filesystem encoding (what opendir() expects!) */
	xdir = xchat_get_info (ph, "xchatdirfs");
	if (!xdir)			/* xchatdirfs is new for 2.0.9, will fail on older */
		xdir = xchat_get_info (ph, "xchatdir");

	/* autoload from ~/.xchat2/ or ${APPDATA}\X-Chat 2\ on win32 */
	perl_auto_load_from_path (xdir);

	sub_dir = malloc (strlen (xdir) + 9);
	strcpy (sub_dir, xdir);
	strcat (sub_dir, "/plugins");
	perl_auto_load_from_path (sub_dir);
	free (sub_dir);

#ifdef WIN32
	/* autoload from  C:\program files\xchat\plugins\ */
	sub_dir = malloc (1025 + 9);
	copied = GetModuleFileName( 0, sub_dir, 1024 );
	sub_dir[copied] = '\0';
	slash = strrchr( sub_dir, '\\' );
	if( slash != NULL ) {
		*slash = '\0';
	}
	perl_auto_load_from_path ( strncat (sub_dir, "\\plugins", 9));
	free (sub_dir);
#endif
	return 0;
}