From afdccdeda7fc0925bbccd4952e5daebdaad0da8b Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Fri, 17 Mar 2017 12:15:06 -0700 Subject: [PATCH] Force notification functions to end in the same way (#463) --- inc/saiswitch.h | 6 +++--- meta/parse.pl | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 126aeffd6..d2ca44256 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -1188,9 +1188,9 @@ typedef enum _sai_switch_attr_t /** * @brief Set Switch shutdown notification callback function passed to the adapter. * - * Use sai_switch_shutdown_request_fn as notification function. + * Use sai_switch_shutdown_request_notification_fn as notification function. * - * @type sai_pointer_t sai_switch_shutdown_request_fn + * @type sai_pointer_t sai_switch_shutdown_request_notification_fn * @flags CREATE_AND_SET * @default NULL */ @@ -1399,7 +1399,7 @@ typedef enum _sai_switch_attr_t * * @param[in] switch_id Switch Id */ -typedef void (*sai_switch_shutdown_request_fn)( +typedef void (*sai_switch_shutdown_request_notification_fn)( _In_ sai_object_id_t switch_id); /** diff --git a/meta/parse.pl b/meta/parse.pl index f6db542f0..284eb17db 100755 --- a/meta/parse.pl +++ b/meta/parse.pl @@ -290,8 +290,15 @@ sub ProcessTagType return $val; } - if ($val =~/^sai_pointer_t sai_\w+_fn$/) + if ($val =~/^sai_pointer_t (sai_\w+_fn)$/) { + my $pointerfn = $1; + + if (not $pointerfn =~ /^sai_\w+_(callback|notification)_fn$/) + { + LogWarning "function name $pointerfn should be in format sai_\\w+_(callback|notification)_fn"; + } + return $val; }