mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
Script name is printed now correctly if there's an error in
timeouts/signals. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1688 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
279f149295
commit
82034efb11
5 changed files with 66 additions and 9 deletions
|
|
@ -50,12 +50,29 @@ static GHashTable *iobject_stashes, *plain_stashes;
|
|||
static GSList *use_protocols;
|
||||
|
||||
/* returns the package who called us */
|
||||
char *perl_get_package(void)
|
||||
const char *perl_get_package(void)
|
||||
{
|
||||
STRLEN n_a;
|
||||
return SvPV(perl_eval_pv("caller", TRUE), n_a);
|
||||
}
|
||||
|
||||
/* Parses the package part from function name */
|
||||
char *perl_function_get_package(const char *function)
|
||||
{
|
||||
const char *p;
|
||||
int pos;
|
||||
|
||||
pos = 0;
|
||||
for (p = function; *p != '\0'; p++) {
|
||||
if (*p == ':' && p[1] == ':') {
|
||||
if (++pos == 3)
|
||||
return g_strndup(function, (int) (p-function));
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SV *irssi_bless_iobject(int type, int chat_type, void *object)
|
||||
{
|
||||
PERL_OBJECT_REC *rec;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue