~ubuntu-branches/ubuntu/precise/judy/precise

« back to all changes in this revision

Viewing changes to src/apps/demo/run_demo

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Y. Ts'o
  • Date: 2004-01-17 00:04:53 UTC
  • Revision ID: james.westby@ubuntu.com-20040117000453-d5sj6uoon2v1g4gf
Tags: upstream-0.0.4
ImportĀ upstreamĀ versionĀ 0.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# @(#) $Revision: 4.4 $ $Source: /judy/src/apps/demo/run_demo $
 
2
 
 
3
# Simple Judy example script.  See the first block of text below, or just run
 
4
# this with no arguments.
 
5
 
 
6
        BASE='interL'
 
7
        PROGRAM="$BASE.c"
 
8
        COMPILE="cc -I../.. -o $BASE $PROGRAM `find ../../ -name libJudy.a`"
 
9
 
 
10
        set -e                  # exit if anything goes wrong.
 
11
 
 
12
 
 
13
# GREET THE USER:
 
14
 
 
15
        cat <<-'EOF'
 
16
        This script illustrates a simple program that calls the Judy library,
 
17
        shows how to compile it, and then runs it for you.
 
18
 
 
19
        The program reads numbers from standard input and stores them in a
 
20
        JudyL array as array indexes.  The target value associated with each
 
21
        number (index) is the number of times it was duplicated in the input.
 
22
        Exit with ^D or ^C.
 
23
 
 
24
        Press RETURN to continue and view the program source code...
 
25
        EOF
 
26
 
 
27
        read input
 
28
 
 
29
 
 
30
# SHOW THE SAMPLE C PROGRAM:
 
31
 
 
32
        echo '____________________________________'
 
33
        echo
 
34
 
 
35
        cat $PROGRAM
 
36
 
 
37
        echo
 
38
        echo 'Press RETURN to continue...'
 
39
        read input
 
40
 
 
41
 
 
42
# COMPILE THE SAMPLE C PROGRAM:
 
43
 
 
44
        cat <<-EOF
 
45
 
 
46
        To compile this program with the Judy library already installed on your
 
47
        system, the simplest command line is:
 
48
 
 
49
            $COMPILE
 
50
 
 
51
        Press RETURN to continue and compile the program source code...
 
52
        EOF
 
53
 
 
54
        read input
 
55
        $COMPILE
 
56
 
 
57
 
 
58
# RUN THE SAMPLE C PROGRAM:
 
59
 
 
60
        echo
 
61
        echo "Press RETURN to run the sample program \"$BASE\"..."
 
62
        read input
 
63
 
 
64
        ./$BASE