Skip to content

Commit

Permalink
Flushed out a bit of the module api.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Samith Bysani committed Jan 5, 2009
1 parent f01ce8e commit ec108c6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -39,7 +39,7 @@ MODULES=test-module.so libbang.so

all: $(EXENAME) $(LIBRARIES)

$(EXENAME): $(LOBJS) $(AOBJS)
$(EXENAME): $(LSRC) $(ASRC)
$(CC) $(COPTS) $(GTKOPTS) $^ -o $(EXENAME)

$(AOBJS): $(ASRC)
Expand Down
22 changes: 22 additions & 0 deletions src/base/bang-module-api.h
Expand Up @@ -16,6 +16,25 @@
*/
void BANG_debug_on_all_peers(char *message);

/**
* \brief Tries to get a module as many peers as possible.
*/
void BANG_get_me_peers();

/**
* \return Retuns the number of peers currently active. (Peers being peers
* who are running your module.
*/
int BANG_number_of_active_peers();

/**
* \return Returns your peer number. (This is not a peer_id, it is a number
* to identify you to peers running the module).
*
* Discussion: Should this number be passed to the init function?
*/
int BANG_get_my_id();

/**
* The api for the modules to use.
*/
Expand All @@ -24,5 +43,8 @@ typedef struct {
* Refrence to BANG_debug_on_all_peers.
*/
void (*BANG_debug_on_all_peers) (char *message);
void (*BANG_get_me_peers) ();
int (*BANG_number_of_active_peers) ();
int (*BANG_get_my_id) ();
} BANG_api;
#endif

0 comments on commit ec108c6

Please sign in to comment.