From b75e7dbbdc665cb543b39ed07e66b6fba29c7bee Mon Sep 17 00:00:00 2001 From: Karchnu Date: Wed, 15 Feb 2023 10:59:52 +0100 Subject: [PATCH] Documentation: fig document + makefile. --- docs/figlayers | 151 ++++++++++++++++++++++++++++++++++++++++ docs/figs/graph-this.sh | 34 +++++++++ docs/libipc.fig | 109 +++++++++++++++++++++++++++++ docs/makefile.fig | 21 ++++++ 4 files changed, 315 insertions(+) create mode 100755 docs/figlayers create mode 100755 docs/figs/graph-this.sh create mode 100644 docs/libipc.fig create mode 100644 docs/makefile.fig diff --git a/docs/figlayers b/docs/figlayers new file mode 100755 index 0000000..aaf33f5 --- /dev/null +++ b/docs/figlayers @@ -0,0 +1,151 @@ +#!/bin/sh + +# +# Extract layers from a FIG file +# +# History +# 2002/04/23 : pda : design +# 2013/02/12 : pda : extension to intervals +# + +usage () +{ + echo "usage: $0 layer[-layer] ... < fig-file > fig-file" >&2 + exit 1 +} + +if [ $# = 0 ] +then + usage +fi + +LAYERS="$*" + +for i +do + if expr "$i" : "^[0-9][0-9]*-[0-9][0-9]*$" > /dev/null + then + MIN=`expr "$i" : "\([0-9]*\)-"` + MAX=`expr "$i" : ".*-\([0-9]*\)"` + if [ $MIN -gt $MAX ] + then usage + fi + while [ $MIN -le $MAX ] + do + LAYERS="$LAYERS $MIN" + MIN=`expr $MIN + 1` + done + elif expr "$i" : "^[0-9][0-9]*$" > /dev/null + then + LAYERS="$LAYERS $i" + else + usage + fi +done + +awk -v "layers_string=$LAYERS" -F" " ' + BEGIN { + split (layers_string, layers, "[ \t]") + } + /^#FIG/ { + version = $2 + if (version != 3.2) + { + print "Invalid FIG version ($0)" > "/dev/stderr" + } + print + afficher = 1 + next + } + /^0 / { + # color pseudo object + afficher = 1 + print + next + } + /^1 / { + # ellipse + if (layerok($7)) + { + afficher = 1 + print + } + else afficher = 0 + next + } + /^2 / { + # polyline + if (layerok($7)) + { + afficher = 1 + print + } + else afficher = 0 + next + } + /^3 / { + # spline + if (layerok($7)) + { + afficher = 1 + print + } + else afficher = 0 + next + } + /^4 / { + # text + if (layerok($4)) + { + afficher = 1 + print + } + else afficher = 0 + next + } + /^5 / { + # arc + if (layerok($7)) + { + afficher = 1 + print + } + else afficher = 0 + next + } + /^6 / { + # compound + afficher = 1 + print + next + } + /^-6 / { + # end of compound + afficher = 1 + print + next + } + /^ / { + # ligne de continuation + if (afficher) + { + print + } + next + } + { + afficher = 1 + print + next + } + + function layerok (l, ok, n) + { + ok = 0 + for (n in layers) + { + if (l == layers [n]) + ok = 1 + } + return ok + }' - diff --git a/docs/figs/graph-this.sh b/docs/figs/graph-this.sh new file mode 100755 index 0000000..4b71160 --- /dev/null +++ b/docs/figs/graph-this.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +for i in *.fig +do + # latin1 accents + grep -E "[ôéèàîÉê]" $i 2>/dev/null 1>/dev/null + if [ $? -eq 0 ]; then + echo $i matches a latin1 accent + sed -r -i "s/É/\\\311/g" $i + sed -r -i "s/à/\\\340/g" $i + sed -r -i "s/è/\\\350/g" $i + sed -r -i "s/é/\\\351/g" $i + sed -r -i "s/ê/\\\352/g" $i + sed -r -i "s/î/\\\356/g" $i + sed -r -i "s/ô/\\\364/g" $i + # sed -r -i "s/°/\\\176/g" $i + fi + + PDF=$(echo ${i} | sed "s/fig$/pdf/") + + if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ] + then + + echo "fig2ps ${i}" + fig2dev -L pdf ${i} > ${PDF} + + echo "touch ${PDF}" + touch ${PDF} + + # echo "make and touch ${PDF}" + # pdf2ps ${PDF} + # touch ${PDF} + fi +done diff --git a/docs/libipc.fig b/docs/libipc.fig new file mode 100644 index 0000000..71f61d4 --- /dev/null +++ b/docs/libipc.fig @@ -0,0 +1,109 @@ +#FIG 3.2 Produced by xfig version 3.2.7a +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +5 1 0 3 0 7 30 -1 -1 0.000 0 0 1 0 3646.767 3431.191 2160 4950 1530 3240 2340 1755 + 1 1 2.00 90.00 150.00 +2 2 0 1 0 7 30 -1 -1 0.000 0 0 -1 0 0 5 + 8955 1395 11115 1395 11115 1755 8955 1755 8955 1395 +2 1 0 3 0 7 30 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 2.00 75.00 150.00 + 1 1 2.00 75.00 150.00 + 4230 1530 8955 1530 +2 1 0 3 0 7 30 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 2.00 75.00 150.00 + 1 1 2.00 75.00 150.00 + 4230 1665 8955 3150 +2 1 0 3 0 7 15 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 2.00 75.00 150.00 + 1 1 2.00 75.00 150.00 + 9990 3420 9990 4950 +2 2 0 1 0 7 5 -1 -1 0.000 0 0 -1 0 0 5 + 8955 4950 11115 4950 11115 5310 8955 5310 8955 4950 +2 2 0 1 0 7 15 -1 -1 0.000 0 0 -1 0 0 5 + 8955 3060 11115 3060 11115 3420 8955 3420 8955 3060 +2 2 0 1 0 7 5 -1 -1 0.000 0 0 -1 0 0 5 + 2070 4950 4230 4950 4230 5310 2070 5310 2070 4950 +2 1 0 3 0 7 10 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 4230 5130 8955 5130 +2 2 0 1 0 7 15 -1 -1 0.000 0 0 -1 0 0 5 + 2070 3060 2880 3060 2880 3420 2070 3420 2070 3060 +2 2 0 1 0 7 15 -1 -1 0.000 0 0 -1 0 0 5 + 3375 3060 4185 3060 4185 3420 3375 3420 3375 3060 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 6435 2295 +2 2 0 1 0 7 30 -1 -1 0.000 0 0 -1 0 0 5 + 2070 1395 4230 1395 4230 1755 2070 1755 2070 1395 +2 1 0 3 0 7 25 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 9360 6345 10620 6345 +2 1 1 3 1 7 25 -1 -1 8.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 9225 4950 9225 3420 +2 1 1 3 1 7 25 -1 -1 8.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 4185 3105 8955 3105 +2 1 1 3 1 7 25 -1 -1 2.000 0 0 -1 1 1 2 + 1 1 1.00 60.00 90.00 + 1 1 1.00 60.00 90.00 + 2880 3105 3375 3105 +2 1 1 3 1 7 25 -1 -1 8.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 2430 4950 2430 3420 +2 1 1 3 1 7 25 -1 -1 8.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 9360 6075 10620 6075 +2 1 0 3 0 7 25 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 3780 4950 3780 3420 +2 1 0 3 0 7 25 -1 -1 0.000 0 0 -1 1 1 2 + 1 1 3.00 90.00 150.00 + 1 1 3.00 90.00 150.00 + 4185 3375 8955 3375 +2 2 0 0 0 7 999 -1 -1 0.000 0 0 -1 0 0 5 + 0 0 13365 0 13365 7830 0 7830 0 0 +4 1 0 30 -1 16 20 0.0000 4 240 5625 6705 540 LibIPC communications with a browser\001 +4 1 0 30 -1 16 16 0.0000 4 210 1620 3105 1665 Web Browser\001 +4 1 0 30 -1 16 16 0.0000 4 210 1545 3105 5220 JS or WASM\001 +4 1 0 30 -1 16 16 0.0000 4 210 1425 9990 1665 Web Server\001 +4 1 0 30 -1 16 16 5.9865 4 270 2460 6615 2295 dynamic interactions\001 +4 1 0 30 -1 16 14 5.9865 4 225 3465 6435 2700 (the webserver could be a proxy)\001 +4 1 0 30 -1 16 16 0.0000 4 210 1485 9990 3330 Websocketd\001 +4 1 0 30 -1 16 16 0.0000 4 210 1185 6705 1395 static files\001 +4 1 0 5 -1 16 16 0.0000 4 210 795 9990 5220 Server\001 +4 1 0 20 -1 16 20 0.0000 4 240 4560 6705 540 Remote libIPC communications\001 +4 1 0 10 -1 16 20 0.0000 4 240 4200 6705 540 Local libIPC communications\001 +4 0 0 15 -1 16 16 0.0000 4 210 2475 10170 4275 IPC communications\001 +4 0 0 50 -1 16 12 0.0000 4 150 855 2115 5895 10 = local\001 +4 0 0 50 -1 16 12 0.0000 4 150 1305 2115 6135 15 = all remote\001 +4 0 0 50 -1 16 12 0.0000 4 135 1050 2115 6375 20 = remote\001 +4 0 0 50 -1 16 12 0.0000 4 150 795 2115 6615 30 = web\001 +4 0 0 50 -1 16 12 0.0000 4 150 645 2115 5670 05 = all\001 +4 1 0 10 -1 16 16 0.0000 4 255 1710 6570 5490 (Unix sockets)\001 +4 1 0 10 -1 16 16 0.0000 4 210 2595 6570 4950 Direct communication\001 +4 1 0 11 -1 16 16 0.0000 4 210 690 3060 5220 Client\001 +4 0 0 50 -1 16 12 0.0000 4 150 1890 3375 5895 12 = local and remote\001 +4 1 0 20 -1 16 16 0.0000 4 210 690 3780 3330 TCPd\001 +4 1 0 20 -1 16 16 0.0000 4 210 600 2475 3330 IPCd\001 +4 0 0 50 -1 16 12 0.0000 4 195 2040 3375 6375 21 = IPCd explanations\001 +4 1 0 20 -1 16 16 0.0000 4 210 690 9990 3330 TCPd\001 +4 2 0 25 -1 16 10 0.0000 4 150 1395 2205 4140 tcp://remote/server\001 +4 2 0 25 -1 16 10 0.0000 4 120 675 9090 6390 Data flow\001 +4 2 0 25 -1 16 10 0.0000 4 120 1875 9090 6120 Connection establishment\001 +4 0 0 21 -1 16 14 0.0000 4 225 3825 4455 1620 contacts the right "protocol deamon"\001 +4 0 0 21 -1 16 14 0.0000 4 225 6690 4455 1935 after connection establishment, provides the socket to the client\001 +4 0 0 21 -1 16 14 0.0000 4 225 3600 4455 2250 therefore, never handles data flow\001 +4 2 18 21 -1 18 14 0.0000 4 180 630 4275 1620 IPCd:\001 diff --git a/docs/makefile.fig b/docs/makefile.fig new file mode 100644 index 0000000..3c8f69e --- /dev/null +++ b/docs/makefile.fig @@ -0,0 +1,21 @@ +all: allfigures + +FIGS=$(shell ls figs/*.fig) +FIGL=./figlayers + +LIBIPC=figs/libipc + +figlibipc: $(LIBIPC).fig + echo "libipc" + $(FIGL) 999 5 10-12 < $(LIBIPC).fig > $(LIBIPC)-1.fig # local + $(FIGL) 999 5 11-12 15 20-25 < $(LIBIPC).fig > $(LIBIPC)-2.fig # remote + $(FIGL) 999 5 15 30 < $(LIBIPC).fig > $(LIBIPC)-3.fig # web remote + +allfigures: figlibipc + echo "make ps" + cd figs/ ; ./graph-this.sh + # cd diag/ ; ./graph-this.sh + +clean: + echo "rm figs/*.ps" + rm figs/*.ps