Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: os_extrainfo keeps telling me usage-syntax  (Read 4853 times)

0 Members and 1 Guest are viewing this topic.

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
os_extrainfo keeps telling me usage-syntax
« on: August 19, 2007, 12:22:48 PM »

as i read the documentation on the module, i think you have wrong expectations :)
as i understand it, the only params it accepts are nickname and channel and not an actual nickname or channel name...
also sounds logical since the modules' description says it gives general information on the number of nicknames/channels registered, forbidden etc and not nickname specific info..
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

SNU

  • Anope User
  • Offline Offline
  • Posts: 158
    • http://www.firstclassirc.com
(No subject)
« Reply #1 on: August 19, 2007, 02:07:38 PM »

oh... I thought the whole thead will be deleted.

Yeah doubtless, Viper, you're right. Did not get the point this morning ^^ heh. But maybe you agree its a bit confusing.

(now I deleted my initial posting thinking the thread will be gone then, but vipers answer kept being here, so I shortly summarize: I installed that module and did "/msg oprserv info SNU" and got the answer that I use the wrong syntax. Now viper remembred me that this module can't show user/channelspecific informations, so dont replace "nickname" by a nickname, just type nickname OR channel :D )
Logged

katsklaw

  • Guest
(No subject)
« Reply #2 on: August 19, 2007, 06:01:56 PM »

The syntax does seem to be a bit fuzzy. It's probably better to be more specific such as: Syntax: INFO nicks|chans
Logged

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
(No subject)
« Reply #3 on: August 20, 2007, 08:44:28 AM »

Yeh correct, so i changed the nickname and channel param to nickserv and chanserv ^^
http://modules.anope.org/viewmod.php?id=103
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #4 on: August 20, 2007, 10:53:49 AM »

I can't use the command without causing a segfault....
As for the cause.... it s quite obvious :)

Code: [Select]
char *param = moduleGetLastBuffer();
...
if (param)
  free(param);


moduleGetLastBuffer() returns a pointer to a copy of the complete last buffer. This copy  should never be messed with though, nor free()'d.

Quote
/**
 * Return a copy of the complete last buffer.
 * This is needed for modules who cant trust the strtok() buffer,
 * as we dont know who will have already messed about with it.
 * @reutrn a pointer to a copy of the last buffer - DONT mess
 * with this, copy if first if you must do things to it.
 **/
char *moduleGetLastBuffer(void);

[Edited on 20-8-2007 by Viper]
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
(No subject)
« Reply #5 on: August 20, 2007, 01:16:24 PM »

Yay! thanks a lot. Here's a vanilla ice cream for ya
[align=center][/align]
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

katsklaw

  • Guest
(No subject)
« Reply #6 on: August 21, 2007, 12:16:55 AM »

What I do with moduleGetLastBuffer like this and it seems to work well, never free()'d as Viper says:


       text = moduleGetLastBuffer();
           if (text) {
                        cmd = myStrGetToken(text, ' ', 0);
                        text = myStrGetToken(text, ' ', 1);
            if (strcasecmp(cmd, "BASIC") == 0) {
Logged
Pages: [1]   Go Up