| 
									
										
										
										
											2006-04-24 17:11:45 +00:00
										 |  |  | #!/bin/sh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-09 08:45:37 +00:00
										 |  |  | get_description() { | 
					
						
							|  |  |  | 	x=${1} | 
					
						
							|  |  |  | 	TDESC=`cat $x | grep -e *tdesc | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -A 2 -e *description | grep -e '\"'  | cut -f 2 -d '"'`  | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -e MODULE_DESCRIPTION | grep -v return | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -e tdesc\\\[\\\] | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -e desc\\\[\\\] | grep -v description | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -e *desc | grep -v descrip | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -e *dtext | grep static | cut -f 2 -d '"'` | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 	if [ "$TDESC" = "" ]; then | 
					
						
							|  |  |  | 		TDESC=`cat $x | grep -A 2 -e *synopsis | grep -e '\"'  | cut -f 2 -d '"'`  | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-24 17:11:45 +00:00
										 |  |  | process_dir() { | 
					
						
							|  |  |  | 	dir=${1} | 
					
						
							|  |  |  | 	prefix=${2}_ | 
					
						
							|  |  |  | 	catsuffix=${3} | 
					
						
							|  |  |  | 	displayname=${4} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">" | 
					
						
							|  |  |  | 	for file in ${dir}/${prefix}*.c | 
					
						
							|  |  |  | 	do | 
					
						
							|  |  |  | 		fname=${file##${dir}/} | 
					
						
							| 
									
										
										
										
											2006-05-09 08:45:37 +00:00
										 |  |  | 		get_description ${file} | 
					
						
							|  |  |  | 		desc=${TDESC} | 
					
						
							|  |  |  | 		echo -e "\t\t<member name=\"${fname%%.c}.so\" displayname=\"${desc}\">" | 
					
						
							| 
									
										
										
										
											2006-04-24 17:11:45 +00:00
										 |  |  | 		awk -f build_tools/get_moduledeps ${file} | 
					
						
							|  |  |  | 		echo -e "\t\t</member>" | 
					
						
							|  |  |  | 	done | 
					
						
							|  |  |  | 	echo -e "\t</category>" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | echo "<?xml version="1.0"?>" | 
					
						
							|  |  |  | echo | 
					
						
							|  |  |  | echo "<menu>" | 
					
						
							|  |  |  | process_dir apps app APPS Applications | 
					
						
							|  |  |  | process_dir cdr cdr CDR "Call Detail Recording" | 
					
						
							|  |  |  | process_dir channels chan CHANNELS "Channel Drivers" | 
					
						
							|  |  |  | process_dir codecs codec CODECS "Codec Translators" | 
					
						
							|  |  |  | process_dir formats format FORMATS "Format Interpreters" | 
					
						
							| 
									
										
										
										
											2006-04-28 17:17:46 +00:00
										 |  |  | process_dir funcs func FUNCS "Dialplan Functions" | 
					
						
							| 
									
										
										
										
											2006-04-24 17:11:45 +00:00
										 |  |  | process_dir pbx pbx PBX "PBX Modules" | 
					
						
							|  |  |  | process_dir res res RES "Resource Modules" | 
					
						
							|  |  |  | cat build_tools/cflags.xml | 
					
						
							|  |  |  | echo "</menu>" |