AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20090403130744.33b56831@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:mail.onstor.net
NSV:
SSH:
R:<jonathan.goldick@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 3 Apr 2009 13:07:58 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Jonathan Goldick <jonathan.goldick@onstor.com>
Subject: anonymous union thingie
Message-ID: <20090403130758.0e468981@ripper.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Here's a sample snippet from sm-nfs/nfs-open-struct.h

/* Context for nfs_open_by_handle() and  nfs_open_by_name().
 */
typedef struct nfs_open_ctx
{
    /* Passed to fcb_lookup() or fcb_lookupByName().
     */
    union {
        lookup_name_t;      <-------------

        /* Note that the volId in the handle is not filled in.
         */
        void *nr_lookup_handle;
    };

    /* Is passed to author_permissionOk.
     */
    author_permOkContext_t nr_perm_context;

    /* Is passed to author_permissionOk.
     */
    author_permissionOkResp_t nr_perm_resp;

    /* The open handle to fill
     */
    nfs_open_handle_t *nr_open_handle;

    /* Context to traverse the FNS tree
     */
    struct ofh_doFnsCtx_s *nr_traverse_ctx;

    /* Context to break the oplocks if necessary
     */
    struct op_breakConflicts_s *nr_oplock_ctx;

    /* How to open this file.
     */
    enum nfs_open_type nr_open_type;

    /* If true, the handle is valid
     */
    uint32 nr_handle_valid : 1;

    /* If true, we had dropped the parent directory lock
     * during last call.
     */
    uint32 nr_dropped_lock : 1;

    /* If true, we did drop the parent directory lock
     * at least once during the operation.
     */
    uint32 nr_has_dropped_lock : 1;

    /* If TRUE, permissions check has failed
     */
    uint32 nr_access_denied : 1;
} nfs_open_ctx_t;
