Skip to content

Commit 2ae8f09

Browse files
committed
Puntapié inicial
0 parents  commit 2ae8f09

16 files changed

+1380
-0
lines changed

.cvsignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.libs
2+
.deps
3+
*.lo
4+
*.la
5+
Makefile
6+
Makefile.in
7+
aclocal.m4
8+
autom4te.cache
9+
autoscan.log
10+
config.log
11+
config.status
12+
configure
13+
configure.scan
14+
stamp-h1

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
C�digo base por Lowercases ([email protected])
2+

ChangeLog

Whitespace-only changes.

Makefile.am

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# shirc -- IRC support for shell scripting
3+
# Copyright (C) 2009 Ignacio Nin
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 2 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, write to the Free Software
17+
# Foundation, Inc.,
18+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
SUBDIRS = src
22+

NEWS

Whitespace-only changes.

README

Whitespace-only changes.

bootstrap

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
#
4+
# shirc -- IRC support for shell scripting
5+
# Copyright (C) 2009 Ignacio Nin
6+
#
7+
# This program is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 2 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc.,
20+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
#
22+
23+
aclocal &&
24+
automake --add-missing &&
25+
autoconf
26+

configure.ac

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#
2+
# shirc -- IRC support for shell scripting
3+
# Copyright (C) 2009 Ignacio Nin
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 2 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, write to the Free Software
17+
# Foundation, Inc.,
18+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
# -*- Autoconf -*-
22+
# Process this file with autoconf to produce a configure script.
23+
24+
AC_PREREQ(2.61)
25+
AC_INIT([shirc], [0.0.0], [[email protected]])
26+
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
27+
28+
# Checks for programs.
29+
AC_CHECK_PROG(BASH, bash, [not-found])
30+
[
31+
if test "x$BASH" == "xnot-found"
32+
then
33+
echo bash not found -- please install or specify
34+
exit 1
35+
fi
36+
]
37+
38+
AC_CHECK_PROG(NC, nc, [nc])
39+
[
40+
if test "x$NC" != "xnc"
41+
then
42+
echo nc $NC not found -- please install or specify
43+
exit 1
44+
fi
45+
]
46+
47+
AC_SUBST([NC], [$NC])
48+
49+
AC_CHECK_PROG(SED, sed, [sed])
50+
[
51+
if test "x$SED" != "xsed"
52+
then
53+
echo sed not found -- please install
54+
exit 1
55+
fi
56+
]
57+
58+
# Checks for libraries.
59+
60+
# Checks for header files.
61+
62+
# Checks for typedefs, structures, and compiler characteristics.
63+
64+
# Checks for library functions.
65+
66+
if test "x$prefix" == "xNONE"
67+
then
68+
AC_SUBST(PKGDATADIR, $ac_default_prefix/share/$PACKAGE_NAME)
69+
else
70+
AC_SUBST(PKGDATADIR, $prefix/share/$PACKAGE_NAME)
71+
fi
72+
73+
### Some definitions to avoid computing time later.
74+
75+
# uptime() builtin time calculation
76+
AC_SUBST([SHIRCDEF_SECPERYEAR], [`expr 60 \* 60 \* 24 \* 365`])
77+
AC_SUBST([SHIRCDEF_SECPERMONTH], [`expr 60 \* 60 \* 24 \* 31`])
78+
AC_SUBST([SHIRCDEF_SECPERDAY], [`expr 60 \* 60 \* 24`])
79+
AC_SUBST([SHIRCDEF_SECPERHOUR], [`expr 60 \* 60`]) # :P
80+
AC_SUBST([SHIRCDEF_SECPERMINUTE], [60]) # :P :P
81+
82+
AC_CONFIG_FILES([Makefile
83+
src/Makefile
84+
85+
src/shirc.sh
86+
src/callback.sh
87+
src/fifo.sh
88+
src/irc.sh
89+
src/messages.sh
90+
src/state.sh
91+
])
92+
AC_OUTPUT

src/.cvsignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.libs
2+
.deps
3+
*.lo
4+
*.la
5+
*.sh
6+
Makefile
7+
Makefile.in
8+
aclocal.m4
9+
autom4te.cache
10+
autoscan.log
11+
config.log
12+
config.status
13+
configure
14+
configure.scan
15+
stamp-h1

src/Makefile.am

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# shirc -- IRC support for shell scripting
3+
# Copyright (C) 2009 Ignacio Nin
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 2 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, write to the Free Software
17+
# Foundation, Inc.,
18+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
pkgdata_SCRIPTS = shirc.sh callback.sh fifo.sh irc.sh messages.sh state.sh
22+
23+
extra_CLEAN = $(pkgdata_SCRIPTS)

src/callback.sh.in

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
#
4+
# shirc -- IRC support for shell scripting
5+
# Copyright (C) 2009 Ignacio Nin
6+
#
7+
# This program is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 2 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc.,
20+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
#
22+
23+
#
24+
# Message callbacks
25+
#
26+
shirc_general_callback=""
27+
28+
#
29+
# Callback functions
30+
#
31+
# Callback functions will accept three parameters:
32+
# 1 -- Message source
33+
# 2 -- Message target (if on a channel, it will be the channel)
34+
# 3 -- Message text
35+
#
36+
37+
#
38+
# shirc_set_general_callback()
39+
#
40+
# This functions sets the callback for which there are no other callbacks set.
41+
#
42+
# Params:
43+
# 1 -- the name of the function
44+
#
45+
# Global variables:
46+
# shirc_general_callback
47+
#
48+
shirc_set_general_callback() {
49+
local callback
50+
51+
callback="$1"
52+
53+
shirc_general_callback="$callback"
54+
55+
return 0
56+
57+
}

src/fifo.sh.in

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
#
4+
# shirc -- IRC support for shell scripting
5+
# Copyright (C) 2009 Ignacio Nin
6+
#
7+
# This program is free software; you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation; either version 2 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc.,
20+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
#
22+
23+
#
24+
# shirc_create_fifos()
25+
#
26+
# Creates the FIFOs for communication
27+
#
28+
#
29+
30+
shirc_create_fifos() {
31+
for fifo in in out
32+
do
33+
if ! mkfifo "$shirc_tmp_dir/$fifo"
34+
then
35+
fatal_error "Couldn't create $fifo fifo"
36+
fi
37+
38+
done
39+
40+
shirc_fifo_in="$shirc_tmp_dir/in"
41+
shirc_fifo_out="$shirc_tmp_dir/out"
42+
43+
}
44+
45+
shirc_delete_fifos() {
46+
for fifo in in out
47+
do
48+
rm -f "$shirc_tmp_dir/$fifo"
49+
done
50+
51+
}

0 commit comments

Comments
 (0)