Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/inferno/appl/cmd/Ltheme/irc.m

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Ircdata: module { # irc.b
	PATH: con "/usr/maht/Ltheme/irc.dis";

	Post: adt {
		issuing_nick : string;
		issuer : ref User;
		target : ref User;
		command : string;
		args : array of string;
		print: fn(post : self ref Post);
	};

	User: adt {
		nick, user, host, vhost, ip,gcos, server: string;
		logged_in : int;
		registered : int;
		copy: fn(user: self ref User) : ref User;
		print : fn(user: self ref User);
	};

	Channel : adt {
		name : string;
	};

	Func: type fn (service: ref Service, users : ref Users, post:  ref Post) : int;

	Command : adt {
		name : string;
		func : ref Func;
	};

	Service : adt {
		name : string;
		nick: string;
		out: chan of string;
		c : array of list of ref Command;
		find_command: fn(service: self ref Service, name: string) : ref Command;
		add_command: fn(service: self ref Service, name: string, func: ref Func) : ref Command;
		
	};

	Users : adt {
		u: array of list of ref User;
		find: fn(users: self ref Users, nick : string): ref User;
		add: fn(users: self ref Users, nick: string): ref User;
		find_or_add: fn(users: self ref Users, nick : string): ref User;
		log_in: fn(users: self ref Users, service: ref Service, nick : string) : ref User;
		log_out: fn(users: self ref Users, service: ref Service, nick : string);
		verify_password: fn(users: self ref Users, nick, password : string) : int;
	};

	Services : adt {
		s: list of ref Service;
		find: fn(services: self ref Services, nick : string): ref Service;
		add: fn(services: self ref Services, nick : string, out : chan of string): ref Service;
	};	

	new_users: fn(size:int): ref Users;
	new_post: fn(data: string): ref Post;
	identify: fn(service: ref Service, users : ref Users, post:  ref Post) : int;
	nick: fn(service: ref Service, users : ref Users, post:  ref Post) : int;

};

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.