summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-02-14 22:49:57 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-02-14 22:49:57 +0000
commit542dec4ce18de0b9c3bfe7ea961e49e5fc559d6d (patch)
tree573f749cc899f69e73d8d235390d27fff93aa63c /examples
parent8f5c2c76253447124abc6cf33b69ad53492f6184 (diff)
downloadgtk+-542dec4ce18de0b9c3bfe7ea961e49e5fc559d6d.tar.gz
The following changes are the beginning of the work on #71430.
* examples/extract.sh, examples/extract.awk: Make extraction work. * examples/Makefile (SUBDIRS): Remove packer. * examples/packer/pack.c, examples/packer/Makefile: Removed. * docs/tutorial/gtk-tut.sgml: Fix the included examples far enough to make them compile and (mostly) work, remove the packer example.
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile1
-rw-r--r--examples/extract.awk14
-rwxr-xr-xexamples/extract.sh12
3 files changed, 19 insertions, 8 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 940dd15a48..e19ffea8f4 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -19,7 +19,6 @@ SUBDIRS = arrow \
menu \
notebook \
packbox \
- packer \
paned \
pixmap \
progressbar \
diff --git a/examples/extract.awk b/examples/extract.awk
index a8fcba12db..25025f8e5b 100644
--- a/examples/extract.awk
+++ b/examples/extract.awk
@@ -6,8 +6,9 @@
# -c : Just do checking rather than output files
# -f <filename> : Extract a specific file
# -d : Extract files to current directory
+# -v : Verbose
-BEGIN {in_example=0; check=0; spec_example=""; do_output=0; flatten=0
+BEGIN {in_example=0; check=0; spec_example=""; do_output=0; flatten=0; verbose=0;
for (i=0 ; i < ARGC ; i++) {
if ( ARGV[i] == "-c" ) {
check = 1;
@@ -23,9 +24,12 @@ BEGIN {in_example=0; check=0; spec_example=""; do_output=0; flatten=0
} else if ( ARGV[i] == "-d" ) {
flatten = 1;
ARGV[i]="";
+ } else if ( ARGV[i] == "-v" ) {
+ verbose = 1;
+ ARGV[i] = "";
}
}
- }
+}
$2 == "example-start" && in_example == 1 { printf("\nERROR: nested example at line %d\n", NR) > "/dev/stderr";
exit}
@@ -43,11 +47,15 @@ $2 == "example-start" && check == 0 \
} else {
file_name = $4;
}
+ if (verbose == 1)
+ printf("%s\n", file_name);
do_output=1;
}
}
in_example==1 && check==0 && do_output==1 { gsub(/&amp;/, "\\&", $0);
+ gsub(/&lt;/, "<", $0);
+ gsub(/&gt;/, ">", $0);
print $0 >file_name }
$2 == "example-end" && in_example == 0 { printf("\nERROR: multiple ends at line %d\n", NR) > "/dev/stderr";
@@ -57,3 +65,5 @@ $2 == "example-end" { in_example=0; do_output=0 }
END {}
+
+
diff --git a/examples/extract.sh b/examples/extract.sh
index 49be113182..e7536a929f 100755
--- a/examples/extract.sh
+++ b/examples/extract.sh
@@ -7,18 +7,20 @@
# -c : Just do checking rather than output files
# -f <filename> : Extract a specific file
# -d : Extract files to current directory
-
+
+TUTORIAL=../docs/tutorial/gtk-tut.sgml
+
if [ -x /usr/bin/gawk ]; then
- gawk -f extract.awk ../docs/gtk_tut.sgml $1 $2 $3 $4 $5
+ gawk -f extract.awk $TUTORIAL $1 $2 $3 $4 $5
else
if [ -x /usr/bin/nawk ]; then
- nawk -f extract.awk ../docs/gtk_tut.sgml $1 $2 $3 $4 $5
+ nawk -f extract.awk $TUTORIAL $1 $2 $3 $4 $5
else
if [ -x /usr/bin/awk ]; then
- awk -f extract.awk ../docs/gtk_tut.sgml $1 $2 $3 $4 $5
+ awk -f extract.awk $TUTORIAL $1 $2 $3 $4 $5
else
if [ -x /bin/awk ]; then
- awk -f extract.awk ../docs/gtk_tut.sgml $1 $2 $3 $4 $5
+ awk -f extract.awk $TUTORIAL $1 $2 $3 $4 $5
else
echo "Can't find awk... please edit extract.sh by hand"
fi