📄 combine.shar
字号:
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2000-03-19 15:00 EST by <jcej@chiroptera.tragus.org>.
# Source directory was `/home/jcej/projects/ACE_wrappers/docs/tutorials/011'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 442 -rw-rw-r-- hdr
# 48 -rw-rw-r-- bodies
# 869 -rw-rw-r-- page01.pre
# 164 -rw-rw-r-- page02.pre
# 174 -rw-rw-r-- page03.pre
# 127 -rw-rw-r-- page04.pre
# 2691 -rw-rw-r-- page05.pre
# 707 -rw-rw-r-- page06.pre
# 351 -rw-rw-r-- page02.pst
# 365 -rw-rw-r-- page03.pst
# 129 -rw-rw-r-- page04.pst
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
shar_touch=touch
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh32588; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= hdr ==============
if test -f 'hdr' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'hdr' '(file already exists)'
else
$echo 'x -' extracting 'hdr' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'hdr' &&
<HTML>
<HEAD>
X <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
X <META NAME="Author" CONTENT="James CE Johnson">
X <TITLE>ACE Tutorial 011</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
X
<CENTER><B><FONT SIZE=+2>ACE Tutorial 011</FONT></B></CENTER>
X
<CENTER><B><FONT SIZE=+2>Passing non-trivial data through an ACE_Message_Queue</FONT></B></CENTER>
X
X
<P>
<HR WIDTH="100%">
SHAR_EOF
$shar_touch -am 03191459100 'hdr' &&
chmod 0664 'hdr' ||
$echo 'restore of' 'hdr' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'hdr:' 'MD5 check failed'
cf10a170c9ca8512b7051526e2dcf83c hdr
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'hdr'`"
test 442 -eq "$shar_count" ||
$echo 'hdr:' 'original size' '442,' 'current size' "$shar_count!"
fi
fi
# ============= bodies ==============
if test -f 'bodies' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'bodies' '(file already exists)'
else
$echo 'x -' extracting 'bodies' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'bodies' &&
PAGE=2
message_queue.cpp
task.h task.cpp
data.h
SHAR_EOF
$shar_touch -am 0124155199 'bodies' &&
chmod 0664 'bodies' ||
$echo 'restore of' 'bodies' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'bodies:' 'MD5 check failed'
db3ba3829b49952c833adb921acd3d3f bodies
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bodies'`"
test 48 -eq "$shar_count" ||
$echo 'bodies:' 'original size' '48,' 'current size' "$shar_count!"
fi
fi
# ============= page01.pre ==============
if test -f 'page01.pre' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'page01.pre' '(file already exists)'
else
$echo 'x -' extracting 'page01.pre' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'page01.pre' &&
<P>
In the previous tutorial we learned how to put text into a message queue.
While that may be useful, it isn't very exciting or realistic. In most
cases you'll need to move complex data structures between your threads.
<P>
In this tutorial I'll expand the previous by moving not only a text string
but also a more complex object. In the next tutorial I'll change things
again so that we move the complex object a bit more efficiently.
<P>
A simple abstract for a simple tutorial:
<UL>
In this tutorial, we put some data into the blocks of the message queue.
We copy the data from a Data object into the block and put it on the
queue. The block is then dequeued by the thread which picks it up and
processes it. This tutorial is very similar to the previous
one with the extra touch being population of the blocks with data.
</UL>
(Abstract by Kirthika, as always.)
SHAR_EOF
$shar_touch -am 03191459100 'page01.pre' &&
chmod 0664 'page01.pre' ||
$echo 'restore of' 'page01.pre' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page01.pre:' 'MD5 check failed'
58768929bbe513a9fa2302b1fe3170be page01.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
test 869 -eq "$shar_count" ||
$echo 'page01.pre:' 'original size' '869,' 'current size' "$shar_count!"
fi
fi
# ============= page02.pre ==============
if test -f 'page02.pre' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'page02.pre' '(file already exists)'
else
$echo 'x -' extracting 'page02.pre' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'page02.pre' &&
We'll look first at <A HREF="message_queue.cpp">main()</A>. A large part of this is
the same as before, so I've only commented the changes.
<P>
X
<HR WIDTH="100%">
SHAR_EOF
$shar_touch -am 03191459100 'page02.pre' &&
chmod 0664 'page02.pre' ||
$echo 'restore of' 'page02.pre' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page02.pre:' 'MD5 check failed'
ccd60d44cf4f9730aa16ff042f324c8e page02.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page02.pre'`"
test 164 -eq "$shar_count" ||
$echo 'page02.pre:' 'original size' '164,' 'current size' "$shar_count!"
fi
fi
# ============= page03.pre ==============
if test -f 'page03.pre' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'page03.pre' '(file already exists)'
else
$echo 'x -' extracting 'page03.pre' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'page03.pre' &&
X
Our Task object <A HREF="task.h">declaration</a> and <A HREF="task.cpp">definition</a>.
X As with message_queue.cpp,
I've only commented the changes.
<P>
X
<HR WIDTH="100%">
SHAR_EOF
$shar_touch -am 03191459100 'page03.pre' &&
chmod 0664 'page03.pre' ||
$echo 'restore of' 'page03.pre' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'page03.pre:' 'MD5 check failed'
e99896d191834752e7e07317af06ea0c page03.pre
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pre'`"
test 174 -eq "$shar_count" ||
$echo 'page03.pre:' 'original size' '174,' 'current size' "$shar_count!"
fi
fi
# ============= page04.pre ==============
if test -f 'page04.pre' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'page04.pre' '(file already exists)'
else
$echo 'x -' extracting 'page04.pre' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'page04.pre' &&
X
Before we go further, let's look at this <A HREF="data.h">Data</A> object
that's causing all the fuss.
X
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -