Commit Graph

17 Commits

Author SHA1 Message Date
Kevin Easton
61a926a766 Introduce a struct dcc_ops to contain all functions pointers for a custom DCC type
Modules now must pass a pointer to a struct dcc_ops when calling add_dcc_bind() instead of
a list of function pointers.
2018-02-08 22:39:49 +11:00
Kevin Easton
d7688075b6 Export dcc_chat_socketread() and dcc_send_socketread() callbacks to modules
The idea here is that if you have a module which implements a new DCC type that is essentially
a lightly-modified version of CHAT or SEND you can reuse these functions.
2017-12-20 17:36:05 +11:00
Kevin Easton
3800e4b099 Replace get_server_flag() with get_server_umode()
This function gets the status of a single umode flag identified by umode char rather than
internal server flag number.

This also lets us remove all the USER_MODE* constants because they're no longer required.

Invert the sense of the +w check in e_wall() - we only echo our OPERWALL if we're *not* +w,
because if we are +w then the server will echo it back to us anyway.
2017-12-07 00:23:43 +11:00
Kevin Easton
1769c03951 Replace set_server_flag() with update_server_umode() and remove get_possible_umodes()
The idea here is not to expose the internal server implementation for storing umodes,
but instead have callers just work in terms of umode characters.

The 'possible umodes' have always been the same for all servers anyway.  We just assume
that [a-zA-Z] is the bounding set.
2017-12-06 23:30:24 +11:00
Kevin Easton
a60937a8fd Move dll_commands and find_dll_command from commands.c to modules.c
Kind of where it belongs.
2017-11-27 20:07:28 +11:00
Kevin Easton
ba1b9742ec Simplify calling of rsindex() and strsearch()
Remove the 'how' parameter to rsindex(), making it reverse-search for only the first matching character,
as sindex() already does.  There are only two callers, and one already passed a hardcoded value of 1.

Also change rsindex() so that it starts searching at the character BEFORE the passed in position.  This
makes it easier to repeatedly call rsindex() in a loop to search for the Nth matching character, and
also fixes a technical instance of undefined behaviour where a pointer is decremented to point before
the start of the string.

Remove the 'mark' parameter to strsearch().  Instead, always forward-search from the beginning of the
string and reverse-search from the end of the string, as this is what the two callers want anyway.

Bump the module ABI version because these functions are exported to modules.
2017-11-23 17:22:38 +11:00
Kevin Easton
fea88185f8 Clean up function move_to_abs_word() and rename to move_to_word()
Remove the output argument, as it's the same as the function return value anyway, so
the callers should just use that.
2017-11-14 23:15:33 +11:00
Kevin Easton
50999b3d5b Remove six dll_ variables from the module exports table
The removed variables are:

	dll_functions
	dll_numeric
	dll_commands
	dll_variable
	dll_ctcp
	dll_window

These are not actually directly used by any modules, and hiding them allows us to more easily
change their implementation later.
2017-11-06 17:14:12 +11:00
Kevin Easton
3f047ab2a9 Add save_dllvar() function exported to modules
This helper function is for modules to save the contents of their module variables to a file
as SET commands.

It will remove the need to export the raw dll_variable list to modules.
2017-11-06 16:54:51 +11:00
Kevin Easton
0fea2b97a4 Remove exported function create_server_list()
The guts of this function doesn't need to be in server.c - it only uses extern server functions so it
makes sense just to move it into the body of function_servers(), the only caller.

That means it's no longer accessible for loadable modules, but it isn't much use for them anyway.  They
can always directly access the server list if they need that info.

(Requires rolling the module table version).
2017-07-17 12:59:49 +10:00
Kevin Easton
bb616e0626 Change send_text() to combine command, hook and log arguments into one set of flags
This function is exported to modules, so it requires updating a few modules and rolling the module table version.
2017-07-09 00:08:04 +10:00
Kevin Easton
6b1fcf9c75 Add sent_nick flag to NickList struct, bump MODULE_VERSION
This flag is for tracking if we've sent a KICK for a nick.  It means we can avoid
sending duplicate KICKs (eg for floods, channel protection etc).

MODULE_VERSION is bumped because NickList is a struct exported to modules.
2017-06-11 00:08:07 +10:00
Kevin Easton
3f87eb31b1 Standardise header include guards
Tokens that begin with two underscores __* or an underscore and an uppercase letter _X* are reserved,
so we should avoid those for our own include guards.  The standard I'm settling on for foo.h is FOO_H_.
2017-05-10 23:30:11 +10:00
Kevin Easton
789ed916cd Backport changes from epic5 to make recv_nick, sent_nick and sent_body
per-server, and apply new version of do_oops from flewid (the BX2 version). 

This means that /oops, "/query .", "/query ,", "/msg ." and "/msg ," are now
per-server, along with the $. $, and $B aliases.



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@87 13b04d17-f746-0410-82c6-800466cd88b0
2010-06-26 08:18:34 +00:00
Kevin Easton
285b02c36a Add $ishalfop(<nick> <channel>) scripting function, as per EPIC.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@34 13b04d17-f746-0410-82c6-800466cd88b0
2008-05-07 08:48:49 +00:00
Kevin Easton
3de93b1dbc Far-reaching changes to make BitchX compatible with 64 bit architectures
like x86-64, where sizeof(int) != sizeof (void *).  This involves correctly
casting every function pointer from the global table to the correct
function type, which has the added benefit of allowing type-checking of
function arguments and return values.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@26 13b04d17-f746-0410-82c6-800466cd88b0
2008-04-30 13:57:56 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00