]> diplodocus.org Git - nmh/blobdiff - h/prototypes.h
Support for locking tests in the test suite.
[nmh] / h / prototypes.h
index d4fc6eb0ac16e775cdafef095f4dab57d5984198..14b1252824fc3bffd8bf670549ca621152737aca 100644 (file)
@@ -1,6 +1,9 @@
 
 /*
  * prototypes.h -- various prototypes
+ *
+ * If you modify functions here, please document their current behavior
+ * as much as practical.
  */
 
 /*
@@ -23,11 +26,16 @@ char *etcpath(char *);
 /*
  * prototypes from the nmh subroutine library
  */
+
+struct msgs_array;
+
 void adios (char *, char *, ...) NORETURN;
 void admonish (char *, char *, ...);
 void advertise (char *, char *, char *, va_list);
 void advise (char *, char *, ...);
 char **argsplit (char *, char **, int *);
+void argsplit_msgarg (struct msgs_array *, char *, char **);
+void argsplit_insert (struct msgs_array *, char *, char **);
 void arglist_free (char *, char **);
 void ambigsw (char *, struct swit *);
 int atooi(char *);
@@ -35,17 +43,18 @@ char **brkstring (char *, char *, char *);
 int check_charset (char *, int);
 int client(char *, char *, char *, int, int);
 void closefds(int);
-char *concat (char *, ...);
+char *concat (const char *, ...);
 int context_del (char *);
 char *context_find (char *);
 int context_foil (char *);
 void context_read (void);
 void context_replace (char *, char *);
 void context_save (void);
-char *copy (char *, char *);
+char *copy (const char *, char *);
 char **copyip (char **, char **, int);
 void cpydata (int, int, char *, char *);
 void cpydgst (int, int, char *, char *);
+char *cpytrim (const char *);
 int decode_rfc2047 (char *, char *, size_t);
 void discard (FILE *);
 int default_done (int);
@@ -70,10 +79,27 @@ char *get_charset(void);
 char *getcpy (char *);
 char *get_default_editor(void);
 char *getfolder(int);
-int lkclose(int, char*);
-int lkfclose(FILE *, char *);
-FILE *lkfopen(char *, char *);
-int lkopen(char *, int, mode_t);
+/*
+ * Lock open/close routines.
+ *
+ * The lk[f]opendata() functions are designed to open "data" files (anything
+ * not a mail spool file) using the locking mechanism configured for data
+ * files.  The lk[f]openspool() functions are for opening the mail spool
+ * file, which will use the locking algorithm configured for the mail
+ * spool.
+ *
+ * Files opened for reading are locked with a read lock (if possible by
+ * the underlying lock mechanism), files opened for writing are locked
+ * using an exclusive lock.
+ */
+int lkclosedata(int, const char *);
+int lkclosespool(int, const char *);
+int lkfclosedata(FILE *, const char *);
+int lkfclosespool(FILE *, const char *);
+FILE *lkfopendata(const char *, const char *);
+int lkopendata(const char *, int, mode_t);
+FILE *lkfopenspool(const char *, const char *);
+int lkopenspool(const char *, int, mode_t);
 int m_atoi (char *);
 char *m_backup (char *);
 int m_convert (struct msgs *, char *);
@@ -82,7 +108,7 @@ void m_eomsbr (m_getfld_state_t, int (*)(int));
 void m_getfld_state_reset (m_getfld_state_t *);
 void m_getfld_state_destroy (m_getfld_state_t *);
 void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
-int m_getfld (m_getfld_state_t *, unsigned char[NAMESZ], unsigned char *, int *, FILE *);
+int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
 int m_gmprot (void);
 char *m_maildir (char *);
 char *m_mailpath (char *);
@@ -123,7 +149,7 @@ int seq_delmsg (struct msgs *, char *, int);
 int seq_delsel (struct msgs *, char *, int, int);
 int seq_getnum (struct msgs *, char *);
 char *seq_list (struct msgs *, char *);
-int seq_nameok (unsigned char *);
+int seq_nameok (char *);
 void seq_print (struct msgs *, char *);
 void seq_printall (struct msgs *);
 void seq_read (struct msgs *);
@@ -136,7 +162,7 @@ int smatch(char *, struct swit *);
 char *snprintb (char *, size_t, unsigned, char *);
 int ssequal (char *, char *);
 int stringdex (char *, char *);
-char *trimcpy (unsigned char *);
+char *trimcpy (char *);
 int unputenv (char *);
 int uprf (char *, char *);
 int vfgets (FILE *, char **);
@@ -172,7 +198,7 @@ int sc_length(void);
 int sc_width(void);
 int build_form (char *, char *, int *, char *, char *, char *, char *,
                char *, char *);
-int sendsbr (char **, int, char *, struct stat *, int, char *, int);
+int sendsbr (char **, int, char *, char *, struct stat *, int, char *, int);
 int SOprintf (char *, ...);
 int what_now (char *, int, int, char *, char *,
        int, struct msgs *, char *, int, char *, int);