* clear out some warnings by gcc 9.3.1.
[alpine.git] / pith / util.h
blob79bb502846f7e4c69768c7bbabd73c343e6ea41d
1 /*
2 * $Id: util.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2020 Eduardo Chappa
6 * Copyright 2006 University of Washington
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PITH_UTIL_INCLUDED
18 #define PITH_UTIL_INCLUDED
21 #include "../pith/news.h"
24 #define plural(n) ((n) == 1 ? "" : "s")
27 #define READONLY_FOLDER(S) ((S) && (S)->rdonly && !IS_NEWS(S))
29 #define STREAMNAME(S) (((S) && sp_fldr(S) && sp_fldr(S)[0]) \
30 ? sp_fldr(S) \
31 : ((S) && (S)->mailbox && (S)->mailbox[0]) \
32 ? (S)->mailbox \
33 : "?")
37 * Simple, handy macro to determine if folder name is remote
38 * (on an imap server)
40 #define IS_REMOTE(X) (*(X) == '{' && *((X) + 1) && *((X) + 1) != '}' \
41 && strchr(((X) + 2), '}'))
44 /* (0,0) is upper left */
45 typedef struct screen_position {
46 int row;
47 int col;
48 } Pos;
51 #define SCREEN_FUN_NULL ((void (*)(struct pine *)) NULL)
54 /* exported prototypes */
55 int *cpyint(int);
57 /* currently mandatory to implement stubs */
59 /* called when we detect a serious program error */
60 void alpine_panic(char *);
62 /* called when testing to see if panic state is in effect */
63 int panicking(void);
65 /* logs or prints a message then exits */
66 void exceptional_exit(char *, int);
69 #endif /* PITH_UTIL_INCLUDED */