1#!/bin/sh 2 3# 4# geninfocontrib_h.sh - infocontrib.h generator script 5# 6# Written by 7# Marco van den Heuvel <blackystardust68@yahoo.com> 8# 9# This file is part of VICE, the Versatile Commodore Emulator. 10# See README for copyright notice. 11# 12# This program is free software; you can redistribute it and/or modify 13# it under the terms of the GNU General Public License as published by 14# the Free Software Foundation; either version 2 of the License, or 15# (at your option) any later version. 16# 17# This program is distributed in the hope that it will be useful, 18# but WITHOUT ANY WARRANTY; without even the implied warranty of 19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20# GNU General Public License for more details. 21# 22# You should have received a copy of the GNU General Public License 23# along with this program; if not, write to the Free Software 24# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 25# 02111-1307 USA. 26# 27# Usage: geninfocontrib_h.sh <outputtype> 28# $1 29# 30 31if test "x$1" = "x"; then 32 echo no output type chosen 33 exit 1 34fi 35 36# extract years and name from input 37extractnames() 38{ 39 shift 40 shift 41 years=$1 42 shift 43 if test x"$years" = "x1993-1994,"; then 44 years="$years $1" 45 shift 46 fi 47 name="$*" 48} 49 50extractitem() 51{ 52 item=`echo $* | sed -e "s/@b{//" -e "s/}//"` 53} 54 55extractlang() 56{ 57 language=$3 58} 59 60extractyears() 61{ 62 years=$3 63} 64 65# use system echo if possible, as it supports backslash expansion 66if test -f /bin/echo; then 67 ECHO=/bin/echo 68else 69 if test -f /usr/bin/echo; then 70 ECHO=/usr/bin/echo 71 else 72 ECHO=echo 73 fi 74fi 75 76checkoutput() 77{ 78 dooutput=yes 79 case "$data" in 80 @c*|"@itemize @bullet"|@item|"@end itemize") dooutput=no ;; 81 esac 82} 83 84splititem4() 85{ 86 item1=$1 87 item2=$2 88 item3=$3 89 item4=$4 90} 91 92buildlists() 93{ 94 CORETEAM_MEMBERS="" 95 EXTEAM_MEMBERS="" 96 TRANSTEAM_MEMBERS="" 97 98 for i in $MEMBERS 99 do 100 item=`echo $i | sed 's/+/ /g'` 101 splititem4 $item 102 if test x"$item1" = "xCORE"; then 103 CORETEAM_MEMBERS="$CORETEAM_MEMBERS $i" 104 fi 105 if test x"$item1" = "xEX"; then 106 EXTEAM_MEMBERS="$EXTEAM_MEMBERS $i" 107 fi 108 if test x"$item1" = "xTRANS"; then 109 TRANSTEAM_MEMBERS="$TRANSTEAM_MEMBERS $i" 110 fi 111 done 112} 113 114buildallmembers() 115{ 116 ALL_MEMBERS="" 117 118 for i in $MEMBERS 119 do 120 item=`echo $i | sed 's/+/ /g'` 121 splititem4 $item 122 duplicate=no 123 for j in $ALL_MEMBERS 124 do 125 if test x"$item3" = "x$j"; then 126 duplicate=yes 127 fi 128 done 129 if test x"$duplicate" = "xno"; then 130 ALL_MEMBERS="$ALL_MEMBERS $item3" 131 fi 132 done 133} 134 135reverselist() 136{ 137 REVLIST="" 138 139 for i in $* 140 do 141 REVLIST="$i $REVLIST" 142 done 143} 144 145rm -f try.tmp 146$ECHO "\\\\n" >try.tmp 147n1=`cat try.tmp | wc -c` 148n2=`expr $n1 + 0` 149 150if test x"$n2" = "x3"; then 151 linefeed="\\\\n" 152else 153 linefeed="\\n" 154fi 155rm -f try.tmp 156 157# ----------------------------------------------------------- 158# infocontrib.h output type 159 160if test x"$1" = "xinfocontrib.h"; then 161 $ECHO "/*" 162 $ECHO " * infocontrib.h - Text of contributors to VICE, as used in info.c" 163 $ECHO " *" 164 $ECHO " * Autogenerated by geninfocontrib_h.sh, DO NOT EDIT !!!" 165 $ECHO " *" 166 $ECHO " * Written by" 167 $ECHO " * Marco van den Heuvel <blackystardust68@yahoo.com>" 168 $ECHO " *" 169 $ECHO " * This file is part of VICE, the Versatile Commodore Emulator." 170 $ECHO " * See README for copyright notice." 171 $ECHO " *" 172 $ECHO " * This program is free software; you can redistribute it and/or modify" 173 $ECHO " * it under the terms of the GNU General Public License as published by" 174 $ECHO " * the Free Software Foundation; either version 2 of the License, or" 175 $ECHO " * (at your option) any later version." 176 $ECHO " *" 177 $ECHO " * This program is distributed in the hope that it will be useful," 178 $ECHO " * but WITHOUT ANY WARRANTY; without even the implied warranty of" 179 $ECHO " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" 180 $ECHO " * GNU General Public License for more details." 181 $ECHO " *" 182 $ECHO " * You should have received a copy of the GNU General Public License" 183 $ECHO " * along with this program; if not, write to the Free Software" 184 $ECHO " * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA" 185 $ECHO " * 02111-1307 USA." 186 $ECHO " *" 187 $ECHO " */" 188 $ECHO "" 189 $ECHO "#ifndef VICE_INFOCONTRIB_H" 190 $ECHO "#define VICE_INFOCONTRIB_H" 191 $ECHO "" 192 $ECHO "const char info_contrib_text[] =" 193 194 outputok=no 195 coreteamsection=no 196 exteamsection=no 197 transteamsection=no 198 docteamsection=no 199 200 rm -f coreteam.tmp exteam.tmp transteam.tmp docteam.tmp team.tmp 201 202 while read data 203 do 204 if test x"$data" = "x@c ---vice-core-team-end---"; then 205 coreteamsection=no 206 fi 207 208 if test x"$data" = "x@c ---ex-team-end---"; then 209 exteamsection=no 210 fi 211 212 if test x"$data" = "x@c ---translation-team-end---"; then 213 transteamsection=no 214 fi 215 216 if test x"$data" = "x@c ---documentation-team-end---"; then 217 docteamsection=no 218 fi 219 220 if test x"$coreteamsection" = "xyes"; then 221 extractnames $data 222 $ECHO >>coreteam.tmp " { \"$years\", \"$name\", \"@b{$name}\" }," 223 yearencoded=`$ECHO "$years" | sed 's/ /_/g'` 224 nameencoded=`$ECHO "$name" | sed 's/ /_/g'` 225 $ECHO >>team.tmp "CORE+$yearencoded+$nameencoded" 226 fi 227 228 if test x"$exteamsection" = "xyes"; then 229 extractnames $data 230 $ECHO >>exteam.tmp " { \"$years\", \"$name\", \"@b{$name}\" }," 231 yearencoded=`$ECHO "$years" | sed 's/ /_/g'` 232 nameencoded=`$ECHO "$name" | sed 's/ /_/g'` 233 $ECHO >>team.tmp "EX+$yearencoded+$nameencoded" 234 fi 235 236 if test x"$transteamsection" = "xyes"; then 237 extractitem $data 238 $ECHO "\" $data$linefeed\"" 239 read data 240 extractyears $data 241 $ECHO "\" $data$linefeed\"" 242 read data 243 extractlang $data 244 $ECHO "\" $data$linefeed\"" 245 read data 246 $ECHO >>transteam.tmp " { \"$years\", \"$item\", \"$language\", \"@b{$item}\" }," 247 nameencoded=`$ECHO "$item" | sed 's/ /_/g'` 248 $ECHO >>team.tmp "TRANS+$years+$nameencoded+$language" 249 fi 250 251 if test x"$docteamsection" = "xyes"; then 252 extractitem $data 253 $ECHO "\" $data$linefeed\"" 254 read data 255 $ECHO >>docteam.tmp " \"$item\"," 256 fi 257 258 if test x"$data" = "x@c ---vice-core-team---"; then 259 coreteamsection=yes 260 fi 261 262 if test x"$data" = "x@c ---ex-team---"; then 263 exteamsection=yes 264 fi 265 266 if test x"$data" = "x@c ---translation-team---"; then 267 transteamsection=yes 268 fi 269 270 if test x"$data" = "x@c ---documentation-team---"; then 271 docteamsection=yes 272 fi 273 274 if test x"$data" = "x@node Copyright, Contacts, Acknowledgments, Top"; then 275 $ECHO "\"$linefeed\";" 276 outputok=no 277 fi 278 if test x"$outputok" = "xyes"; then 279 checkoutput 280 if test x"$dooutput" = "xyes"; then 281 if test x"$data" = "x"; then 282 $ECHO "\"$linefeed\"" 283 else 284 $ECHO "\" $data$linefeed\"" 285 fi 286 fi 287 fi 288 if test x"$data" = "x@chapter Acknowledgments"; then 289 outputok=yes 290 fi 291 done 292 293 $ECHO "" 294 $ECHO "vice_team_t core_team[] = {" 295 cat coreteam.tmp 296 rm -f coreteam.tmp 297 $ECHO " { NULL, NULL, NULL }" 298 $ECHO "};" 299 $ECHO "" 300 $ECHO "vice_team_t ex_team[] = {" 301 cat exteam.tmp 302 rm -f exteam.tmp 303 $ECHO " { NULL, NULL, NULL }" 304 $ECHO "};" 305 $ECHO "" 306 $ECHO "char *doc_team[] = {" 307 cat docteam.tmp 308 rm -f docteam.tmp 309 $ECHO " NULL" 310 $ECHO "};" 311 $ECHO "" 312 $ECHO "vice_trans_t trans_team[] = {" 313 cat transteam.tmp 314 rm -f transteam.tmp 315 $ECHO " { NULL, NULL, NULL, NULL }" 316 $ECHO "};" 317 $ECHO "#endif" 318fi 319 320# ----------------------------------------------------------- 321# AUTHORS output type 322 323if test x"$1" = "xAUTHORS"; then 324 MEMBERS=`cat team.tmp` 325 buildlists 326 $ECHO "Core Team Members:" 327 $ECHO "" 328 for i in $CORETEAM_MEMBERS 329 do 330 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 331 splititem4 $decodedall 332 decoded=`$ECHO "$item3" | sed 's/_/ /g'` 333 $ECHO "@b{$decoded}" 334 done 335 $ECHO "" 336 $ECHO "" 337 $ECHO "Inactive/Ex Team Members:" 338 $ECHO "" 339 for i in $EXTEAM_MEMBERS 340 do 341 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 342 splititem4 $decodedall 343 decoded=`$ECHO "$item3" | sed 's/_/ /g'` 344 $ECHO "@b{$decoded}" 345 done 346 $ECHO "" 347 $ECHO "" 348 $ECHO "Translation Team Members:" 349 $ECHO "" 350 for i in $TRANSTEAM_MEMBERS 351 do 352 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 353 splititem4 $decodedall 354 decoded=`$ECHO "$item3" | sed 's/_/ /g'` 355 $ECHO "@b{$decoded}" 356 done 357fi 358 359# ----------------------------------------------------------- 360# README output type 361 362if test x"$1" = "xREADME"; then 363 MEMBERS=`cat team.tmp` 364 buildlists 365 outputok=yes 366 367 old_IFS=$IFS 368 IFS='' 369 while read data 370 do 371 if test x"$data" = "x VICE, the Versatile Commodore Emulator"; then 372 IFS=$old_IFS 373 $ECHO " VICE, the Versatile Commodore Emulator" 374 $ECHO "" 375 $ECHO " Core Team Members:" 376 for i in $CORETEAM_MEMBERS 377 do 378 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 379 splititem4 $decodedall 380 decodedyear=`$ECHO "$item2" | sed 's/_/ /g'` 381 decodedname=`$ECHO "$item3" | sed 's/_/ /g'` 382 $ECHO " $decodedyear $decodedname" 383 done 384 $ECHO "" 385 $ECHO " Inactive/Ex Team Members:" 386 for i in $EXTEAM_MEMBERS 387 do 388 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 389 splititem4 $decodedall 390 decodedyear=`$ECHO "$item2" | sed 's/_/ /g'` 391 decodedname=`$ECHO "$item3" | sed 's/_/ /g'` 392 $ECHO " $decodedyear $decodedname" 393 done 394 $ECHO "" 395 $ECHO " Translation Team Members:" 396 for i in $TRANSTEAM_MEMBERS 397 do 398 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 399 splititem4 $decodedall 400 decodedyear=`$ECHO "$item2" | sed 's/_/ /g'` 401 decodedname=`$ECHO "$item3" | sed 's/_/ /g'` 402 $ECHO " $decodedyear $decodedname" 403 done 404 $ECHO "" 405 IFS='' 406 read data 407 while test x"$data" != "x This program is free software; you can redistribute it and/or" 408 do 409 read data 410 done 411 fi 412 413 if test x"$outputok" = "xyes"; then 414 $ECHO "$data" 415 fi 416 done 417fi 418 419# ----------------------------------------------------------- 420# index.html output type 421 422if test x"$1" = "xindexhtml"; then 423 MEMBERS=`cat team.tmp` 424 buildlists 425 426 old_IFS=$IFS 427 IFS='' 428 while read data 429 do 430 if test x"$data" = "x<!--teamstart-->"; then 431 IFS=$old_IFS 432 $ECHO "<!--teamstart-->" 433 $ECHO "<p>" 434 $ECHO "Current VICE team members:" 435 decodedname="" 436 for i in $CORETEAM_MEMBERS 437 do 438 if test x"$decodedname" != "x"; then 439 $ECHO "$decodedname," 440 fi 441 decodedall=`$ECHO "$i" | sed 's/+/ /g'` 442 splititem4 $decodedall 443 decodedname=`$ECHO "$item3" | sed 's/_/ /g'` 444 done 445 $ECHO "$decodedname." 446 $ECHO "</p>" 447 $ECHO "" 448 $ECHO "<p>Of course our warm thanks go to everyone who has helped us in developing" 449 $ECHO "VICE during these past few years. For a more detailed list look in the" 450 $ECHO "<a href=\"vice_16.html\">documentation</a>." 451 $ECHO "" 452 $ECHO "" 453 $ECHO "<hr>" 454 $ECHO "" 455 $ECHO "<h1><a NAME=\"copyright\"></a>Copyright</h1>" 456 $ECHO "" 457 $ECHO "<p>" 458 $ECHO "The VICE is copyrighted to" 459 buildallmembers 460 decodedname="" 461 for i in $ALL_MEMBERS 462 do 463 if test x"$decodedname" != "x"; then 464 $ECHO "$decodedname," 465 fi 466 if test x"$i" != "x"; then 467 decodedname=`$ECHO "$i" | sed 's/_/ /g'` 468 fi 469 done 470 $ECHO "$decodedname." 471 IFS='' 472 read data 473 while test x"$data" != "x<!--teamend-->" 474 do 475 read data 476 done 477 fi 478 479 $ECHO "$data" 480 done 481fi 482 483# ----------------------------------------------------------- 484# vice.1 man output type 485 486if test x"$1" = "xvice1"; then 487 MEMBERS=`cat team.tmp` 488 buildlists 489 buildallmembers 490 foundauthors=no 491 492 while test x"$foundauthors" != "xyes" 493 do 494 read data 495 if test x"$data" = "x.SH AUTHORS"; then 496 $ECHO ".SH AUTHORS" 497 for i in $ALL_MEMBERS 498 do 499 decoded=`$ECHO "$i" | sed 's/_/ /g'` 500 $ECHO "@b{$decoded}" 501 $ECHO ".br" 502 done 503 $ECHO "with several contributions from other people around the world; see the" 504 $ECHO "HTML documentation for more information." 505 $ECHO "" 506 $ECHO "" 507 foundauthors=yes 508 fi 509 510 if test x"$foundauthors" != "xyes"; then 511 $ECHO $data 512 fi 513 done 514fi 515