5 * $TOG: FileShare.hh /main/5 1997/04/29 16:45:06 mgreess $
7 * RESTRICTED CONFIDENTIAL INFORMATION:
9 * The information in this document is subject to special
10 * restrictions in a confidential disclosure agreement bertween
11 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
12 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
13 * Sun's specific written approval. This documment and all copies
14 * and derivative works thereof must be returned or destroyed at
17 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
25 #include <DtMail/DtMail.hh>
28 class FileShare : public DtCPlusPlusAllocator {
30 FileShare(DtMailEnv & error,
31 DtMail::Session * session,
33 DtMailCallback cb_func,
35 virtual ~FileShare(void);
37 void lockFile(DtMailEnv & error);
38 DtMailBoolean readOnly(DtMailEnv & error);
39 DtMailBoolean readWriteOverride(DtMailEnv & error);
42 DtMailBoolean locked(void);
43 #endif /* DEAD_WOOD */
46 struct TTHandle : public DtCPlusPlusAllocator {
47 DtMail::Session *session;
53 DtMail::Session *_session;
56 Tt_pattern *_file_pats;
57 DtMailBoolean _have_write_access;
58 DtMailBoolean _other_modified;
59 DtMailCallback _cb_func;
69 DtMailBoolean _outstanding;
71 DtMailBoolean isModified(DtMailEnv & error);
73 static Tt_message fileCB(Tt_message msg, Tttk_op op,
74 char * path, void *clientData, int same_euid,
77 static Tt_callback_action mt_lock_cb(Tt_message m, Tt_pattern p);
79 static Tt_message fileRequestCB(Tt_message, Tttk_op,
80 char *, void *, int, int);
82 /* _mt_pattern is used to handle tlock and rulock messages from mailtool */
83 Tt_pattern _mt_pattern;
85 /* _mt_lock is DTM_TRUE is we use the mailtool locking protocol */