1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZGetSubscriptions function.
4 * Created by: Robert French
7 * $Author: warmenhoven $
9 * Copyright (c) 1987 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
16 static char rcsid_ZGetSubscriptions_c
[] = "$Header$";
21 #define min(a,b) ((a)<(b)?(a):(b))
23 Code_t
ZGetSubscriptions(subscription
, numsubs
)
24 ZSubscription_t
*subscription
;
29 if (!__subscriptions_list
)
30 return (ZERR_NOSUBSCRIPTIONS
);
32 if (__subscriptions_next
== __subscriptions_num
)
33 return (ZERR_NOMORESUBSCRIPTIONS
);
35 for (i
=0;i
<min(*numsubs
, __subscriptions_num
-__subscriptions_next
);i
++)
36 subscription
[i
] = __subscriptions_list
[i
+__subscriptions_next
];
38 if (__subscriptions_num
-__subscriptions_next
< *numsubs
)
39 *numsubs
= __subscriptions_num
-__subscriptions_next
;
41 __subscriptions_next
+= *numsubs
;