2 * $Id: util.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006 University of Washington
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * ========================================================================
16 #ifndef PITH_UTIL_INCLUDED
17 #define PITH_UTIL_INCLUDED
20 #include "../pith/news.h"
23 #define plural(n) ((n) == 1 ? "" : "s")
26 #define READONLY_FOLDER(S) ((S) && (S)->rdonly && !IS_NEWS(S))
28 #define STREAMNAME(S) (((S) && sp_fldr(S) && sp_fldr(S)[0]) \
30 : ((S) && (S)->mailbox && (S)->mailbox[0]) \
36 * Simple, handy macro to determine if folder name is remote
39 #define IS_REMOTE(X) (*(X) == '{' && *((X) + 1) && *((X) + 1) != '}' \
40 && strchr(((X) + 2), '}'))
43 /* (0,0) is upper left */
44 typedef struct screen_position
{
50 #define SCREEN_FUN_NULL ((void (*)(struct pine *)) NULL)
53 /* exported protoypes */
56 /* currently mandatory to implement stubs */
58 /* called when we detect a serious program error */
59 void alpine_panic(char *);
61 /* called when testing to see if panic state is in effect */
64 /* logs or prints a message then exits */
65 void exceptional_exit(char *, int);
68 #endif /* PITH_UTIL_INCLUDED */