summary refs log tree commit diff stats
path: root/win32
AgeCommit message (Expand)Author
2012-07-27Fix Perl interface filename in the installer, tooBerke Viktor
2012-07-21Add trailing backslashes to Output and Intermediate directories, make Visual ...Berke Viktor
2012-07-18A decent WizardImage for the installerBerke Viktor
2012-07-16Update logos thanks to TingPing, now only WizardImage is leftBerke Viktor
2012-07-16Use highest compression available, it actually speeds up compression and slig...Berke Viktor
2012-07-14Ultra compression slows down compilation but doesn't really reduce the size, ...Berke Viktor
2012-07-14win32/nls/nls.vcxproj: get rid of unused elementsxhmikosr
2012-07-14remove trailing spacexhmikosr
2012-07-14installer: use lzma2/ultra compressionxhmikosr
2012-07-14get rid of *.user files and ignore themxhmikosr
2012-07-14Remove migratorsBerke Viktor
2012-07-14Add installers for migrating from XChat-WDKBerke Viktor
2012-07-13Rename DLL files, rename X-SASL to SASLBerke Viktor
2012-07-13Rename X-Tray to HexTrayBerke Viktor
2012-07-13Update theme extensions in the installer, tooBerke Viktor
2012-07-13Remove the last remnants of XChat-WDKBerke Viktor
2012-07-13Another bunch of rebranding stuffBerke Viktor
2012-07-13Rename XTM to HTMBerke Viktor
2012-07-12Fix NLSBerke Viktor
2012-07-11Rebranding on the file levelBerke Viktor
2012-07-11Fix Perl 5.16 installation in x64 installerBerke Viktor
2012-06-17Another bunch of fixes and additions to the XTMBerke Viktor
2012-06-17Add XChat Theme Manager (TingPing)Patrick Griffs
2012-06-15Add .user files and .gitignoreBerke Viktor
2012-06-15Add x64 support to the VS solutionBerke Viktor
2012-06-15Update paths for x64 installer tooBerke Viktor
2012-06-15Use nicer default dependency pathsBerke Viktor
2012-06-15First bunch of cleanupsBerke Viktor
2012-06-15LOTS of fixes to the VS solutionBerke Viktor
2012-06-10Add projects for making the installerBerke Viktor
2012-06-10Add WMPA as wellBerke Viktor
2012-06-10Add all plugins to solution except WMPABerke Viktor
2012-06-10More solution fixes and add language interfacesBerke Viktor
2012-06-10Shorten folder nameBerke Viktor
2012-06-10Add files required for the WDK7 platform toolset used by the VS solutionBerke Viktor
2012-06-10Migrate VS solution to VS2010+WDK7Berke Viktor
2012-06-03Solution fixes, debug config and x64 platformBerke Viktor
2012-06-03Use Tor's proxy-libintl with VSBerke Viktor
2012-06-03Initial Visual Studio solutionBerke Viktor
2012-05-13overwrite 7z items as well and delete ATK translations tooBerke Viktor
2012-05-13Update OpenSSL to 1.0.1cBerke Viktor
2012-05-04update openssl to 1.0.1bBerke Viktor
2012-03-15update openssl depsBerke Viktor
2012-03-15update openssl to 1.0.1Berke Viktor
2012-01-20add DNS pluginBerke Viktor
2012-01-20update openssl to 1.0.0gBerke Viktor
2012-01-20disable the non-bmp pluginBerke Viktor
2012-01-18install nonbmp by defaultBerke Viktor
2012-01-18add Non-BMP plugin against GTK+ exploitsBerke Viktor
2012-01-11some more xsasl cosmeticsBerke Viktor
r: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The Fuck You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
 * for more details. */

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "hexchat-plugin.h"

static xchat_plugin *ph;

static int
parse_command( char *word[], char *word_eol[], void *userdata ) {
	char *channel = NULL, *server = NULL, *token = NULL;
/*	char *save_ptr1 = NULL;*/
	char *str1 = NULL;
	char *delimiter = NULL;

	xchat_context *ctx = NULL;

	if( word[2] != NULL && word[3] != NULL ) {
		for( str1 = word[2]; ; str1 = NULL ) {
/*			token = strtok_r( str1, ",", &save_ptr1 );*/
			token = strtok( str1, "," );
/*			printf( "token: %s\n", token );*/

			if( token == NULL ) {
				break;
			}

			channel = strdup( token );
				
			delimiter = strchr( channel, '/' );

			server = NULL;
			if( delimiter != NULL ) {
				*delimiter = '\0';

				if( strlen( delimiter + 1 ) > 0 ) {
					server = strdup( delimiter + 1 );
				}
			}

			/* /Network form */
			if( strlen( channel ) == 0 ) {
				free( channel );
				channel = NULL;
			}

/*			printf( "channel[%s] server[%s]\n", channel, server );*/

			if( (ctx = xchat_find_context( ph, server, channel ) ) != NULL ) {
				if( xchat_set_context( ph, ctx ) ) {
					xchat_command( ph, word_eol[3] );
				}
			}

			if( channel != NULL ) {
				free( channel );
			}

			if( server != NULL ) {
				free( server );
			}
		}
	}
	return XCHAT_EAT_XCHAT;
}

int
xchat_plugin_init( xchat_plugin * plugin_handle, char **plugin_name,
	char **plugin_desc, char **plugin_version, char *arg ) {

	ph = plugin_handle;
	*plugin_name = "Do At";
	*plugin_version = "1.0001";
	*plugin_desc = "Perform an arbitrary command on multiple channels";

	xchat_hook_command( ph, "doat", XCHAT_PRI_NORM, parse_command, "DOAT [channel,list,/network] [command], perform a command on multiple contexts", NULL );

	xchat_print (ph, "Do At plugin loaded\n");

	return 1;
}

int
xchat_plugin_deinit (void)
{
	xchat_print (ph, "Do At plugin unloaded\n");
	return 1;
}