From 0ffb21a672c0162564b2cf0309426e17485fbe37 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 18 Jan 2005 01:06:30 +0000 Subject: [PATCH] * Moved everything into the BPrivate namespace. * Replaced the constant kRosterPortName by a function returning that name (we need different port names under BeOS and Haiku, and already at libbe init time). * The settings directory is obtained via find_directory() (critized by Axel :-). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10812 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/RegistrarDefs.h | 7 ++++++- src/kits/app/RegistrarDefs.cpp | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/headers/private/app/RegistrarDefs.h b/headers/private/app/RegistrarDefs.h index b793e7ca69..2087fdf912 100644 --- a/headers/private/app/RegistrarDefs.h +++ b/headers/private/app/RegistrarDefs.h @@ -30,12 +30,15 @@ #include #include +namespace BPrivate { + // names extern const char *kRegistrarSignature; extern const char *kRosterThreadName; -extern const char *kRosterPortName; extern const char *kRAppLooperPortName; +extern const char *get_roster_port_name(); + // message constants enum { // replies @@ -159,5 +162,7 @@ struct flat_app_info { char ref_name[B_FILE_NAME_LENGTH + 1]; }; +} // namespace BPrivate + #endif // REGISTRAR_DEFS_H diff --git a/src/kits/app/RegistrarDefs.cpp b/src/kits/app/RegistrarDefs.cpp index 1ef1aacf41..5481febfe5 100644 --- a/src/kits/app/RegistrarDefs.cpp +++ b/src/kits/app/RegistrarDefs.cpp @@ -24,11 +24,25 @@ // Description: API classes - registrar interface. //------------------------------------------------------------------------------ +#include #include +namespace BPrivate { + // names -const char *kRegistrarSignature = "application/x-vnd.OBOS-Registrar"; -const char *kRosterThreadName = "_obos_roster_thread_"; -const char *kRosterPortName = "_obos_roster_port_"; +const char *kRegistrarSignature = "application/x-vnd.haiku-registrar"; +const char *kRosterThreadName = "_roster_thread_"; const char *kRAppLooperPortName = "rAppLooperPort"; +// get_roster_port_name +/*! \brief Returns the name of the main request port of the registrar (roster). + \return the name of the registrar request port. +*/ +const char * +get_roster_port_name() +{ + return (BPrivate::is_running_on_haiku() + ? "_roster_port_" : "_obos_roster_port_"); +} + +} // namespace BPrivate