IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2011, 9:59:21 AM (15 years ago)
Author:
eugene
Message:

adding linked list varient for pcontrol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c

    r29540 r32568  
    270270  FREE (job);
    271271}
     272
     273void ResortJobStack (int StackID) {
     274
     275  Stack *stack = GetJobStack (StackID);
     276  LockStack (stack);
     277
     278# define SWAPFUNC(A,B){ \
     279  void *tmpObject = stack[0].object[A]; \
     280  stack[0].object[A] = stack[0].object[B]; \
     281  stack[0].object[B] = tmpObject; \
     282  void *tmpName = stack[0].name[A]; \
     283  stack[0].name[A] = stack[0].name[B]; \
     284  stack[0].name[B] = tmpName; \
     285  void *tmpID = stack[0].id[A]; \
     286  stack[0].id[A] = stack[0].id[B]; \
     287  stack[0].id[B] = tmpID; \
     288}
     289
     290# define COMPARE(A,B)(((Job *)stack[0].object[A]).VALUE < ((Job *)stack[0].object[B]).VALUE)
     291
     292  OHANA_SORT (N, COMPARE, SWAPFUNC);
     293
     294# undef SWAPFUNC
     295# undef COMPARE
     296
     297  UnlockStack (stack);
     298}
Note: See TracChangeset for help on using the changeset viewer.