#include #include #include #include #include #include "xchat-plugin.h" #define PNAME "example" #define PDESC "example plugin...buggy?" #define PVERSION "0.3" #define FLOOD_PROTECTION_TIME_THRESHOLD 3 #define FLOOD_PROTECTION_MSG_THRESHOLD 3 #define TRIGGER_CHAR "!" static unsigned int uid = 0; static xchat_plugin *ph; static int floodProtectActivated = 0; static int floodProtDisabled = 0; static time_t *floodProt[FLOOD_PROTECTION_MSG_THRESHOLD]; char *debugTarget = "slash-kun"; static char* strCopy(char *strFrom, int totalCharsToCopy, int startIndex){ int length = (int)strlen(strFrom); if(totalCharsToCopy == 0) totalCharsToCopy = length - startIndex; if(startIndex > length) return NULL; if((length - startIndex) < totalCharsToCopy) return NULL; char *newString = (char *)calloc(totalCharsToCopy+1,sizeof(char)); if(!newString) return NULL; char *temp = newString; int i = 0; while(i