annotate plugins/zephyr/ZFmtNotice.c @ 1911:db3104dda736

[gaim-migrate @ 1921] Mike Heffner's redesigned UI. I changed around a lot of things from his patch, not because they weren't good or needed or anything like that; most of the changes I made just made the patch smaller. I moved functions back to where they originally where and renamed them back to what they originally were. Granted the names aren't as... good as the changes Mike made, but eh, it made my life a lot easier when I could see the meat of the changes without all the cosmetic details. The only thing I really changed about his patch was I made the list BROWSE instead of SINGLE so that there wouldn't be need for a deselect callback. Oh yeah, and update_show_plugins is called from different places (so that plugins can call load_plugin and have the window update properly). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 May 2001 09:46:05 +0000
parents 1e0fa7e130d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1700
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /* This file is part of the Project Athena Zephyr Notification System.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 * It contains source for the ZFormatNotice function.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 * Created by: Robert French
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 * $Source$
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 * $Author: warmenhoven $
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 * For copying and distribution information, see the file
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 * "mit-copyright.h".
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 /* $Header$ */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 #ifndef lint
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 static char rcsid_ZFormatNotice_c[] = "$Id: ZFmtNotice.c 1710 2001-04-12 09:21:16Z warmenhoven $";
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 #endif
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 #include <internal.h>
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 Code_t ZFormatNotice(notice, buffer, ret_len, cert_routine)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 register ZNotice_t *notice;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 char **buffer;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 int *ret_len;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 Z_AuthProc cert_routine;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 char header[Z_MAXHEADERLEN];
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 int hdrlen;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 Code_t retval;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 cert_routine)) != ZERR_NONE)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 return (retval);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 *ret_len = hdrlen+notice->z_message_len;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 /* Length can never be zero, don't have to worry about malloc(0). */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 return (ENOMEM);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 (void) memcpy(*buffer, header, hdrlen);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 (void) memcpy(*buffer+hdrlen, notice->z_message, notice->z_message_len);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 return (ZERR_NONE);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 }