]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Refer to the resume ctx as rctx
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 24 Nov 2017 15:18:04 +0000 (15:18 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 24 Nov 2017 15:19:08 +0000 (15:19 +0000)
src/include/interpreter.h
src/include/modules.h
src/main/unlang_interpret.c

index dfb2116ddcd3016d65be9a9e08a6a241146e347e..d55a0c15507495709299a557a0e6f905485d9c6b 100644 (file)
@@ -196,20 +196,20 @@ typedef struct {
  */
 typedef struct {
        unlang_t                        self;
-       unlang_t                        *parent;        //!< The original instruction.
+       unlang_t                        *parent;                //!< The original instruction.
 
-       fr_unlang_resume_callback_t    callback;        //!< Function the yielding code indicated should
-                                                       //!< be called when the request could be resumed.
+       void                            *callback;              //!< Function the yielding code indicated should
+                                                               //!< be called when the request could be resumed.
 
-       fr_unlang_action_t              signal_callback;  //!< Function the yielding module indicated should
-                                                       //!< be called when the request is poked via an action
-                                                       //!< may be removed in future.
+       fr_unlang_action_t              signal_callback;        //!< Function the yielding module indicated should
+                                                               //!< be called when the request is poked via an action
+                                                               //!< may be removed in future.
 
-
-       void                            *resume_ctx;    //!< Context data for the callback.  Usually represents
-                                                       //!< the module's internal state at the time of yielding.
-       void const                      *instance;      //!< instance data
-       void                            *thread;        //!< thread data
+       void                            *resume_ctx;            //!< Context data for the callback.  Usually represents
+                                                               ///< the module's internal state at the time of
+                                                               ///< <yielding.
+       void const                      *instance;              //!< instance data
+       void                            *thread;                //!< thread data
 } unlang_resume_t;
 
 /** A naked xlat
index fabf6863ca3c7ee2fc627e5682d15060a3a0debb..4ff02db3fb4fdfb992bccec040d167fcf4ac83e9 100644 (file)
@@ -218,10 +218,10 @@ void              fr_request_async_bootstrap(REQUEST *request, fr_event_list_t *el); /* for
  * @param[in] request          the request.
  * @param[in] instance         the module instance.
  * @param[in] thread           data specific to this module instance.
- * @param[in] ctx              a local context for the callback.
+ * @param[in] rctx             a local context for the callback.
  * @param[in] fired            the time the timeout event actually fired.
  */
-typedef        void (*fr_unlang_timeout_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx,
+typedef        void (*fr_unlang_timeout_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx,
                                             struct timeval *fired);
 
 /** A callback when the FD is ready for reading
@@ -234,10 +234,10 @@ typedef   void (*fr_unlang_timeout_callback_t)(REQUEST *request, void *instance, v
  * @param[in] request          the current request.
  * @param[in] instance         the module instance.
  * @param[in] thread           data specific to this module instance.
- * @param[in] ctx              a local context for the callback.
+ * @param[in] rctx             a local context for the callback.
  * @param[in] fd               the file descriptor.
  */
-typedef void (*fr_unlang_fd_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx, int fd);
+typedef void (*fr_unlang_fd_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx, int fd);
 
 /** A callback for when the request is resumed.
  *
@@ -246,10 +246,10 @@ typedef void (*fr_unlang_fd_callback_t)(REQUEST *request, void *instance, void *
  * @param[in] request          the current request.
  * @param[in] instance         The module instance.
  * @param[in] thread           data specific to this module instance.
- * @param[in] ctx              a local context for the callback.
+ * @param[in] rctx             a local context for the callback.
  * @return a normal rlm_rcode_t.
  */
-typedef rlm_rcode_t (*fr_unlang_resume_callback_t)(REQUEST *request, void *instance, void *thread, void *ctx);
+typedef rlm_rcode_t (*fr_unlang_resume_callback_t)(REQUEST *request, void *instance, void *thread, void *rctx);
 
 /** A callback when the request gets a fr_state_action_t.
  *
@@ -261,10 +261,10 @@ typedef rlm_rcode_t (*fr_unlang_resume_callback_t)(REQUEST *request, void *insta
  * @param[in] request          The current request.
  * @param[in] instance         The module instance.
  * @param[in] thread           data specific to this module instance.
- * @param[in] ctx              for the callback.
+ * @param[in] rctx             for the callback.
  * @param[in] action           which is signalling the request.
  */
-typedef void (*fr_unlang_action_t)(REQUEST *request, void *instance, void *thread, void *ctx,
+typedef void (*fr_unlang_action_t)(REQUEST *request, void *instance, void *thread, void *rctx,
                                   fr_state_action_t action);
 
 /*
index aac677018f1123efbb7d118ff3d80a090b042391..e235f08bb335352f04ce22d1f16fff776fcf83c3 100644 (file)
@@ -529,14 +529,14 @@ static rlm_rcode_t unlang_run(REQUEST *request);
  * @param[in] request          The current request.
  * @param[in] callback         to call on unlang_resumable().
  * @param[in] signal_callback  to call on unlang_action().
- * @param[in] ctx              to pass to the callbacks.
+ * @param[in] rctx             to pass to the callbacks.
  * @return
  *     unlang_resume_t on success
  *     NULL on error
  */
 static unlang_resume_t *unlang_resume_alloc(REQUEST *request,
                                            fr_unlang_resume_callback_t callback,
-                                           fr_unlang_action_t signal_callback, void *ctx)
+                                           fr_unlang_action_t signal_callback, void *rctx)
 {
        unlang_resume_t                 *mr;
        unlang_stack_t                  *stack = request->stack;
@@ -566,7 +566,7 @@ static unlang_resume_t *unlang_resume_alloc(REQUEST *request,
         */
        mr->callback = callback;
        mr->signal_callback = signal_callback;
-       mr->resume_ctx = ctx;
+       mr->resume_ctx = rctx;
 
        /*
         *      Replaces the current stack frame with a RESUME frame.
@@ -3230,11 +3230,11 @@ int unlang_stack_depth(REQUEST *request)
  * @param[in] request          The current request.
  * @param[in] callback         to call on unlang_resumable().
  * @param[in] signal_callback  to call on unlang_action().
- * @param[in] ctx              to pass to the callbacks.
  * @return always returns RLM_MODULE_YIELD.
+ * @param[in] rctx             to pass to the callbacks.
  */
 rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_resume_callback_t callback,
-                               fr_unlang_action_t signal_callback, void *ctx)
+                               fr_unlang_action_t signal_callback, void *rctx)
 {
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
@@ -3256,7 +3256,7 @@ rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_resume_callback_t ca
                 */
                sp = unlang_generic_to_module_call(frame->instruction);
 
-               mr = unlang_resume_alloc(request, callback, signal_callback, ctx);
+               mr = unlang_resume_alloc(request, callback, signal_callback, rctx);
                rad_assert(mr != NULL);
 
                /*
@@ -3280,7 +3280,7 @@ rlm_rcode_t unlang_module_yield(REQUEST *request, fr_unlang_resume_callback_t ca
                 */
                mr->callback = callback;
                mr->signal_callback = signal_callback;
-               mr->resume_ctx = ctx;
+               mr->resume_ctx = rctx;
        }
 
        return RLM_MODULE_YIELD;