services.h 17.8 KB
Newer Older
Linus Tolke's avatar
Linus Tolke committed
1
/*
David Byers's avatar
David Byers committed
2
 * $Id: services.h,v 0.45 1999/05/18 13:06:27 byers Exp $
Per Cederqvist's avatar
Per Cederqvist committed
3
 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996  Lysator Academic Computer Association.
Linus Tolke's avatar
Linus Tolke committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *
 * This file is part of the LysKOM server.
 * 
 * LysKOM is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 1, or (at your option) 
 * any later version.
 * 
 * LysKOM is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with LysKOM; see the file COPYING.  If not, write to
 * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
 * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
 * MA 02139, USA.
 *
 * Please mail bug reports to bug-lyskom@lysator.liu.se. 
 */
Per Cederqvist's avatar
.  
Per Cederqvist committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 *  services.h  --  All the services the LysKOM server makes available
 *		    for clients.
 *
 *  Requires kom-types.h
 *
 *  Created by ceder 1990-03-23
 */


#ifndef  _SERVICES_H_ALREADY_INCLUDED__
#define  _SERVICES_H_ALREADY_INCLUDED__


#if defined (CLIENT)
#	if defined (SERVER)
#		error Both CLIENT and SERVER defined!
#	endif
#	define	KOM_(function)		kom_ ## function
#	define	CONST			const
#elif defined (SERVER)
#	define	KOM_(function)		function
#	define	CONST
#else
#	error	Neither CLIENT nor SERVER defined!
#endif




/*
 * Session control
 */
#ifdef CLIENT
extern  Success
KOM_( open_connection (const char	* server ));

extern  void
KOM_( set_storage_management (malloc_function	new_malloc,
			      realloc_function	new_realloc,
			      free_function	new_free));

#endif


70
71
72
73
extern  Success
KOM_( login_old (Pers_no	person,
		 const String	passwd ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
74
75
extern  Success
KOM_( login (Pers_no		person,
76
77
	     const String	passwd,
	     Bool		invisible));
Per Cederqvist's avatar
.  
Per Cederqvist committed
78
79
80
81
82
83

extern  Success
KOM_( logout (void));	/* can never fail */

/* Change Conference */
extern  Success
84
KOM_( change_conference (Conf_no conference));
Per Cederqvist's avatar
.  
Per Cederqvist committed
85
86
87
88
89
90
91
92
93
94


/* Change name of a person or conference. */
extern  Success
KOM_( change_name (Conf_no	  conf_no,
		   const String	  new_name));

extern  Success
KOM_( change_what_i_am_doing (CONST String  what_am_i_doing ));

95
96
97
98
99
100
101
102
103
104
105
106
/* Client version: one call to set, two to retrieve. */
extern  Success
KOM_( set_client_version (const String client_name,
			  const String client_version));

extern  Success
KOM_( get_client_name (Session_no session_no,
		       String *result));

extern  Success
KOM_( get_client_version (Session_no session_no,
			  String *result));
Per Cederqvist's avatar
.  
Per Cederqvist committed
107
108
109
110
111
112
113

/* Get info about a session */

extern  Success
KOM_( get_session_info  (Session_no session_no,
			 Session_info *result) );

114
115
116
117
extern  Success
KOM_( get_session_info_ident  (Session_no session_no,
			       Session_info_ident *result) );

Per Cederqvist's avatar
Per Cederqvist committed
118
119
120
121
extern  Success
KOM_( get_static_session_info (Session_no session_no,
			       Static_session_info *result) );

Per Cederqvist's avatar
.  
Per Cederqvist committed
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
 * Disconnect a session. You can disconnect your own session (even if
 * you are not logged in) and any session where you are supervisor of
 * the user that is logged in on that session.
 */
extern  Success
KOM_( disconnect (Session_no session_no));

/*
 * Returns your session number
 */
extern  Success
KOM_( who_am_i (Session_no *session_no));

Per Cederqvist's avatar
Per Cederqvist committed
136
137
138
139
140
141
/*
 * Set state in the session
 */

extern  Success
KOM_( user_active (void));
Per Cederqvist's avatar
.  
Per Cederqvist committed
142
143
144
145
146
147
148
149
150

/******************************
*     Person-related calls    *
******************************/

/*
 *  Create a new person.  Returns 0 if any error occured.
 */
extern  Pers_no
151
152
153
154
155
156
KOM_( create_person_old (const String  name,
                         const String  passwd ));

extern Pers_no
KOM_( create_person (const String name,
                     const String passwd,
David Byers's avatar
David Byers committed
157
                     Personal_flags flags,
158
                     Aux_item_list *conf_aux ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
159
160


David Byers's avatar
David Byers committed
161
162
163
164
extern Success
set_pers_flags(Pers_no pers_no,
               Personal_flags flags);

Per Cederqvist's avatar
.  
Per Cederqvist committed
165
166
167
/* Obsolete call; use get_person_stat instead. */
extern  Success
KOM_( get_person_stat_old (Pers_no		  person,
168
169
                             int		  mask,
                             Person		* result ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
170
171
172

extern  Success
KOM_( get_person_stat (Pers_no		  person,
173
                       Person		* result ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
174
175
176
177

extern  Success
KOM_( get_created_texts (Pers_no	  person,
			 Local_text_no	  first,
178
			 unsigned long	  no_of_texts,
179
			 L2g_iterator    *created_texts ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
180

181
182
183
184
185
186
extern  Success
KOM_( map_created_texts (Pers_no	  person,
			 Local_text_no	  first,
			 unsigned long	  no_of_texts,
			 Text_mapping    *created_texts ));

187
188
189
190
191
192
193
extern  Success
KOM_( get_membership_old (Pers_no		  person,
                          unsigned short	  first,
                          unsigned short	  no_of_confs,
                          Bool			  want_read_texts,
                          Membership_list	* memberships ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
194
195
extern  Success
KOM_( get_membership (Pers_no		  person,
196
197
		      unsigned short	  first,
		      unsigned short	  no_of_confs,
Per Cederqvist's avatar
.  
Per Cederqvist committed
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
		      Bool		  want_read_texts,
		      Membership_list	* memberships ));

extern  Success
KOM_( set_priv_bits (Pers_no	person,
		     Priv_bits	privileges ));


/*  Set the password of PERSON to NEW_PWD.  OLD_PWD is the password
 *  of the person who does the set.  This is not necessarily the
 *  same as the one who gets it set.	*/
extern  Success
KOM_( set_passwd (Pers_no	 person,
		  const String   old_pwd,
		  const String   new_pwd ));


/* You can query for unread texts without logging in. */
216
217
218
219
220
extern  Success
KOM_( query_read_texts_old (Pers_no	     pers_no,
                            Conf_no	     conf_no,
                            Membership	   * result   ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
221
222
223
extern  Success
KOM_( query_read_texts (Pers_no	     pers_no,
			Conf_no	     conf_no,
224
			Membership * result   ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241


extern Success
KOM_( get_unread_confs(Pers_no       pers_no,
		       Conf_no_list *result));

extern Success
KOM_( set_user_area(Pers_no	pers_no,
		    Text_no	user_area));


/****************************************
*	Conference-related calls	*
****************************************/


extern  Conf_no
242
243
244
245
246
247
248
249
250
251
252
253
KOM_( create_conf_old (const String	  name,
                       Conf_type	  type ));

extern Conf_no
KOM_( create_conf (const String name,
                   Conf_type type,
                   Aux_item_list *aux ));

extern Success
KOM_ ( modify_conf_info (Conf_no conf_no,
                         Number_list *items_to_delete,
                         Aux_item_list *items_to_add));
Per Cederqvist's avatar
.  
Per Cederqvist committed
254
255
256
257
258
259
260
261
262
263


/*  Delete a conference.  Also used to delete persons.  */
extern  Success
KOM_( delete_conf (Conf_no	conf ));


/*
 *  Map conference name to number.  Returns a list of the conferences
 *  that match the name NAME. Can be done without logging in.
264
 * This should be phased out.
Per Cederqvist's avatar
.  
Per Cederqvist committed
265
266
267
268
269
270
271
272
273
274
275
 */
#ifdef SERVER
extern  Success
KOM_( lookup_name (const String	 name,
		   Conf_list_old *result));
#else
extern  Success
KOM_( lookup_name (const String	 name,
		   Conf_list	*result));
#endif

276
277
278
279
280
281
extern Success
KOM_( lookup_z_name (const String name,
		     int want_persons,
		     int want_confs,
		     Conf_z_info_list *result));

282
283
284
285
286
287
288
289
290
/* Use these two lookup-calls instead of lookup_name */
extern  Success
KOM_( lookup_person (const String  pattern,
		     Conf_no_list  *result));

extern  Success
KOM_( lookup_conf (const String  pattern,
		   Conf_no_list  *result));

291
292
293
294
295
296
297
298
299
/* Two functions for matching regexps. */
extern  Success
KOM_( re_lookup_person (const String  regexp,
			Conf_no_list  *result));

extern  Success
KOM_( re_lookup_conf (const String  regexp,
		      Conf_no_list  *result));

300
301
302
303
304
305
extern  Success
KOM_( re_z_lookup (const String  regexp,
		   int want_persons,
		   int want_confs,
		   Conf_z_info_list *result));

306
307
308
309
310
311
312
313
extern Success
KOM_( get_collate_table (String * result));

extern  Success
KOM_( get_conf_stat_older (Conf_no	conf_no,
                           int		mask,
                           Conference   * result ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
314
extern  Success
315
316
KOM_( get_conf_stat_old (Conf_no		  conf_no,
                         Conference		* result ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
317
318
319
320
321

extern  Success
KOM_( get_conf_stat (Conf_no		  conf_no,
		     Conference		* result ));

322
323
324
325
extern Success
KOM_( get_uconf_stat (Conf_no		  conf_no,
		      Small_conf	* result));

Per Cederqvist's avatar
.  
Per Cederqvist committed
326
327
extern  Success
KOM_( get_members (Conf_no	  conf,
328
329
		   unsigned short first,
		   unsigned short no_of_members,
330
331
332
333
334
335
336
337
		   Member_list	* members
    ));

extern  Success
KOM_( get_members_old (Conf_no	  conf,
                       unsigned short first,
                       unsigned short no_of_members,
                       Member_list	* members	));
Per Cederqvist's avatar
.  
Per Cederqvist committed
338
339
340
341
342



/* add_member is also used to change the priority of a conference */
extern  Success
343
344
345
KOM_( add_member (Conf_no		conf_no,
		  Pers_no		pers_no,
		  unsigned char		priority,
346
347
348
349
350
351
352
353
354
355
356
357
358
		  unsigned short	where, /* Range of where is [0..] */
                  Membership_type       * type ));

extern  Success
KOM_( add_member_old (Conf_no		conf_no,
                      Pers_no		pers_no,
                      unsigned char	priority,
                      unsigned short	where	)); /* Range of where is [0..] */

extern Success
KOM_( set_membership_type (Pers_no      pers_no,
                           Conf_no      conf_no,
                           Membership_type *type   ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
359
360
361
362
363
364
365
366
367
368


extern  Success
KOM_( sub_member (Conf_no	conf_no,
		  Pers_no	pers_no ));


/*
 * Tell the server that I want to mark/unmark texts as read so that I
 * get no_of_unread unread texts in conf_no.
Kent Engström's avatar
Kent Engström committed
369
370
371
 *
 * The new alternative function marks last_read as the last read local
 * text. Use this one to avoid race conditions.
Per Cederqvist's avatar
.  
Per Cederqvist committed
372
 */
Kent Engström's avatar
Kent Engström committed
373

Per Cederqvist's avatar
.  
Per Cederqvist committed
374
375
376
377
extern  Success
KOM_( set_unread (Conf_no   conf_no,
		  Text_no   no_of_unread));

Kent Engström's avatar
Kent Engström committed
378
379
extern  Success
KOM_( set_last_read (Conf_no   conf_no,
380
		     Local_text_no   last_read));
Kent Engström's avatar
Kent Engström committed
381
382


Per Cederqvist's avatar
.  
Per Cederqvist committed
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
/*
 * set_presentation and set_etc_motd also does some magic with the
 * no_of_marks field in the Text_stat structure of the old and new text.
 */ 

extern  Success
KOM_( set_presentation (Conf_no   conf_no,
			Text_no   text_no )); /* 0 to delete pres. */

extern  Success
KOM_( set_etc_motd (Conf_no	  conf_no,
		    Text_no	  text_no ));


extern  Success
KOM_( set_supervisor (Conf_no	  conf_no,
		      Conf_no	  admin	));

extern  Success
KOM_( set_permitted_submitters (Conf_no	  conf_no,
				Conf_no	  perm_sub ));

extern  Success
KOM_( set_super_conf (Conf_no	  conf_no,
		      Conf_no	  super_conf ));

extern  Success
KOM_( set_conf_type (Conf_no	  conf_no,
		     Conf_type	  type	));
extern  Success
KOM_( set_garb_nice (Conf_no	  conf_no,
414
		     Garb_nice	  days )); /* number of days */
Per Cederqvist's avatar
.  
Per Cederqvist committed
415

416
417
418
419
extern  Success
KOM_( set_expire (Conf_no	  conf_no,
		  Garb_nice	  expire )); /* number of days */

Per Cederqvist's avatar
.  
Per Cederqvist committed
420

421
422
423
424
425
extern Success
KOM_ ( set_keep_commented(Conf_no	conf_no,
                   Garb_nice	keep_commented));	/* number of days */


Per Cederqvist's avatar
.  
Per Cederqvist committed
426
427
428
429
430
431
432
433
434
435
436
437
438
439

/********************************
*     Calls to handle marks     *
********************************/


extern  Success
KOM_( get_marks (Mark_list *result ));



/*
 *  Will fail if the user is not allowed to read the text.
 */
440
441
/* This function uses mark_type==0 to delete the mark. */
extern  Success
442
443
444
KOM_( mark_text_old (Text_no	  	  text,
		     unsigned char	  mark_type ));

445
446

/* Using this function, you can set mark_type==0. */
Per Cederqvist's avatar
.  
Per Cederqvist committed
447
448
extern  Success
KOM_( mark_text (Text_no	  text,
449
450
		 unsigned char	  mark_type ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
451

452
453
454
455
/* Remove a mark, reporting an error if you had not marked the text. */
extern  Success
KOM_( unmark_text (Text_no	  text));

Per Cederqvist's avatar
.  
Per Cederqvist committed
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474



/*******************************
*     Calls to handle texts    *
*******************************/


extern  Success
KOM_( get_text (Text_no	 	  text,
		String_size	  start_char,
		String_size	  end_char,
		String		* result));


extern  Success
KOM_( get_text_stat (Text_no    text,
		     Text_stat *result));

475
476
477
478
extern  Success
KOM_( get_text_stat_old (Text_no    text,
                         Text_stat *result));

Per Cederqvist's avatar
.  
Per Cederqvist committed
479
480
481
482
483
484
485
486
extern  Success
KOM_( mark_as_read (Conf_no		    conference,
		    int			    no_of_texts,
		    const Local_text_no	  * text_arr   ));


/* Returns 0 on error */
extern  Text_no
487
KOM_( create_text (const String		  message,
David Byers's avatar
David Byers committed
488
		   CONST Misc_info_list	* misc,
489
490
491
492
                   Aux_item_list        * aux ));

extern Text_no
KOM_( create_text_old (const String		  message,
David Byers's avatar
David Byers committed
493
                       CONST Misc_info_list	* misc	     ));
Per Cederqvist's avatar
.  
Per Cederqvist committed
494

495
496
/* Returns 0 on error. This function is experimental. */
extern  Text_no
497
KOM_( create_anonymous_text (const String       message,
David Byers's avatar
David Byers committed
498
			     CONST Misc_info_list  * misc,
499
500
501
502
                             Aux_item_list    *aux          ));

extern  Text_no
KOM_( create_anonymous_text_old (const String       message,
David Byers's avatar
David Byers committed
503
                                 CONST Misc_info_list  * misc	     ));
504

Per Cederqvist's avatar
.  
Per Cederqvist committed
505
506
507
extern Success
KOM_( delete_text( Text_no text_no ));

508
509
510
511
extern Success
KOM_ ( modify_text_info(Text_no        text,
                         Number_list   *items_to_delete, 
                         Aux_item_list *aux ) );
Per Cederqvist's avatar
.  
Per Cederqvist committed
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546


extern  Success
KOM_( add_recipient (Text_no	  text_no,
		     Conf_no	  conf_no,
		     Info_type	  type	)); /* recpt or cc_recpt */

extern  Success
KOM_( sub_recipient (Text_no	  text_no,
		     Conf_no	  conf_no ));


extern  Success
KOM_( add_comment (Text_no	  comment,
		   Text_no 	  comment_to ));


/*
 *  Make the text COMMENT to not be a comment to text COMMENT_TO
 */
extern  Success
KOM_( sub_comment (Text_no	  comment,
		   Text_no	  comment_to ));

extern Success
KOM_( add_footnote (Text_no	footnote,
		    Text_no 	footnote_to ));

extern Success
KOM_( sub_footnote (Text_no	footnote,
		    Text_no	parent ));

extern  Success
KOM_( get_map (Conf_no		  conf_no,
	       Local_text_no	  first_local_no,
547
	       unsigned long	  no_of_texts,
548
	       L2g_iterator      *result));
549
550
551
552
553
554

extern Success
KOM_( local_to_global (Conf_no       conf_No,
		       Local_text_no first_local_no,
		       unsigned long no_of_texts,
		       Text_mapping *result));
Per Cederqvist's avatar
.  
Per Cederqvist committed
555
556
557
558
559
560
561
562


/*
 *  Ask what the server thinks the time is. This
 *  might differ if on two different machines.
 */
#ifdef SERVER
extern  Success
563
KOM_( get_time (time_t *t));
Per Cederqvist's avatar
.  
Per Cederqvist committed
564
565
566
567
568
569
#else				/* CLIENT */
extern  Success
KOM_( get_time (struct tm *clock));
#endif


Linus Tolke's avatar
Linus Tolke committed
570
571
572
/*
 *  Gets the last text before a given time.
 */
573

574
extern  Success
575
KOM_( get_last_text (struct tm *clk, Text_no *result));
Linus Tolke's avatar
Linus Tolke committed
576

577
578
579
580
581
582
583
584
585
586
587
/*
 * Return next/previous existing text-no.
 */

extern  Success
KOM_( find_next_text_no (Text_no start, Text_no *result));

extern  Success
KOM_( find_previous_text_no (Text_no start, Text_no *result));


Per Cederqvist's avatar
.  
Per Cederqvist committed
588
589
590
591
592
593
594
595
596
/*
 * Who is logged on now?
 */
extern  Success
KOM_( who_is_on_old (Who_info_list_old	* result ));

extern  Success
KOM_( who_is_on (Who_info_list	* result ));

597
598
extern  Success
KOM_( who_is_on_ident (Who_info_ident_list *result));
Per Cederqvist's avatar
.  
Per Cederqvist committed
599

Per Cederqvist's avatar
Per Cederqvist committed
600
601
602
extern  Success
KOM_( who_is_on_dynamic (int want_visible,
			 int want_invisible,
603
			 long active_last,
Per Cederqvist's avatar
Per Cederqvist committed
604
605
			 Dynamic_session_info_list *result) );

Per Cederqvist's avatar
.  
Per Cederqvist committed
606
607
608
/*
 *  Return various information about the server
 */
609
610
611
extern  Success
KOM_( get_info_old (Info *result ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
612
613
614
extern  Success
KOM_( get_info (Info *result ));

615
616
617
extern  Success
KOM_( get_version_info (Version_info *result ));

Per Cederqvist's avatar
.  
Per Cederqvist committed
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
/*
 *  Wait for asynchronous message from client, or input on any of
 *  the file-descriptors in opt_set. Returns FAILURE if nothing
 *  happened in msec milliseconds or an error occurs. (kom_errno ==
 *  KOM_NO_ERR if the return was due to a timeout). Returns OK if
 *  there was an asynchronous message or input on any of the fd's in
 *  opt_set.
 *
 *  Set opt_set to NULL if you don't want to wait on any other input
 *  than a message.
 *
 *  To wait for a message or input on stdin the following code can be used:
 *
 *  fd_set read_set;
 *
 *  FD_ZERO(&read_set);
 *  FD_SET(fileno(stdin), &read_set);
 *  if ( kom_wait(read_set, 1000) == OK )
 *  {
 *	if ( FD_ISSET(fileno(stdin), &read_set) )
 *	    handle_stdin_input();
 *	else
 *	    handle_asynchronous_message();
 *  }
 *  else
 *	time_out();
 *
 *  (The handler is called from kom_wait and not handle_asynchronous_message,
 *   but there might be more to do afterwards since a handler cannot call
 *   functions that communicate with the server.)
 */
#ifdef CLIENT
extern  Success
KOM_( wait (fd_set *opt_set,
	    int     msec));
#endif

/*
 * Privileged calls.
 */

David Byers's avatar
David Byers committed
659
660
661
extern Success
KOM_( set_info(Info *info));

662
663
664
665
extern Success
KOM_( modify_server_info(Number_list      *items_to_delete,
                         Aux_item_list    *items_to_add));

Per Cederqvist's avatar
.  
Per Cederqvist committed
666
667
668
669
670
671
672
extern Success
KOM_( set_motd_of_lyskom (Text_no motd));

/*
 * Set ena_level. 0 means don't use any privileges.
 */
extern Success
Per Cederqvist's avatar
Per Cederqvist committed
673
KOM_( enable (unsigned char ena_level));
Per Cederqvist's avatar
.  
Per Cederqvist committed
674
675
676
677
678

/*
 * Make LysKOM sync its files.
 */
extern Success
Per Cederqvist's avatar
Per Cederqvist committed
679
KOM_( sync_kom (void) );
Per Cederqvist's avatar
.  
Per Cederqvist committed
680
681
682
683
684

/*
 * Close LysKOM.
 */
extern Success
685
KOM_( shutdown_kom (int exit_val) );
Per Cederqvist's avatar
.  
Per Cederqvist committed
686
687

/*
688
689
 * Send a message to all clients. This is obsoleted by send_message(),
 * but will remain for compatibility reasons.
Per Cederqvist's avatar
.  
Per Cederqvist committed
690
691
692
693
694
695
696
697
698
 */
extern Success
KOM_( broadcast (const String message) );

/*
 * Send a message to a person, or all persons. If recipient == 0 all
 * connections will receive the message.
 */
extern Success
699
KOM_( send_message (Conf_no recipient,
Per Cederqvist's avatar
.  
Per Cederqvist committed
700
701
		    const String message) );

702
703
704
705
706
707
708
709
710
/*
 * Selection of asynchronous messages
 */

extern Success
KOM_( accept_async(Number_list *accept_list));

extern Success
KOM_( query_async(Number_list *result));
Per Cederqvist's avatar
.  
Per Cederqvist committed
711

712
713
714
715
716
717
718
719
/*
 * Aux-items
 */

extern Success
KOM_( query_predefined_aux_items(Number_list *result));


720
721
722
#ifdef DEBUG_CALLS
extern Success
KOM_ ( get_memory_info(Memory_info *result));
723
724
725
726
727
728
729
730

extern Success
KOM_ ( set_marks(Text_no text_no, unsigned long no_of_marks));

extern Success
KOM_ (backdate_text(Text_no text_no,
                    unsigned long seconds));

731
#endif
732
733


Per Cederqvist's avatar
.  
Per Cederqvist committed
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
/*
 * Asynchronous messages.
 */
#ifdef CLIENT
void
register_new_text(void (*async_new_text)(Text_no    text_no, 
					 Text_stat  text_s));

void
register_i_am_on(void (*async_i_am_on)(Who_info info));

void
register_i_am_off (void (*async_i_am_off)(Pers_no pers_no));

void
register_new_name(void (*async_new_name)(Conf_no  conf_no,
					 String   old_name,
					 String   new_name));
Linus Tolke's avatar
Linus Tolke committed
752
753
754
755
void
register_directed_message(void (*async_message)(Conf_no	to,
						Conf_no	from,
						String	message));
Linus Tolke's avatar
Linus Tolke committed
756
757
758
759

void
register_saving(void (*saving_fun)(void));

Per Cederqvist's avatar
.  
Per Cederqvist committed
760
761
762
#endif	/* CLIENT */
    
#endif	/*  _SERVICES_H_ALREADY_INCLUDED__  */