summaryrefslogtreecommitdiff
path: root/src/perl/perl-common.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-12-06 05:03:11 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-12-06 05:03:11 +0000
commite95f309b500e37ceb65f533fa0267a2864511228 (patch)
treee5f9e8705ceaa33fdd6c62c389312652de961865 /src/perl/perl-common.h
parenta99e93ef5d8dd4002580532ee25316c3860c1e4a (diff)
downloadirssi-e95f309b500e37ceb65f533fa0267a2864511228.zip
perl changes - values() method doesn't exist anymore, instead of
$server->values()->{...} you now use directly $server->{...} git-svn-id: http://svn.irssi.org/repos/irssi/trunk@972 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/perl-common.h')
-rw-r--r--src/perl/perl-common.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/perl/perl-common.h b/src/perl/perl-common.h
index 267ab094..e4987337 100644
--- a/src/perl/perl-common.h
+++ b/src/perl/perl-common.h
@@ -7,19 +7,25 @@
#define new_bless(obj, stash) \
sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(obj))), stash)
-extern GHashTable *perl_stashes;
+#define is_hvref(o) \
+ ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV))
+
+#define hvref(o) \
+ (is_hvref(o) ? (HV *)SvRV(o) : NULL)
+
+#define push_bless(obj, stash) \
+ XPUSHs(sv_2mortal(new_bless(obj, stash)))
+
+#define irssi_bless(object) \
+ irssi_bless_object((object)->type, (object)->chat_type, object)
/* returns the package who called us */
char *perl_get_package(void);
-HV *irssi_get_stash_item(int type, int chat_type);
-
-#define irssi_get_stash(item) \
- irssi_get_stash_item((item)->type, (item)->chat_type)
+SV *irssi_bless_object(int type, int chat_type, void *object);
+void *irssi_ref_object(SV *o);
-#define irssi_add_stash(type, chat_type, stash) \
- g_hash_table_insert(perl_stashes, GINT_TO_POINTER(type | \
- (chat_type << 24)), g_strdup(stash))
+void irssi_add_object(int type, int chat_type, const char *stash);
void perl_common_init(void);
void perl_common_deinit(void);