File: prcs-callback

package info (click to toggle)
prcs 1.3.3-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,128 kB
  • ctags: 3,354
  • sloc: cpp: 17,486; ansic: 8,132; sh: 4,710; perl: 2,729; lisp: 1,816; tcl: 1,142; lex: 354; makefile: 225; pascal: 85
file content (32 lines) | stat: -rwxr-xr-x 1,116 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# This file is associated with `prcs.el' and shares its copyright and
# disclaimers. Contact Jesse Glick <Jesse.Glick@netbeans.com> for
# information and to report bugs.
#
# $PrcsModeVersion: 1.61 on Sat, 06 Feb 1999 17:57:04 -0500 $

# When called with some number of arguments, this script:
#
# 1. Prints a special magic token on a line by itself.
# 2. Prints the number of args on a line by itself.
# 3. Prints each of the args in turn on their own lines.
# 4. Waits for input.
# 5. Reads a line (should be an integer), and exits with that status.

# Used by prcs.el as a value for $PRCS_DIFF_COMMAND or $PRCS_MERGE_COMMAND.
# The token is used to identify its execution in a general comint buffer.

# Do not let the uninterrupted token itself appear in any source code!
magic_1='MaGiC-PrCs-'
magic_2='CaLlBaCk-ToKeN'
# Read & write from/to tty because o.w. PRCS tries to snatch up our
# input and incorrectly buffer our output, devilishly.
(
    echo "$magic_1$magic_2"
    echo "$#"
    for arg; do echo "$arg"; done
) > /dev/tty
read status < /dev/tty
# echo $* $status >>/tmp/pc-trace
exit $status