소스 검색

BPending: add BSmallPending_SetHandler()

ambrop7 13 년 전
부모
커밋
b963b8e471
2개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      base/BPending.c
  2. 9 0
      base/BPending.h

+ 9 - 0
base/BPending.c

@@ -125,6 +125,15 @@ void BSmallPending_Free (BSmallPending *o, BPendingGroup *g)
     }
     }
 }
 }
 
 
+void BSmallPending_SetHandler (BSmallPending *o, BSmallPending_handler handler, void *user)
+{
+    DebugObject_Access(&o->d_obj);
+    
+    // set handler
+    o->handler = handler;
+    o->user = user;
+}
+
 void BSmallPending_Set (BSmallPending *o, BPendingGroup *g)
 void BSmallPending_Set (BSmallPending *o, BPendingGroup *g)
 {
 {
     DebugObject_Access(&o->d_obj);
     DebugObject_Access(&o->d_obj);

+ 9 - 0
base/BPending.h

@@ -162,6 +162,15 @@ void BSmallPending_Init (BSmallPending *o, BPendingGroup *g, BSmallPending_handl
  */
  */
 void BSmallPending_Free (BSmallPending *o, BPendingGroup *g);
 void BSmallPending_Free (BSmallPending *o, BPendingGroup *g);
 
 
+/**
+ * Changes the job execution handler.
+ * 
+ * @param o the object
+ * @param handler job execution handler
+ * @param user value to pass to handler
+ */
+void BSmallPending_SetHandler (BSmallPending *o, BSmallPending_handler handler, void *user);
+
 /**
 /**
  * Enables the job, pushing it to the top of the job list.
  * Enables the job, pushing it to the top of the job list.
  * If the object was already in set state, the job is removed from its
  * If the object was already in set state, the job is removed from its