log_domains.inc:
@echo " UL_LOG $@"
- $(Q)$(SOURCES_DIR)/ul_log_domains $(SOURCES_DIR) > $@
+ $(Q)$(SOURCES_DIR)/ul_log_domains --array forb_logreg_domains_array \
+ $(SOURCES_DIR) > $@
clean-custom:
-$(Q)rm log_domains.inc
extern UL_LOG_CUST(ulogd_forb);
+UL_LOGREG_DOMAINS_INIT_FUNCTION(forb_logreg_domains, forb_logreg_domains_array);
static void
destroy_forb_on_exit(int exitcode, void *arg)
memset(forb, 0, sizeof(*forb));
/* Initialize ULUT logging facility */
- ul_logreg_domains_static(ul_log_domains_array,
- sizeof(ul_log_domains_array)/sizeof(ul_log_domains_array[0]));
+ forb_logreg_domains();
if (attr) {
forb->attr = *attr;
#!/bin/sh
-DOMAINS=$(find -L $1 '(' -name '*.c' -o -name '*.cc' ')' -exec grep UL_LOG_CUST '{}' ';' | \
- sed -n -e 's/^.*UL_LOG_CUST(\([^)]*\)).*$/\1/p' | sort -u )
+ARRAY_NAME=ul_log_domains_array
+
+DIRS=""
+
+while [ $# -gt 0 ] ; do
+ case "x${1}x" in
+ "x--helpx" | "x-hx" )
+ echo -e Usage: `basename ${0}`" [options] <srcdir> .."
+ echo -e " -h --help help"
+ echo -e " -a --array identifier of log domain array variable"
+ exit 0
+ ;;
+ "x--arrayx" | "x-ax" )
+ shift 1
+ ARRAY_NAME="${1}"
+ ;;
+ "x--"* )
+ echo "Unknown option"
+ exit 2
+ ;;
+ * )
+ DIRS="$DIRS ${1}"
+ ;;
+ esac
+ shift 1
+done
+
+DOMAINS=$( for d in $DIRS ; do find -L $d '(' -name '*.c' -o -name '*.cc' ')' -exec grep UL_LOG_CUST '{}' ';' | \
+ sed -n -e 's/^.*UL_LOG_CUST(\([^)]*\)).*$/\1/p' ; done | sort -u )
#echo $DOMAINS
done
echo
-echo "ul_log_domain_t *ul_log_domains_array[] = {"
+echo "ul_log_domain_t *$ARRAY_NAME[] = {"
for i in $DOMAINS ; do
echo " &$i,"