~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/dbllnklst.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
#include "vm_basic_types.h"
75
75
 
76
 
 
77
76
#define DblLnkLst_OffsetOf(type, field) ((intptr_t)&((type *)0)->field)
78
77
 
79
78
#define DblLnkLst_Container(addr, type, field) \
97
96
/*
98
97
 * Functions
99
98
 *
100
 
 * DblLnkLst_LinkFirst and DblLnkLst_LinkLast are specific
101
 
 * to anchored lists.  The rest are for both circular and
102
 
 * anchored lists.
 
99
 * DblLnkLst_LinkFirst, DblLnkLst_LinkLast, and DblLnkLst_Swap are specific
 
100
 * to anchored lists.  The rest are for both circular and anchored lists.
103
101
 */
104
102
 
105
103
 
289
287
}
290
288
 
291
289
 
 
290
/*
 
291
 *----------------------------------------------------------------------
 
292
 *
 
293
 * DblLnkLst_Swap --
 
294
 *
 
295
 *    Swap all entries between the list anchored at 'head1' and the list
 
296
 *    anchored at 'head2'.
 
297
 *
 
298
 *    The operation is commutative
 
299
 *    The operation is inversible (its inverse is itself)
 
300
 *
 
301
 * Result
 
302
 *    None
 
303
 *
 
304
 * Side effects:
 
305
 *    None
 
306
 *
 
307
 *----------------------------------------------------------------------
 
308
 */
 
309
 
 
310
static INLINE void
 
311
DblLnkLst_Swap(DblLnkLst_Links *head1,  // IN/OUT
 
312
               DblLnkLst_Links *head2)  // IN/OUT
 
313
{
 
314
   DblLnkLst_Links const tmp = *head1;
 
315
 
 
316
   if (DblLnkLst_IsLinked(head2)) {
 
317
      (head1->prev = head2->prev)->next = head1;
 
318
      (head1->next = head2->next)->prev = head1;
 
319
   } else {
 
320
      DblLnkLst_Init(head1);
 
321
   }
 
322
 
 
323
   if (tmp.prev != head1) {
 
324
      (head2->prev = tmp.prev)->next = head2;
 
325
      (head2->next = tmp.next)->prev = head2;
 
326
   } else {
 
327
      DblLnkLst_Init(head2);
 
328
   }
 
329
}
 
330
 
 
331
 
292
332
#endif /* _DBLLNKLST_H_ */