Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  


Pages: [1]   Go Down

Author Topic: New module API...  (Read 5540 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
New module API...
« on: June 11, 2007, 04:28:47 PM »

I am just starting module programming for Anope, so I am by no means versed in it. But I did have an idea for modules.

I know that the core Anope has functions for opening, closing, and manipulating .db files that should be used with Anope (nick.db, chan.db, oper.db, etc). I must say I was disappointed that there isn't a module API for this.

I believe it would be better to provide an API for this rather than making each module handle the situation on their own. Point in case, hs_request.c in the src/modules dir. It uses its own .db, which is clearly related to Anope, but it has to do its own leg work. This ultimately leads to duplicate code in the modules (to an extent) due to each module having to do the same things over and over. A module API for this would not only eliminate this duplicate code, it would (most likely) improve performance for modules, as all .db access/manipulations would come from the same source which could control read/write access and file locking.


Pieter Bootsma

  • Team
  • *
  • Offline Offline
  • Posts: 189
(No subject)
« Reply #1 on: June 11, 2007, 06:02:01 PM »

We are aware of this and are looking into providing a single API shared between both the core and modules for after the big 1.8 release. Do note that it could take quite some time before this is implemented properly...

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #2 on: June 11, 2007, 06:45:42 PM »

My concern as a mod dev is that the current internal anope database code is not flexable enough, this is why there have been issues with adding new fields

In Denora we wrote a database system that is more flex to it. we can add fields at will, reorder them and not cause problems.. since that was done I have been using the same db code in my modules

What Anope really needs is a better API period.

1. Clean up extern.h (damm thing is ugly and filled with numerous functions that probably don't need to be there)
2. Move any last static declarations out of the core so that the they can be worked on from modules (news.c is the biggest offender)
3. IRCD all Umodes need to be accessible from core and modules (suggestion was placed in bugtracker)
4. Create a wrapper layer for the following items
    - Database creation/reading/writting (list can be longer but don't care to type it all out)
    - psuedo clients - creating - join, privmsg hooks (this is where helpserv should be out of the core)
    - Obtaining data without understanding the structs (biggest problem for new coders)
5. Publish this api so new coders can understand it, wiki or something

I could go on and on.. and this could turn into a flame war.. or if someone was interested in helping I will kick off the work with a sample tonight and you decide..
my God my tourniquet, return to me salvation


  • Guest
(No subject)
« Reply #3 on: June 13, 2007, 06:51:51 AM »

I agree whole heartedly. I only have two things stopping me from saying yes to helping.

Lack of knowledge of Anope itself.

Lack of time.

I hope to have more time very soon to work on projects like this. So maybe in a few weeks I will be able to say yes.

Thanks for the response.

Pages: [1]   Go Up