rev nsINNTPHost and nsINewsgroupList interfaces

This commit is contained in:
alecf%netscape.com 1999-03-11 01:18:04 +00:00
Родитель 710594e9a5
Коммит 53338e8a97
6 изменённых файлов: 142 добавлений и 154 удалений

Просмотреть файл

@ -7,18 +7,12 @@
#include "nsISupports.h" /* interface nsISupports */ #include "nsISupports.h" /* interface nsISupports */
#include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */
#include "nsID.h" /* interface nsID */
#include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */
#ifdef XPIDL_JS_STUBS #ifdef XPIDL_JS_STUBS
#include "jsapi.h" #include "jsapi.h"
#endif #endif
#include "nsDebug.h"
#include "nsTraceRefcnt.h"
#include "nsID.h"
#include "nsIID.h"
#include "nsError.h"
#include "nsISupportsUtils.h"
/* starting interface nsINNTPHost */ /* starting interface nsINNTPHost */
@ -40,10 +34,10 @@ class nsINNTPHost : public nsISupports {
NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions) = 0; NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions) = 0;
/* void AddExtension (in string extension); */ /* void AddExtension (in string extension); */
NS_IMETHOD AddExtension(char *extension) = 0; NS_IMETHOD AddExtension(const char *extension) = 0;
/* boolean QueryExtension (in string extension); */ /* boolean QueryExtension (in string extension); */
NS_IMETHOD QueryExtension(char *extension, PRBool *_retval) = 0; NS_IMETHOD QueryExtension(const char *extension, PRBool *_retval) = 0;
/* attribute boolean postingAllowed; */ /* attribute boolean postingAllowed; */
NS_IMETHOD GetPostingAllowed(PRBool *aPostingAllowed) = 0; NS_IMETHOD GetPostingAllowed(PRBool *aPostingAllowed) = 0;
@ -58,43 +52,43 @@ class nsINNTPHost : public nsISupports {
NS_IMETHOD SetLastUpdatedTime(PRInt64 aLastUpdatedTime) = 0; NS_IMETHOD SetLastUpdatedTime(PRInt64 aLastUpdatedTime) = 0;
/* nsINNTPNewsgroupList GetNewsgroupList (in string groupname); */ /* nsINNTPNewsgroupList GetNewsgroupList (in string groupname); */
NS_IMETHOD GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval) = 0; NS_IMETHOD GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval) = 0;
/* nsINNTPNewsgroup FindNewsgroup (in string groupname, in boolean create); */ /* nsINNTPNewsgroup FindNewsgroup (in string groupname, in boolean create); */
NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, nsINNTPNewsgroup **_retval) = 0; NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create, nsINNTPNewsgroup **_retval) = 0;
/* void AddPropertyForGet (in string name, in string value); */ /* void AddPropertyForGet (in string name, in string value); */
NS_IMETHOD AddPropertyForGet(char *name, char *value) = 0; NS_IMETHOD AddPropertyForGet(const char *name, const char *value) = 0;
/* string QueryPropertyForGet (in string name); */ /* string QueryPropertyForGet (in string name); */
NS_IMETHOD QueryPropertyForGet(char *name, char **_retval) = 0; NS_IMETHOD QueryPropertyForGet(const char *name, char **_retval) = 0;
/* void AddSearchableGroup (in string groupname); */ /* void AddSearchableGroup (in string groupname); */
NS_IMETHOD AddSearchableGroup(char *groupname) = 0; NS_IMETHOD AddSearchableGroup(const char *groupname) = 0;
/* boolean QuerySearchableGroup (in string groupname); */ /* boolean QuerySearchableGroup (in string groupname); */
NS_IMETHOD QuerySearchableGroup(char *groupname, PRBool *_retval) = 0; NS_IMETHOD QuerySearchableGroup(const char *groupname, PRBool *_retval) = 0;
/* void AddVirtualGroup (in string responseText); */ /* void AddVirtualGroup (in string responseText); */
NS_IMETHOD AddVirtualGroup(char *responseText) = 0; NS_IMETHOD AddVirtualGroup(const char *responseText) = 0;
/* void SetIsVirtualGroup (in string groupname, in boolean isVirtual); */ /* void SetIsVirtualGroup (in string groupname, in boolean isVirtual); */
NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual) = 0; NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual) = 0;
/* boolean GetIsVirtualGroup (in string groupname); */ /* boolean GetIsVirtualGroup (in string groupname); */
NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval) = 0; NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval) = 0;
/* void AddSearchableHeader (in string headerName); */ /* void AddSearchableHeader (in string headerName); */
NS_IMETHOD AddSearchableHeader(char *headerName) = 0; NS_IMETHOD AddSearchableHeader(const char *headerName) = 0;
/* boolean QuerySearchableHeader (in string headerName); */ /* boolean QuerySearchableHeader (in string headerName); */
NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval) = 0; NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval) = 0;
/* void GroupNotFound (in string group, in boolean opening); */ /* void GroupNotFound (in string group, in boolean opening); */
NS_IMETHOD GroupNotFound(char *group, PRBool opening) = 0; NS_IMETHOD GroupNotFound(const char *group, PRBool opening) = 0;
/* void AddNewNewsgroup (in string groupname, in long first, in long last, in string flags, in boolean xactiveFlags); */ /* void AddNewNewsgroup (in string groupname, in long first, in long last, in string flags, in boolean xactiveFlags); */
NS_IMETHOD AddNewNewsgroup(char *groupname, PRInt32 first, PRInt32 last, char *flags, PRBool xactiveFlags) = 0; NS_IMETHOD AddNewNewsgroup(const char *groupname, PRInt32 first, PRInt32 last, const char *flags, PRBool xactiveFlags) = 0;
/* long GetNumGroupsNeedingCounts (); */ /* long GetNumGroupsNeedingCounts (); */
NS_IMETHOD GetNumGroupsNeedingCounts(PRInt32 *_retval) = 0; NS_IMETHOD GetNumGroupsNeedingCounts(PRInt32 *_retval) = 0;
@ -103,19 +97,19 @@ class nsINNTPHost : public nsISupports {
NS_IMETHOD GetFirstGroupNeedingCounts(char **_retval) = 0; NS_IMETHOD GetFirstGroupNeedingCounts(char **_retval) = 0;
/* void DisplaySubscribedGroup (in string groupname, in long first_message, in long last_message, in long total_messages, in boolean visit_now); */ /* void DisplaySubscribedGroup (in string groupname, in long first_message, in long last_message, in long total_messages, in boolean visit_now); */
NS_IMETHOD DisplaySubscribedGroup(char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0; NS_IMETHOD DisplaySubscribedGroup(const char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0;
/* string GetFirstGroupNeedingExtraInfo (); */ /* string GetFirstGroupNeedingExtraInfo (); */
NS_IMETHOD GetFirstGroupNeedingExtraInfo(char **_retval) = 0; NS_IMETHOD GetFirstGroupNeedingExtraInfo(char **_retval) = 0;
/* void SetGroupNeedsExtraInfo (in string groupname, in boolean needsExtraInfo); */ /* void SetGroupNeedsExtraInfo (in string groupname, in boolean needsExtraInfo); */
NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool needsExtraInfo) = 0; NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool needsExtraInfo) = 0;
/* void GetNewsgroupAndNumberOfID (in string message_id, out nsINNTPNewsgroup group, out unsigned long message_number); */ /* void GetNewsgroupAndNumberOfID (in string message_id, out nsINNTPNewsgroup group, out unsigned long message_number); */
NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, nsINNTPNewsgroup **group, PRUint32 *message_number) = 0; NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id, nsINNTPNewsgroup **group, PRUint32 *message_number) = 0;
/* void SetPrettyName (in string groupName, in string prettyName); */ /* void SetPrettyName (in string groupName, in string prettyName); */
NS_IMETHOD SetPrettyName(char *groupName, char *prettyName) = 0; NS_IMETHOD SetPrettyName(const char *groupName, const char *prettyName) = 0;
/* void LoadNewsrc (); */ /* void LoadNewsrc (); */
NS_IMETHOD LoadNewsrc() = 0; NS_IMETHOD LoadNewsrc() = 0;
@ -134,13 +128,13 @@ class nsINNTPHost : public nsISupports {
NS_IMETHOD SetNewsRCFilename(char * aNewsRCFilename) = 0; NS_IMETHOD SetNewsRCFilename(char * aNewsRCFilename) = 0;
/* nsINNTPNewsgroup FindGroup (in string name); */ /* nsINNTPNewsgroup FindGroup (in string name); */
NS_IMETHOD FindGroup(char *name, nsINNTPNewsgroup **_retval) = 0; NS_IMETHOD FindGroup(const char *name, nsINNTPNewsgroup **_retval) = 0;
/* nsINNTPNewsgroup AddGroup (in string groupname); */ /* nsINNTPNewsgroup AddGroup (in string groupname); */
NS_IMETHOD AddGroup(char *groupname, nsINNTPNewsgroup **_retval) = 0; NS_IMETHOD AddGroup(const char *groupname, nsINNTPNewsgroup **_retval) = 0;
/* void RemoveGroupByName (in string groupName); */ /* void RemoveGroupByName (in string groupName); */
NS_IMETHOD RemoveGroupByName(char *groupName) = 0; NS_IMETHOD RemoveGroupByName(const char *groupName) = 0;
/* void RemoveGroup (in nsINNTPNewsgroup group); */ /* void RemoveGroup (in nsINNTPNewsgroup group); */
NS_IMETHOD RemoveGroup(nsINNTPNewsgroup *group) = 0; NS_IMETHOD RemoveGroup(nsINNTPNewsgroup *group) = 0;

Просмотреть файл

@ -19,7 +19,7 @@
#include "nsINNTPNewsgroupList.idl" #include "nsINNTPNewsgroupList.idl"
#include "nsINNTPNewsgroup.idl" #include "nsINNTPNewsgroup.idl"
[object, uuid(ADFB3740-AA57-11d2-B7ED-00805F05FFA5)] [object, uuid(6b128da0-d74f-11d2-b7f9-00805f05ffa5)]
interface nsINNTPHost : nsISupports { interface nsINNTPHost : nsISupports {
attribute boolean supportsExtensions; attribute boolean supportsExtensions;

Просмотреть файл

@ -6,17 +6,11 @@
#define __gen_nsINNTPNewsgroupList_h__ #define __gen_nsINNTPNewsgroupList_h__
#include "nsISupports.h" /* interface nsISupports */ #include "nsISupports.h" /* interface nsISupports */
#include "nsID.h" /* interface nsID */
#ifdef XPIDL_JS_STUBS #ifdef XPIDL_JS_STUBS
#include "jsapi.h" #include "jsapi.h"
#endif #endif
#include "nsDebug.h"
#include "nsTraceRefcnt.h"
#include "nsID.h"
#include "nsIID.h"
#include "nsError.h"
#include "nsISupportsUtils.h"
/* starting interface nsINNTPNewsgroupList */ /* starting interface nsINNTPNewsgroupList */
@ -43,10 +37,10 @@ class nsINNTPNewsgroupList : public nsISupports {
NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message) = 0; NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message) = 0;
/* void ProcessXOVER (in string line, out long status); */ /* void ProcessXOVER (in string line, out long status); */
NS_IMETHOD ProcessXOVER(char *line, PRInt32 *status) = 0; NS_IMETHOD ProcessXOVER(const char *line, PRInt32 *status) = 0;
/* void ProcessNonXOVER (in string line); */ /* void ProcessNonXOVER (in string line); */
NS_IMETHOD ProcessNonXOVER(char *line) = 0; NS_IMETHOD ProcessNonXOVER(const char *line) = 0;
/* void ResetXOVER (); */ /* void ResetXOVER (); */
NS_IMETHOD ResetXOVER() = 0; NS_IMETHOD ResetXOVER() = 0;

Просмотреть файл

@ -93,8 +93,8 @@ public:
NS_IMPL_CLASS_GETSET(SupportsExtensions, PRBool, NS_IMPL_CLASS_GETSET(SupportsExtensions, PRBool,
m_supportsExtensions); m_supportsExtensions);
NS_IMETHOD AddExtension (char *ext); NS_IMETHOD AddExtension (const char *ext);
NS_IMETHOD QueryExtension (char *ext, PRBool *_retval); NS_IMETHOD QueryExtension (const char *ext, PRBool *_retval);
NS_IMPL_CLASS_GETSET(PostingAllowed, PRBool, m_postingAllowed); NS_IMPL_CLASS_GETSET(PostingAllowed, PRBool, m_postingAllowed);
@ -103,35 +103,35 @@ public:
NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate); NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate);
NS_IMETHOD GetNewsgroupList(char *groupname, NS_IMETHOD GetNewsgroupList(const char *groupname,
nsINNTPNewsgroupList **_retval) { NS_ASSERTION(0, "unimplemented"); return NS_OK;}; nsINNTPNewsgroupList **_retval) { NS_ASSERTION(0, "unimplemented"); return NS_OK;};
NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id,
nsINNTPNewsgroup **group, nsINNTPNewsgroup **group,
PRUint32 *messageNumber); PRUint32 *messageNumber);
/* get this from MSG_Master::FindNewsFolder */ /* get this from MSG_Master::FindNewsFolder */
NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create,
nsINNTPNewsgroup **_retval) { NS_ASSERTION(0, "unimplemented!"); return NS_OK;} nsINNTPNewsgroup **_retval) { NS_ASSERTION(0, "unimplemented!"); return NS_OK;}
NS_IMETHOD AddPropertyForGet (char *property, char *value); NS_IMETHOD AddPropertyForGet (const char *property, const char *value);
NS_IMETHOD QueryPropertyForGet (char *property, char **_retval); NS_IMETHOD QueryPropertyForGet (const char *property, char **_retval);
NS_IMETHOD AddSearchableGroup(char *groupname); NS_IMETHOD AddSearchableGroup(const char *groupname);
// should these go into interfaces? // should these go into interfaces?
NS_IMETHOD QuerySearchableGroup (char *group, PRBool *); NS_IMETHOD QuerySearchableGroup (const char *group, PRBool *);
NS_IMETHOD QuerySearchableGroupCharsets(char *group, char **); NS_IMETHOD QuerySearchableGroupCharsets(const char *group, char **);
// Virtual groups // Virtual groups
NS_IMETHOD AddVirtualGroup(char *responseText) { return NS_OK;} NS_IMETHOD AddVirtualGroup(const char *responseText) { return NS_OK;}
NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual); NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual);
NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual, NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual,
nsMsgGroupRecord *inGroupRecord); nsMsgGroupRecord *inGroupRecord);
NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval); NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval);
// custom/searchable headers // custom/searchable headers
NS_IMETHOD AddSearchableHeader(char *headerName); NS_IMETHOD AddSearchableHeader(const char *headerName);
NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval); NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval);
// Go load the newsrc for this host. Creates the subscribed hosts as // Go load the newsrc for this host. Creates the subscribed hosts as
// children of the given nsIMsgFolder. // children of the given nsIMsgFolder.
@ -158,21 +158,21 @@ public:
// (this is what the pre-mozilla API looked like) // (this is what the pre-mozilla API looked like)
char *GetNewsrcFileName() { return m_filename; }; char *GetNewsrcFileName() { return m_filename; };
NS_IMETHOD FindGroup(char* name, nsINNTPNewsgroup* *_retval); NS_IMETHOD FindGroup(const char* name, nsINNTPNewsgroup* *_retval);
NS_IMETHOD AddGroup(char *groupname, NS_IMETHOD AddGroup(const char *groupname,
nsINNTPNewsgroup **retval); nsINNTPNewsgroup **retval);
NS_IMETHOD AddGroup(char *groupname, NS_IMETHOD AddGroup(const char *groupname,
nsMsgGroupRecord *groupRecord, nsMsgGroupRecord *groupRecord,
nsINNTPNewsgroup **retval); nsINNTPNewsgroup **retval);
NS_IMETHOD RemoveGroupByName(char *groupName); NS_IMETHOD RemoveGroupByName(const char *groupName);
NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*); NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*);
NS_IMETHOD AddNewNewsgroup(char *groupName, NS_IMETHOD AddNewNewsgroup(const char *groupName,
PRInt32 first, PRInt32 first,
PRInt32 last, PRInt32 last,
char *flags, const char *flags,
PRBool xactiveFlags); PRBool xactiveFlags);
/* Name of directory to store newsgroup /* Name of directory to store newsgroup
@ -189,7 +189,7 @@ public:
individual strings must not be free'd. */ individual strings must not be free'd. */
NS_IMETHOD GetGroupList(char **_retval) { return NS_OK;} NS_IMETHOD GetGroupList(char **_retval) { return NS_OK;}
NS_IMETHOD DisplaySubscribedGroup(char *groupname, NS_IMETHOD DisplaySubscribedGroup(const char *groupname,
PRInt32 first_message, PRInt32 first_message,
PRInt32 last_message, PRInt32 last_message,
PRInt32 total_messages, PRInt32 total_messages,
@ -284,7 +284,7 @@ private:
// Returns the pretty name for the given group. The resulting string // Returns the pretty name for the given group. The resulting string
// must be free'd using delete[]. // must be free'd using delete[].
char* GetPrettyName(char* groupname); char* GetPrettyName(char* groupname);
NS_IMETHOD SetPrettyName(char* groupname, char* prettyname); NS_IMETHOD SetPrettyName(const char* groupname, const char* prettyname);
time_t GetAddTime(char* groupname); time_t GetAddTime(char* groupname);
@ -294,13 +294,13 @@ private:
PRBool IsCategory(char* groupname); PRBool IsCategory(char* groupname);
PRBool IsCategoryContainer(char* groupname); PRBool IsCategoryContainer(char* groupname);
int SetIsCategoryContainer(char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord = NULL); int SetIsCategoryContainer(const char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord = NULL);
NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool value); NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool value);
// Finds the container newsgroup for this category (or NULL if this isn't // Finds the container newsgroup for this category (or NULL if this isn't
// a category). The resulting string must be free'd using delete[]. // a category). The resulting string must be free'd using delete[].
char* GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); char* GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGroupRecord = NULL);
nsINNTPNewsgroup *GetCategoryContainerFolderInfo(char *groupname); nsINNTPNewsgroup *GetCategoryContainerFolderInfo(const char *groupname);
// Get/Set whether this is a real group (as opposed to a container of // Get/Set whether this is a real group (as opposed to a container of
@ -326,7 +326,7 @@ private:
// group is already present, 1 if we had to create it, negative on error. // group is already present, 1 if we had to create it, negative on error.
// The given group will have the "isgroup" bit set on it (in other words, // The given group will have the "isgroup" bit set on it (in other words,
// it is not to be just a container of other groups, like "mcom" is.) // it is not to be just a container of other groups, like "mcom" is.)
int NoticeNewGroup(char* groupname, nsMsgGroupRecord **outGroupRecord = NULL); int NoticeNewGroup(const char* groupname, nsMsgGroupRecord **outGroupRecord = NULL);
// Makes sure that we have records in memory for all known descendants // Makes sure that we have records in memory for all known descendants
@ -351,7 +351,7 @@ private:
nsMsgGroupRecord* GetGroupTree() {return m_groupTree;} nsMsgGroupRecord* GetGroupTree() {return m_groupTree;}
time_t GetFirstNewDate() {return m_firstnewdate;} time_t GetFirstNewDate() {return m_firstnewdate;}
NS_IMETHOD GroupNotFound(char *groupName, PRBool opening); NS_IMETHOD GroupNotFound(const char *groupName, PRBool opening);
int ReorderGroup (nsINNTPNewsgroup *groupToMove, nsINNTPNewsgroup *groupToMoveBefore, PRInt32 *newIdx); int ReorderGroup (nsINNTPNewsgroup *groupToMove, nsINNTPNewsgroup *groupToMoveBefore, PRInt32 *newIdx);
@ -370,7 +370,7 @@ protected:
char* groupname, char* groupname,
PRInt32 min, PRInt32 max); PRInt32 min, PRInt32 max);
static PRInt32 InhaleLine(char* line, PRUint32 length, void* closure); static PRInt32 InhaleLine(char* line, PRUint32 length, void* closure);
nsMsgGroupRecord* FindOrCreateGroup(char* groupname, nsMsgGroupRecord* FindOrCreateGroup(const char* groupname,
int* statusOfMakingGroup = NULL); int* statusOfMakingGroup = NULL);
nsINNTPCategoryContainer *SwitchNewsToCategoryContainer(nsINNTPNewsgroup *newsInfo); nsINNTPCategoryContainer *SwitchNewsToCategoryContainer(nsINNTPNewsgroup *newsInfo);
@ -1623,7 +1623,7 @@ nsNNTPHost::EmptyInhale()
nsresult nsresult
nsNNTPHost::FindGroup(char* name, nsINNTPNewsgroup* *retval) nsNNTPHost::FindGroup(const char* name, nsINNTPNewsgroup* *retval)
{ {
nsresult result = NS_ERROR_NOT_INITIALIZED; nsresult result = NS_ERROR_NOT_INITIALIZED;
@ -1646,7 +1646,7 @@ nsNNTPHost::FindGroup(char* name, nsINNTPNewsgroup* *retval)
} }
nsresult nsresult
nsNNTPHost::AddGroup(char *groupName, nsNNTPHost::AddGroup(const char *groupName,
nsINNTPNewsgroup **retval) nsINNTPNewsgroup **retval)
{ {
return AddGroup(groupName, NULL, retval); return AddGroup(groupName, NULL, retval);
@ -1654,7 +1654,7 @@ nsNNTPHost::AddGroup(char *groupName,
nsresult nsresult
nsNNTPHost::AddGroup(char *groupName, nsNNTPHost::AddGroup(const char *groupName,
nsMsgGroupRecord *inGroupRecord, nsMsgGroupRecord *inGroupRecord,
nsINNTPNewsgroup **retval) nsINNTPNewsgroup **retval)
{ {
@ -1932,7 +1932,7 @@ nsNNTPHost::RemoveGroup (nsINNTPNewsgroup *newsInfo)
} }
nsresult nsresult
nsNNTPHost::RemoveGroupByName(char* groupName) nsNNTPHost::RemoveGroupByName(const char* groupName)
{ {
nsINNTPNewsgroup *newsInfo = NULL; nsINNTPNewsgroup *newsInfo = NULL;
@ -2090,7 +2090,7 @@ PRBool nsNNTPHost::NeedsExtension (const char * /*extension*/)
} }
nsresult nsresult
nsNNTPHost::AddExtension (char *ext) nsNNTPHost::AddExtension (const char *ext)
{ {
PRBool alreadyHasExtension=FALSE; PRBool alreadyHasExtension=FALSE;
QueryExtension(ext, &alreadyHasExtension); QueryExtension(ext, &alreadyHasExtension);
@ -2104,7 +2104,7 @@ nsNNTPHost::AddExtension (char *ext)
} }
nsresult nsresult
nsNNTPHost::QueryExtension (char *ext, PRBool *retval) nsNNTPHost::QueryExtension (const char *ext, PRBool *retval)
{ {
*retval = PR_FALSE; *retval = PR_FALSE;
for (int i = 0; i < m_supportedExtensions.Count(); i++) for (int i = 0; i < m_supportedExtensions.Count(); i++)
@ -2116,7 +2116,7 @@ nsNNTPHost::QueryExtension (char *ext, PRBool *retval)
} }
nsresult nsresult
nsNNTPHost::AddSearchableGroup (char *group) nsNNTPHost::AddSearchableGroup (const char *group)
{ {
PRBool searchableGroup; PRBool searchableGroup;
nsresult rv = QuerySearchableGroup(group, &searchableGroup); nsresult rv = QuerySearchableGroup(group, &searchableGroup);
@ -2141,7 +2141,7 @@ nsNNTPHost::AddSearchableGroup (char *group)
} }
nsresult nsresult
nsNNTPHost::QuerySearchableGroup (char *group, PRBool *_retval) nsNNTPHost::QuerySearchableGroup (const char *group, PRBool *_retval)
{ {
*_retval = FALSE; *_retval = FALSE;
for (int i = 0; i < m_searchableGroups.Count(); i++) for (int i = 0; i < m_searchableGroups.Count(); i++)
@ -2171,7 +2171,7 @@ nsNNTPHost::QuerySearchableGroup (char *group, PRBool *_retval)
// ### mwelch This should have been merged into one routine with QuerySearchableGroup, // ### mwelch This should have been merged into one routine with QuerySearchableGroup,
// but with two interfaces. // but with two interfaces.
nsresult nsresult
nsNNTPHost::QuerySearchableGroupCharsets(char *group, char **result) nsNNTPHost::QuerySearchableGroupCharsets(const char *group, char **result)
{ {
// Very similar to the above, but this time we look up charsets. // Very similar to the above, but this time we look up charsets.
PRBool gotGroup = PR_FALSE; PRBool gotGroup = PR_FALSE;
@ -2204,7 +2204,7 @@ nsNNTPHost::QuerySearchableGroupCharsets(char *group, char **result)
} }
nsresult nsresult
nsNNTPHost::AddSearchableHeader (char *header) nsNNTPHost::AddSearchableHeader (const char *header)
{ {
PRBool searchable; PRBool searchable;
nsresult rv = QuerySearchableHeader(header, &searchable); nsresult rv = QuerySearchableHeader(header, &searchable);
@ -2218,7 +2218,7 @@ nsNNTPHost::AddSearchableHeader (char *header)
} }
nsresult nsresult
nsNNTPHost::QuerySearchableHeader(char *header, PRBool *retval) nsNNTPHost::QuerySearchableHeader(const char *header, PRBool *retval)
{ {
*retval=PR_FALSE; *retval=PR_FALSE;
for (int i = 0; i < m_searchableHeaders.Count(); i++) for (int i = 0; i < m_searchableHeaders.Count(); i++)
@ -2230,7 +2230,7 @@ nsNNTPHost::QuerySearchableHeader(char *header, PRBool *retval)
} }
nsresult nsresult
nsNNTPHost::AddPropertyForGet (char *property, char *value) nsNNTPHost::AddPropertyForGet (const char *property, const char *value)
{ {
char *tmp = NULL; char *tmp = NULL;
@ -2247,7 +2247,7 @@ nsNNTPHost::AddPropertyForGet (char *property, char *value)
} }
nsresult nsresult
nsNNTPHost::QueryPropertyForGet (char *property, char **retval) nsNNTPHost::QueryPropertyForGet (const char *property, char **retval)
{ {
*retval=NULL; *retval=NULL;
for (int i = 0; i < m_propertiesForGet.Count(); i++) for (int i = 0; i < m_propertiesForGet.Count(); i++)
@ -2356,7 +2356,7 @@ nsNNTPHost::GetPrettyName(char* groupname)
nsresult nsresult
nsNNTPHost::SetPrettyName(char* groupname, char* prettyname) nsNNTPHost::SetPrettyName(const char* groupname, const char* prettyname)
{ {
nsMsgGroupRecord* group = FindOrCreateGroup(groupname); nsMsgGroupRecord* group = FindOrCreateGroup(groupname);
if (!group) return MK_OUT_OF_MEMORY; if (!group) return MK_OUT_OF_MEMORY;
@ -2414,7 +2414,7 @@ nsNNTPHost::IsCategoryContainer(char* groupname)
} }
int int
nsNNTPHost::SetIsCategoryContainer(char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord) nsNNTPHost::SetIsCategoryContainer(const char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord)
{ {
nsresult rv; nsresult rv;
nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname);
@ -2472,7 +2472,7 @@ nsNNTPHost::SetIsCategoryContainer(char* groupname, PRBool value, nsMsgGroupReco
} }
nsresult nsresult
nsNNTPHost::SetGroupNeedsExtraInfo(char *groupname, PRBool value) nsNNTPHost::SetGroupNeedsExtraInfo(const char *groupname, PRBool value)
{ {
nsMsgGroupRecord* group = FindOrCreateGroup(groupname); nsMsgGroupRecord* group = FindOrCreateGroup(groupname);
if (!group) return MK_OUT_OF_MEMORY; if (!group) return MK_OUT_OF_MEMORY;
@ -2483,7 +2483,7 @@ nsNNTPHost::SetGroupNeedsExtraInfo(char *groupname, PRBool value)
char* char*
nsNNTPHost::GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord) nsNNTPHost::GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGroupRecord)
{ {
nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname);
if (group) { if (group) {
@ -2494,7 +2494,7 @@ nsNNTPHost::GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecor
} }
nsINNTPNewsgroup * nsINNTPNewsgroup *
nsNNTPHost::GetCategoryContainerFolderInfo(char *groupname) nsNNTPHost::GetCategoryContainerFolderInfo(const char *groupname)
{ {
nsINNTPNewsgroup *newsgroup=NULL; nsINNTPNewsgroup *newsgroup=NULL;
nsresult rv; nsresult rv;
@ -2517,7 +2517,7 @@ nsNNTPHost::GetCategoryContainerFolderInfo(char *groupname)
nsresult nsresult
nsNNTPHost::GetIsVirtualGroup(char* groupname, PRBool *retval) nsNNTPHost::GetIsVirtualGroup(const char* groupname, PRBool *retval)
{ {
nsMsgGroupRecord* group = FindOrCreateGroup(groupname); nsMsgGroupRecord* group = FindOrCreateGroup(groupname);
if (!group) { if (!group) {
@ -2530,12 +2530,12 @@ nsNNTPHost::GetIsVirtualGroup(char* groupname, PRBool *retval)
nsresult nsresult
nsNNTPHost::SetIsVirtualGroup(char* groupname, PRBool value) nsNNTPHost::SetIsVirtualGroup(const char* groupname, PRBool value)
{ {
return SetIsVirtualGroup(groupname, value, nsnull); return SetIsVirtualGroup(groupname, value, nsnull);
} }
nsresult nsresult
nsNNTPHost::SetIsVirtualGroup(char* groupname, PRBool value, nsNNTPHost::SetIsVirtualGroup(const char* groupname, PRBool value,
nsMsgGroupRecord* inGroupRecord) nsMsgGroupRecord* inGroupRecord)
{ {
nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname);
@ -2774,7 +2774,7 @@ nsNNTPHost::LoadSingleEntry(nsMsgGroupRecord* parent, char* groupname,
nsMsgGroupRecord* nsMsgGroupRecord*
nsNNTPHost::FindOrCreateGroup(char* groupname, nsNNTPHost::FindOrCreateGroup(const char* groupname,
int* statusOfMakingGroup) int* statusOfMakingGroup)
{ {
char buf[256]; char buf[256];
@ -2859,7 +2859,7 @@ nsNNTPHost::FindOrCreateGroup(char* groupname,
int int
nsNNTPHost::NoticeNewGroup(char* groupname, nsMsgGroupRecord **outGroupRecord) nsNNTPHost::NoticeNewGroup(const char* groupname, nsMsgGroupRecord **outGroupRecord)
{ {
int status = 0; int status = 0;
nsMsgGroupRecord* group = FindOrCreateGroup(groupname, &status); nsMsgGroupRecord* group = FindOrCreateGroup(groupname, &status);
@ -2922,7 +2922,7 @@ nsNNTPHost::AssureAllDescendentsLoaded(nsMsgGroupRecord* group)
} }
nsresult nsresult
nsNNTPHost::GroupNotFound(char *groupName, PRBool opening) nsNNTPHost::GroupNotFound(const char *groupName, PRBool opening)
{ {
// if no group command has succeeded, don't blow away categories. // if no group command has succeeded, don't blow away categories.
// The server might be wedged... // The server might be wedged...
@ -3091,7 +3091,7 @@ int nsNNTPHost::DeleteFiles ()
* (stolen from msgglue.cpp - MSG_NewsGroupAndNumberOfID) * (stolen from msgglue.cpp - MSG_NewsGroupAndNumberOfID)
*/ */
nsresult nsresult
nsNNTPHost::GetNewsgroupAndNumberOfID(char *message_id, nsNNTPHost::GetNewsgroupAndNumberOfID(const char *message_id,
nsINNTPNewsgroup **group, nsINNTPNewsgroup **group,
PRUint32 *messageNumber) PRUint32 *messageNumber)
{ {
@ -3119,10 +3119,10 @@ nsNNTPHost::GetNewsgroupAndNumberOfID(char *message_id,
/* this function originally lived in a pane /* this function originally lived in a pane
*/ */
nsresult nsresult
nsNNTPHost::AddNewNewsgroup(char *groupName, nsNNTPHost::AddNewNewsgroup(const char *groupName,
PRInt32 first, PRInt32 first,
PRInt32 last, PRInt32 last,
char *flags, const char *flags,
PRBool xactiveFlags) { PRBool xactiveFlags) {
nsMsgGroupRecord *groupRecord = NULL; nsMsgGroupRecord *groupRecord = NULL;
@ -3190,7 +3190,7 @@ nsNNTPHost::AddNewNewsgroup(char *groupName,
} }
nsresult nsresult
nsNNTPHost::DisplaySubscribedGroup(char *group, nsNNTPHost::DisplaySubscribedGroup(const char *group,
PRInt32 first_message, PRInt32 first_message,
PRInt32 last_message, PRInt32 last_message,
PRInt32 total_messages, PRInt32 total_messages,

Просмотреть файл

@ -37,7 +37,7 @@
class nsNNTPHostStub : public nsINNTPHost class nsNNTPHostStub : public nsINNTPHost
{ {
public: public:
nsNNTPHostStub(char *name, PRInt32 port); nsNNTPHostStub(const char *name, PRInt32 port);
virtual ~nsNNTPHostStub(); virtual ~nsNNTPHostStub();
@ -49,8 +49,8 @@ public:
NS_IMETHOD GetSupportsExtensions(PRBool *aSupportsExtensions); NS_IMETHOD GetSupportsExtensions(PRBool *aSupportsExtensions);
NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions); NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions);
NS_IMETHOD AddExtension (char *ext); NS_IMETHOD AddExtension (const char *ext);
NS_IMETHOD QueryExtension (char *ext, PRBool *_retval); NS_IMETHOD QueryExtension (const char *ext, PRBool *_retval);
NS_IMETHOD GetPostingAllowed(PRBool * aPostingAllowed); NS_IMETHOD GetPostingAllowed(PRBool * aPostingAllowed);
NS_IMETHOD SetPostingAllowed(PRBool aPostingAllowed); NS_IMETHOD SetPostingAllowed(PRBool aPostingAllowed);
@ -60,32 +60,32 @@ public:
NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate); NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate);
NS_IMETHOD GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval); NS_IMETHOD GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval);
NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id,
nsINNTPNewsgroup **group, nsINNTPNewsgroup **group,
PRUint32 *messageNumber); PRUint32 *messageNumber);
/* get this from MSG_Master::FindNewsFolder */ /* get this from MSG_Master::FindNewsFolder */
NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create,
nsINNTPNewsgroup **_retval) { return FindGroup(groupname, _retval);} nsINNTPNewsgroup **_retval) { return FindGroup(groupname, _retval);}
NS_IMETHOD AddPropertyForGet (char *property, char *value); NS_IMETHOD AddPropertyForGet (const char *property, const char *value);
NS_IMETHOD QueryPropertyForGet (char *property, char **_retval); NS_IMETHOD QueryPropertyForGet (const char *property, char **_retval);
NS_IMETHOD AddSearchableGroup(char *groupname); NS_IMETHOD AddSearchableGroup(const char *groupname);
// should these go into interfaces? // should these go into interfaces?
NS_IMETHOD QuerySearchableGroup (char *group, PRBool *); NS_IMETHOD QuerySearchableGroup (const char *group, PRBool *);
//NS_IMETHOD QuerySearchableGroupCharsets(char *group, char **); //NS_IMETHOD QuerySearchableGroupCharsets(char *group, char **);
// Virtual groups // Virtual groups
NS_IMETHOD AddVirtualGroup(char *responseText) { return NS_OK;} NS_IMETHOD AddVirtualGroup(const char *responseText) { return NS_OK;}
NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual); NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual);
NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval); NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval);
// custom/searchable headers // custom/searchable headers
NS_IMETHOD AddSearchableHeader(char *headerName); NS_IMETHOD AddSearchableHeader(const char *headerName);
NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval); NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval);
// Go load the newsrc for this host. Creates the subscribed hosts as // Go load the newsrc for this host. Creates the subscribed hosts as
// children of the given nsIMsgFolder. // children of the given nsIMsgFolder.
@ -108,21 +108,21 @@ public:
NS_IMETHOD SetNewsRCFilename(char *); NS_IMETHOD SetNewsRCFilename(char *);
NS_IMETHOD FindGroup(char* name, nsINNTPNewsgroup* *_retval); NS_IMETHOD FindGroup(const char* name, nsINNTPNewsgroup* *_retval);
NS_IMETHOD AddGroup(char *groupname, NS_IMETHOD AddGroup(const char *groupname,
nsINNTPNewsgroup **retval); nsINNTPNewsgroup **retval);
//NS_IMETHOD AddGroup(char *groupname, //NS_IMETHOD AddGroup(const char *groupname,
// nsMsgGroupRecord *groupRecord, // nsMsgGroupRecord *groupRecord,
// nsINNTPNewsgroup **retval); // nsINNTPNewsgroup **retval);
NS_IMETHOD RemoveGroupByName(char *groupName); NS_IMETHOD RemoveGroupByName(const char *groupName);
NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*); NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*);
NS_IMETHOD AddNewNewsgroup(char *groupName, NS_IMETHOD AddNewNewsgroup(const char *groupName,
PRInt32 first, PRInt32 first,
PRInt32 last, PRInt32 last,
char *flags, const char *flags,
PRBool xactiveFlags); PRBool xactiveFlags);
/* Name of directory to store newsgroup /* Name of directory to store newsgroup
@ -137,7 +137,7 @@ public:
individual strings must not be free'd. */ individual strings must not be free'd. */
NS_IMETHOD GetGroupList(char **_retval); NS_IMETHOD GetGroupList(char **_retval);
NS_IMETHOD DisplaySubscribedGroup(char *groupname, NS_IMETHOD DisplaySubscribedGroup(const char *groupname,
PRInt32 first_message, PRInt32 first_message,
PRInt32 last_message, PRInt32 last_message,
PRInt32 total_messages, PRInt32 total_messages,
@ -170,18 +170,18 @@ private:
// Returns the pretty name for the given group. The resulting string // Returns the pretty name for the given group. The resulting string
// must be free'd using delete[]. // must be free'd using delete[].
char* GetPrettyName(char* groupname) { return m_prettyName;} char* GetPrettyName(char* groupname) { return m_prettyName;}
NS_IMETHOD SetPrettyName(char* groupname, char* prettyname); NS_IMETHOD SetPrettyName(const char* groupname, const char* prettyname);
NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool value); NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool value);
// Finds the container newsgroup for this category (or NULL if this isn't // Finds the container newsgroup for this category (or NULL if this isn't
// a category). The resulting string must be free'd using delete[]. // a category). The resulting string must be free'd using delete[].
char* GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); char* GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord = NULL);
nsINNTPNewsgroup *GetCategoryContainerFolderInfo(char *groupname); nsINNTPNewsgroup *GetCategoryContainerFolderInfo(const char *groupname);
nsMsgGroupRecord* GetGroupTree() {return m_groupTree;} nsMsgGroupRecord* GetGroupTree() {return m_groupTree;}
NS_IMETHOD GroupNotFound(char *groupName, PRBool opening); NS_IMETHOD GroupNotFound(const char *groupName, PRBool opening);
protected: protected:
@ -246,7 +246,7 @@ protected:
NS_IMPL_ISUPPORTS(nsNNTPHostStub, nsINNTPHost::GetIID()); NS_IMPL_ISUPPORTS(nsNNTPHostStub, nsINNTPHost::GetIID());
nsNNTPHostStub::nsNNTPHostStub(char * name, PRInt32 port) nsNNTPHostStub::nsNNTPHostStub(const char * name, PRInt32 port)
{ {
NS_INIT_REFCNT(); NS_INIT_REFCNT();
m_supportsExtensions = PR_FALSE; m_supportsExtensions = PR_FALSE;
@ -276,13 +276,13 @@ nsresult nsNNTPHostStub::SetSupportsExtensions(PRBool aSupportsExtensions)
} }
nsresult nsNNTPHostStub::AddExtension(char * extension) nsresult nsNNTPHostStub::AddExtension(const char * extension)
{ {
printf("Adding extension: %s. \n", extension ? extension : "invalid extension"); printf("Adding extension: %s. \n", extension ? extension : "invalid extension");
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::QueryExtension(char * extension, PRBool * aRetValue) nsresult nsNNTPHostStub::QueryExtension(const char * extension, PRBool * aRetValue)
{ {
printf("Querying extension %s. \n", extension ? extension : "invalid extension"); printf("Querying extension %s. \n", extension ? extension : "invalid extension");
if (PL_strstr(extension, "SEARCH")) if (PL_strstr(extension, "SEARCH"))
@ -323,7 +323,7 @@ nsresult nsNNTPHostStub::SetPushAuth(PRBool aPushAuth)
} }
nsresult nsNNTPHostStub::AddPropertyForGet (char *property, char *value) nsresult nsNNTPHostStub::AddPropertyForGet (const char *property, const char *value)
{ {
char *tmp = NULL; char *tmp = NULL;
@ -341,12 +341,12 @@ nsresult nsNNTPHostStub::AddPropertyForGet (char *property, char *value)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::QueryPropertyForGet (char *property, char **retval) nsresult nsNNTPHostStub::QueryPropertyForGet (const char *property, char **retval)
{ {
*retval=NULL; *retval=NULL;
for (int i = 0; i < m_propertiesForGet.Count(); i++) for (int i = 0; i < m_propertiesForGet.Count(); i++)
if (!PL_strcasecmp(property, (char *) m_propertiesForGet[i])) { if (!PL_strcasecmp(property, (const char *) m_propertiesForGet[i])) {
*retval = (char *)m_valuesForGet[i]; *retval = (const char *)m_valuesForGet[i];
printf("Retrieving property %s for get. \n", *retval); printf("Retrieving property %s for get. \n", *retval);
return NS_OK; return NS_OK;
} }
@ -354,7 +354,7 @@ nsresult nsNNTPHostStub::QueryPropertyForGet (char *property, char **retval)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::AddSearchableGroup (char *group) nsresult nsNNTPHostStub::AddSearchableGroup (const char *group)
{ {
PRBool searchableGroup; PRBool searchableGroup;
nsresult rv = QuerySearchableGroup(group, &searchableGroup); nsresult rv = QuerySearchableGroup(group, &searchableGroup);
@ -379,7 +379,7 @@ nsresult nsNNTPHostStub::AddSearchableGroup (char *group)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::QuerySearchableGroup (char *group, PRBool *_retval) nsresult nsNNTPHostStub::QuerySearchableGroup (const char *group, PRBool *_retval)
{ {
*_retval = PR_FALSE; *_retval = PR_FALSE;
for (int i = 0; i < m_searchableGroups.Count(); i++) for (int i = 0; i < m_searchableGroups.Count(); i++)
@ -406,18 +406,18 @@ nsresult nsNNTPHostStub::QuerySearchableGroup (char *group, PRBool *_retval)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::SetIsVirtualGroup(char * groupname, PRBool isVirtual) nsresult nsNNTPHostStub::SetIsVirtualGroup(const char * groupname, PRBool isVirtual)
{ {
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::GetIsVirtualGroup(char * groupname, PRBool * isVirtual) nsresult nsNNTPHostStub::GetIsVirtualGroup(const char * groupname, PRBool * isVirtual)
{ {
*isVirtual = PR_FALSE; *isVirtual = PR_FALSE;
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::AddSearchableHeader (char *header) nsresult nsNNTPHostStub::AddSearchableHeader (const char *header)
{ {
PRBool searchable; PRBool searchable;
nsresult rv = QuerySearchableHeader(header, &searchable); nsresult rv = QuerySearchableHeader(header, &searchable);
@ -432,7 +432,7 @@ nsresult nsNNTPHostStub::AddSearchableHeader (char *header)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::QuerySearchableHeader(char *header, PRBool *retval) nsresult nsNNTPHostStub::QuerySearchableHeader(const char *header, PRBool *retval)
{ {
*retval=PR_FALSE; *retval=PR_FALSE;
for (int i = 0; i < m_searchableHeaders.Count(); i++) for (int i = 0; i < m_searchableHeaders.Count(); i++)
@ -443,16 +443,16 @@ nsresult nsNNTPHostStub::QuerySearchableHeader(char *header, PRBool *retval)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::GroupNotFound(char *groupName, PRBool opening) nsresult nsNNTPHostStub::GroupNotFound(const char *groupName, PRBool opening)
{ {
printf("Group %s not found. \n", groupName); printf("Group %s not found. \n", groupName);
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::AddNewNewsgroup(char *groupName, nsresult nsNNTPHostStub::AddNewNewsgroup(const char *groupName,
PRInt32 first, PRInt32 first,
PRInt32 last, PRInt32 last,
char *flags, const char *flags,
PRBool xactiveFlags) PRBool xactiveFlags)
{ {
printf ("Adding new newsgroup: %s. \n", groupName); printf ("Adding new newsgroup: %s. \n", groupName);
@ -496,7 +496,7 @@ nsresult nsNNTPHostStub::GetFirstGroupNeedingCounts(char ** aFirstGroup)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::DisplaySubscribedGroup(char * groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, nsresult nsNNTPHostStub::DisplaySubscribedGroup(const char * groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages,
PRBool visit_now) PRBool visit_now)
{ {
printf("Displaying subscribed group %s which has %d total messages. \n", groupname, total_messages); printf("Displaying subscribed group %s which has %d total messages. \n", groupname, total_messages);
@ -536,18 +536,18 @@ nsresult nsNNTPHostStub::GetFirstGroupNeedingExtraInfo(char ** retval)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::SetGroupNeedsExtraInfo(char * groupName, PRBool needsExtraInfo) nsresult nsNNTPHostStub::SetGroupNeedsExtraInfo(const char * groupName, PRBool needsExtraInfo)
{ {
printf("Setting group %s to need extra info.\n", groupName); printf("Setting group %s to need extra info.\n", groupName);
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::GetNewsgroupAndNumberOfID(char *messageID, nsINNTPNewsgroup ** group, PRUint32 * messageNumber) nsresult nsNNTPHostStub::GetNewsgroupAndNumberOfID(const char *messageID, nsINNTPNewsgroup ** group, PRUint32 * messageNumber)
{ {
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::SetPrettyName(char * groupname, char * prettyname) nsresult nsNNTPHostStub::SetPrettyName(const char * groupname, const char * prettyname)
{ {
printf("Setting group %s to have pretty name %s. \n", groupname, prettyname); printf("Setting group %s to have pretty name %s. \n", groupname, prettyname);
return NS_OK; return NS_OK;
@ -576,7 +576,7 @@ nsresult nsNNTPHostStub::MarkDirty()
} }
#if 0 #if 0
nsresult nsNNTPHostStub::GetNewsRCFilename(char ** aNewsRCFileName) nsresult nsNNTPHostStub::GetNewsRCFilename(const char ** aNewsRCFileName)
{ {
if (aNewsRCFileName) if (aNewsRCFileName)
*aNewsRCFileName = "temp.rc"; *aNewsRCFileName = "temp.rc";
@ -590,7 +590,7 @@ nsresult nsNNTPHostStub::SetNewsRCFilename(char * fileName)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval) nsresult nsNNTPHostStub::GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
// find group with the group name... // find group with the group name...
@ -605,7 +605,7 @@ nsresult nsNNTPHostStub::GetNewsgroupList(char *groupname, nsINNTPNewsgroupList
return rv; return rv;
} }
nsresult nsNNTPHostStub::FindGroup(char * name, nsINNTPNewsgroup ** retVal) nsresult nsNNTPHostStub::FindGroup(const char * name, nsINNTPNewsgroup ** retVal)
{ {
PRBool found = PR_FALSE; PRBool found = PR_FALSE;
*retVal = nsnull; *retVal = nsnull;
@ -637,7 +637,7 @@ nsresult nsNNTPHostStub::FindGroup(char * name, nsINNTPNewsgroup ** retVal)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::AddGroup(char *groupname, nsINNTPNewsgroup **retval) nsresult nsNNTPHostStub::AddGroup(const char *groupname, nsINNTPNewsgroup **retval)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
printf ("Adding group %s to host.\n", groupname); printf ("Adding group %s to host.\n", groupname);
@ -677,7 +677,7 @@ nsresult nsNNTPHostStub::RemoveGroup(nsINNTPNewsgroup * group)
return NS_OK; return NS_OK;
} }
nsresult nsNNTPHostStub::RemoveGroupByName(char *groupName) nsresult nsNNTPHostStub::RemoveGroupByName(const char *groupName)
{ {
printf ("Removing group %s. \n", groupName); printf ("Removing group %s. \n", groupName);
return NS_OK; return NS_OK;

Просмотреть файл

@ -50,9 +50,9 @@ class nsNNTPNewsgroupListStub : public nsINNTPNewsgroupList {
NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message); NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message);
NS_IMETHOD ProcessXOVER(char *line, PRInt32 *status); NS_IMETHOD ProcessXOVER(const char *line, PRInt32 *status);
NS_IMETHOD ProcessNonXOVER(char *line); NS_IMETHOD ProcessNonXOVER(const char *line);
NS_IMETHOD ResetXOVER(); NS_IMETHOD ResetXOVER();
NS_IMETHOD FinishXOVER(PRInt32 status, PRInt32 *newstatus); NS_IMETHOD FinishXOVER(PRInt32 status, PRInt32 *newstatus);
@ -222,7 +222,7 @@ nsresult nsNNTPNewsgroupListStub::InitXOVER(PRInt32 first_msg, PRInt32 last_msg)
#define NEWS_ART_DISPLAY_FREQ 10 #define NEWS_ART_DISPLAY_FREQ 10
nsresult nsNNTPNewsgroupListStub::ProcessXOVER(char *line, int *status) nsresult nsNNTPNewsgroupListStub::ProcessXOVER(const char *line, int *status)
{ {
const char *next; const char *next;
PRUint32 message_number=0; PRUint32 message_number=0;
@ -288,7 +288,7 @@ nsNNTPNewsgroupListStub::ResetXOVER()
slow anyway that this just doesn't matter. slow anyway that this just doesn't matter.
*/ */
nsresult nsNNTPNewsgroupListStub::ProcessNonXOVER (char * /*line*/) nsresult nsNNTPNewsgroupListStub::ProcessNonXOVER (const char * /*line*/)
{ {
// ### dmb write me // ### dmb write me
return NS_OK; return NS_OK;