Merge authors: poy (poy) ------------------------------------------------------------ revno: 10 [merge] committer: poy <p...@123gen.com> branch nick: ExamplePlugin timestamp: Tue 2013-01-29 19:21:57 +0100 message: merge modified: LICENSE pluginsdk/Config.c pluginsdk/Config.h pluginsdk/PluginDefs.h src/Dialog.c src/Dialog.h src/Plugin.c src/Plugin.h src/main.c src/stdafx.c src/stdafx.h src/version.h
-- lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin/+edit-subscription
=== modified file 'LICENSE' --- LICENSE 2012-12-27 14:06:17 +0000 +++ LICENSE 2013-01-29 18:13:20 +0000 @@ -1,5 +1,5 @@ DC++ plugin SDK (C) -Copyright (C) 2012 Jacek Sieka, arnetheduck at gmail dot com +Copyright (C) 2012-2013 Jacek Sieka, arnetheduck at gmail dot com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License === modified file 'pluginsdk/Config.c' --- pluginsdk/Config.c 2012-12-31 03:47:16 +0000 +++ pluginsdk/Config.c 2013-01-18 21:37:28 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'pluginsdk/Config.h' --- pluginsdk/Config.h 2012-12-27 21:18:53 +0000 +++ pluginsdk/Config.h 2013-01-18 21:37:28 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'pluginsdk/PluginDefs.h' --- pluginsdk/PluginDefs.h 2012-12-27 21:13:28 +0000 +++ pluginsdk/PluginDefs.h 2013-01-29 18:13:20 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2001-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ #define DCINTF_DCPP_UTILS_VER 1 #define DCINTF_DCPP_TAGGER "dcpp.xml.DCTagger" /* Manipulation of an XML tagger */ -#define DCINTF_DCPP_TAGGER_VER 1 +#define DCINTF_DCPP_TAGGER_VER 2 #define DCINTF_DCPP_UI "dcpp.ui.DCUI" /* User interface */ #define DCINTF_DCPP_UI_VER 1 @@ -259,7 +259,6 @@ /* Tagging intentions */ typedef struct tagTagData { - const char* text; /* Plain text string to apply tags on */ dcptr_t object; /* Internal */ Bool isManaged; /* Always True for now */ } TagData, *TagDataPtr; @@ -426,6 +425,10 @@ uint32_t apiVersion; void (DCAPI *add_tag) (TagDataPtr hTags, size_t start, size_t end, const char* id, const char* attributes); + + /* Version 2 functions */ + const char* (DCAPI *get_text) (TagDataPtr hTags); + void (DCAPI *replace_text) (TagDataPtr hTags, size_t start, size_t end, const char* replacement); } DCTagger, *DCTaggerPtr; /* User interface */ === modified file 'src/Dialog.c' --- src/Dialog.c 2012-12-27 21:29:11 +0000 +++ src/Dialog.c 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/Dialog.h' --- src/Dialog.h 2012-12-27 21:29:11 +0000 +++ src/Dialog.h 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/Plugin.c' --- src/Plugin.c 2012-12-31 03:50:07 +0000 +++ src/Plugin.c 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -243,17 +243,20 @@ Bool DCAPI onChatTags(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak) { static const char* pattern = "ABC DEF"; + TagDataPtr tags = (TagDataPtr)pData; - char* text = strstr(tags->text, pattern); - - while(text != NULL) { - tagger->add_tag(tags, text - tags->text, (text - tags->text) + strlen(pattern), "b", ""); - text = strstr(text + strlen(pattern), pattern); + + const char* text = tagger->get_text(tags); + char* pos = strstr(text, pattern); + + while(pos != NULL) { + tagger->add_tag(tags, pos - text, (pos - text) + strlen(pattern), "b", ""); + pos = strstr(pos + strlen(pattern), pattern); } - text = strstr(tags->text, "***"); - if (text != NULL && (text - tags->text) == 0) - tagger->add_tag(tags, 0, strlen(tags->text), "b", ""); + pos = strstr(text, "***"); + if (pos != NULL && (pos - text) == 0) + tagger->add_tag(tags, 0, strlen(text), "b", ""); return True; } === modified file 'src/Plugin.h' --- src/Plugin.h 2012-12-27 21:29:11 +0000 +++ src/Plugin.h 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/main.c' --- src/main.c 2012-12-27 21:29:11 +0000 +++ src/main.c 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/stdafx.c' --- src/stdafx.c 2012-12-27 14:49:19 +0000 +++ src/stdafx.c 2013-01-18 21:37:28 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/stdafx.h' --- src/stdafx.h 2012-12-27 21:29:11 +0000 +++ src/stdafx.h 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by === modified file 'src/version.h' --- src/version.h 2012-12-27 21:29:11 +0000 +++ src/version.h 2013-01-29 18:21:57 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * Copyright (C) 2012-2013 Jacek Sieka, arnetheduck on gmail point com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp