Asg
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- 1410 discussions
1
0
1
0
aesop Repository branch, master, updated. 740dd98e4720d8c6cf15b5003d5236d7ed858919
by noreply@mcs.anl.gov 10 Feb '12
by noreply@mcs.anl.gov 10 Feb '12
10 Feb '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "aesop Repository".
The branch, master has been updated
via 740dd98e4720d8c6cf15b5003d5236d7ed858919 (commit)
via 146e2adb68430ac606c75f16288a45c5df5ddb72 (commit)
from c9c79922c0ae8acb4a0ffa7dcdd32aae3f58f25e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 740dd98e4720d8c6cf15b5003d5236d7ed858919
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Fri Feb 10 18:24:53 2012 -0600
Add support for asciidoc building
commit 146e2adb68430ac606c75f16288a45c5df5ddb72
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Fri Feb 10 11:17:37 2012 -0600
Add ditaa (for asciidoc)
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 36 ++++--
configure.ac | 11 ++
maint/ditaa/COPYING | 340 ++++++++++++++++++++++++++++++++++++++++++++++
maint/ditaa/HISTORY | 16 ++
maint/ditaa/ditaa.jar | 1 +
maint/ditaa/ditaa0_9.jar | Bin 0 -> 186095 bytes
maint/handle-ditaa.py | 70 ++++++++++
7 files changed, 464 insertions(+), 10 deletions(-)
create mode 100644 maint/ditaa/COPYING
create mode 100644 maint/ditaa/HISTORY
create mode 120000 maint/ditaa/ditaa.jar
create mode 100644 maint/ditaa/ditaa0_9.jar
create mode 100755 maint/handle-ditaa.py
Diff of changes:
diff --git a/Makefile.in b/Makefile.in
index 6eba324..32a6fa2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -38,6 +38,10 @@ sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
+# tools
+A2X = @A2X@
+ASCIIDOC = @ASCIIDOC@
+
# subdirs that contain configure/make
SUBDIRS = @subdirs@
@@ -129,7 +133,7 @@ PROGRAMSRC :=
TEST_OUT :=
TEST_RESULTS :=
-DOCSRC :=
+ASCIIDOCSRC :=
# Eliminate all default suffixes. We want explicit control.
.SUFFIXES:
@@ -374,8 +378,13 @@ endif
-DOCHTML=$(patsubst %.txt,%.html,$(DOCSRC))
-DOCPDF=$(patsubst %.txt,%.pdf,$(DOCSRC))
+DOCHTML=$(patsubst %.txt,%.html,$(ASCIIDOCSRC))
+DOCPDF=$(patsubst %.txt,%.pdf,$(ASCIIDOCSRC))
+
+CLEANDOC=
+CLEANDOC+=$(patsubst %.txt,%.html,$(ASCIIDOCSRC))
+CLEANDOC+=$(patsubst %.txt,%.pdf,$(ASCIIDOCSRC))
+CLEANDOC+=$(patsubst %.txt,%.ditta_txt,$(ASCIIDOCSRC))
####################################################################
# Rules and dependencies
@@ -589,7 +598,7 @@ INTERM=$(INTERM_AESRC) \
$(INTERM_AEINC) \
$(INTERM_HAEINC)
-clean::
+clean:: docclean
$(Q) " CLEAN"
$(E)rm -f $(AEOBJS) $(LIBOBJS) $(GENLIBOBJS) $(AETEST) $(AEPROGRAM) $(TEST) $(PROGRAM) \
$(AESOP_TRHDR) $(TESTLIBOBJS) \
@@ -600,6 +609,12 @@ parserclean::
$(Q) " PARSER CLEAN"
$(E)rm -f $(HSBIN) $(HSOBJ) $(HSINT)
+
+.PHONY: docclean
+docclean:
+ $(Q) " DOCCLEAN"
+ $(E) rm -f $(CLEANDOC)
+
# this is where we include all of our automatic dependencies.
# NOTE: we wrap this in ifneq's in order to prevent the dependencies
# from being generated for special targets that don't require them
@@ -629,18 +644,19 @@ etags:
#%.txt: %.doc
# $(srcdir)/maint/handle-ditaa.py -j $(srcdir)/maint/ditaa/ditaa.jar -d $(dir $@) $< > $@
#
-$(DOCHTML): %.html: %.ditta_txt
- $(srcdir)/maint/asciidoc/asciidoc/asciidoc.py -a data-uri -a icons -a toc -a max-width=55em $<
+%.html: %.ditta_txt
+ $(ASCIIDOC) -a data-uri -a icons -a toc -a max-width=55em $<
+
+%.pdf: %.ditta_txt
+ $(A2X) -L -v -v --dblatex-opts "-P latex.output.revhistory=0" -a data-uri -a icons -a toc -a max-width=55em $<
-$(DOCPDF): %.pdf: %.ditta_txt
- $(srcdir)/maint/asciidoc/asciidoc/a2x.py -L -v -v --dblatex-opts "-P latex.output.revhistory=0" -a data-uri -a icons -a toc -a max-width=55em $<
+.INTERMEDIATE: %.ditta_txt
%.ditta_txt: %.txt
$(srcdir)/maint/handle-ditaa.py -j $(srcdir)/maint/ditaa/ditaa.jar -d $(dir $@) $< > $@
-#%.pdf: %.txt
-# $(srcdir)/maint/asciidoc/asciidoc/a2x.py --dblatex-opts "-P latex.output.revhistory=0" -a data-uri -a icons -a toc -a max-width=55em $<
+.PHONY: docs doc docshtml dochtml
docs: $(DOCPDF)
doc: $(DOCPDF)
docshtml: $(DOCHTML)
diff --git a/configure.ac b/configure.ac
index ccd61a0..6912ff4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,18 @@ else
fi
fi
+dnl ==========================================================================
+dnl ==== Documentation =======================================================
+dnl ==========================================================================
+
+AC_ARG_VAR([A2X], [Asciidoc a2x tool])
+AC_CHECK_PROGS([A2X], [a2x a2x.py], [])
+AC_CHECK_PROGS([ASCIIDOC], [asciidoc asciidoc.py], [])
+
+
+dnl ==========================================================================
dnl check for unix variants
+dnl ==========================================================================
AX_UNIX("")
BUILD_ABSOLUTE_TOP=${PWD}
diff --git a/maint/ditaa/COPYING b/maint/ditaa/COPYING
new file mode 100644
index 0000000..5b6e7c6
--- /dev/null
+++ b/maint/ditaa/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/maint/ditaa/HISTORY b/maint/ditaa/HISTORY
new file mode 100644
index 0000000..41b9339
--- /dev/null
+++ b/maint/ditaa/HISTORY
@@ -0,0 +1,16 @@
+Version 0.9
+* New shapes:
+ * Ellipse {o}
+ * Manual operation {mo}
+ * Decision {c} ("Choice")
+ * Trapezoid {tr}
+* Eliminated memory leak
+* Further parsing optimisations (pre-compiled regexes)
+
+Version 0.8
+* Parsing optimisation (~90% faster)
+* Fixed line separation bugs
+* Fixed open shape rendering bugs (missing lines)
+* Generally more reliable
+* Tidying-up of command-line options (now using Apache commons-cli)
+* Streamlined release process
diff --git a/maint/ditaa/ditaa.jar b/maint/ditaa/ditaa.jar
new file mode 120000
index 0000000..39a10da
--- /dev/null
+++ b/maint/ditaa/ditaa.jar
@@ -0,0 +1 @@
+ditaa0_9.jar
\ No newline at end of file
diff --git a/maint/ditaa/ditaa0_9.jar b/maint/ditaa/ditaa0_9.jar
new file mode 100644
index 0000000..5894de4
Binary files /dev/null and b/maint/ditaa/ditaa0_9.jar differ
diff --git a/maint/handle-ditaa.py b/maint/handle-ditaa.py
new file mode 100755
index 0000000..e822efc
--- /dev/null
+++ b/maint/handle-ditaa.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python
+import sys
+import re
+import subprocess
+import tempfile
+import getopt
+import os
+
+header = re.compile("\[DITAA START\s+\((.*?)\)?\]")
+
+def main(document, ditaaPath, imageDir):
+ parsed = []
+ parsing = False
+ filename = ""
+ worklist = {}
+ for line in document:
+ m = header.match(line)
+ if m:
+ flags = m.groups()
+ if flags:
+ flags = "[%s]" % flags
+ else:
+ flags = ""
+ handle, filename = tempfile.mkstemp(
+ suffix=".jpg", prefix="ditaa-figure-", dir=imageDir)
+ os.close(handle)
+ parsed.append("image:%s%s\n\n" % (filename, flags))
+ parsing = True
+ worklist[filename] = ""
+ elif line.strip() == "[DITAA END]":
+ fd, asciiname = tempfile.mkstemp(
+ suffix = ".txt", prefix="asciiart-", dir="/tmp")
+ a = os.fdopen(fd, "w+b")
+ a.write(worklist[filename])
+ a.close()
+ parsing = False
+ job = subprocess.Popen(["java", "-jar", ditaaPath, "-o", asciiname, filename], stdout=subprocess.PIPE)
+ job.wait()
+ os.unlink(asciiname)
+ elif parsing:
+ worklist[filename] += line
+ else:
+ parsed.append(line)
+
+ print "".join(parsed)
+
+if __name__ == "__main__":
+
+ imageDir = None
+ ditaaPath = None
+
+ options, args = getopt.getopt(sys.argv[1:], "d:j:")
+ for o, v in options:
+ if o == "-d":
+ imageDir = v
+ if o == "-j":
+ ditaaPath = v
+
+ if imageDir == None:
+ print "usage: [-d <image directory>] [-j <path to ditaa jar>]\n"
+ sys.exit(1)
+
+ if len(args) == 1:
+ document = open(args[0], "r").readlines()
+ else:
+ document = sys.stdin.readlines()
+ main(document, ditaaPath, imageDir)
+
+#
+#./handle-ditaa.py $1 | asciidoc -d book -o $TARGET -
hooks/post-receive
--
aesop Repository
1
0
09 Feb '12
1
0
I've ported the socket resource to the aesop repository.
(Actually, reimplemented is a better word).
There is a test included, but other than that test I've not tested the
code. I'm not aware of any bugs in the code at this point, that's all I
can say :-)
Dries
1
0
aesop Repository branch, master, updated. c9c79922c0ae8acb4a0ffa7dcdd32aae3f58f25e
by noreply@mcs.anl.gov 07 Feb '12
by noreply@mcs.anl.gov 07 Feb '12
07 Feb '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "aesop Repository".
The branch, master has been updated
via c9c79922c0ae8acb4a0ffa7dcdd32aae3f58f25e (commit)
via 943949473c89a1cfe9d6c64dfc7ba5afca73922e (commit)
from 3ec79f55ec2327ca8cd591398277aa4e369efdc0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c9c79922c0ae8acb4a0ffa7dcdd32aae3f58f25e
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Tue Feb 7 17:38:05 2012 -0600
Fix in aesocket module.
Forgot to stop ev_io watcher in callback. Fixed.
commit 943949473c89a1cfe9d6c64dfc7ba5afca73922e
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Tue Feb 7 17:37:00 2012 -0600
Add lock based version of resourcebuilder
Untested lock based version of resourcebuilder used in debugging.
Keeping code around.
-----------------------------------------------------------------------
Summary of changes:
resources/resourcebuilder/resourcebuilder.c | 92 +++++++++++++++++++++++++
resources/resourcebuilder/resourcebuilder.hae | 8 ++-
src/socket/aesocket.ae | 25 ++++++-
src/socket/test/simple.ae | 45 ++++++++----
4 files changed, 149 insertions(+), 21 deletions(-)
Diff of changes:
diff --git a/resources/resourcebuilder/resourcebuilder.c b/resources/resourcebuilder/resourcebuilder.c
index da2eeed..529fc4e 100644
--- a/resources/resourcebuilder/resourcebuilder.c
+++ b/resources/resourcebuilder/resourcebuilder.c
@@ -2,6 +2,7 @@
* make will try to build ./resourcebuilder.h and fail.
*/
#include "resources/resourcebuilder/resourcebuilder.h"
+#include "ae-thread.h"
#define RB_DEFAULT_SIZE 64
#define RB_RESOURCE_NAME "resourcebuilder"
@@ -20,6 +21,9 @@ enum {
void rb_slot_initialize (rb_slot_t * slot)
{
OPA_store_int (&slot->status, STATUS_EMPTY);
+#ifdef RB_NO_OPA
+ pthread_mutex_init (&slot->lock, 0);
+#endif
}
/**
@@ -31,6 +35,55 @@ void rb_slot_initialize (rb_slot_t * slot)
*/
static int rb_callback (rb_slot_t * slot, int success)
{
+#ifdef RB_NO_OPA
+ const int newstatus = (success ? STATUS_COMPLETED_SUCCESS
+ : STATUS_COMPLETED_CANCEL);
+ int ret;
+ void (*callback)(void *, int) = 0;
+ void * user_ptr = 0;
+
+ ae_mutex_lock (&slot->lock);
+ switch (slot->status)
+ {
+ case STATUS_UNINITIALIZED:
+ ret = AE_ERR_NOT_FOUND;
+ break;
+ case STATUS_EMPTY:
+ /* slot is not armed yet */
+ slot->status = newstatus;
+ break;
+ case STATUS_ARMED:
+ {
+ int resource_id;
+ struct ae_op * op = &slot->op;
+
+ assert (slot == (rb_slot_t *) intptr2op (ae_id_lookup (slot->op_id,
+ &resource_id)));
+
+ assert (resource_id == rb_resource_id);
+
+ slot->status = newstatus;
+
+ callback = slot->op.callback;
+ user_ptr = slot->op.user_ptr;
+ ret = AE_SUCCESS;
+ break;
+ }
+ case STATUS_COMPLETED_SUCCESS:
+ case STATUS_COMPLETED_CANCEL:
+ /* already completed */
+ ret = AE_ERR_INVALID;
+ break;
+ }
+
+ ae_mutex_unlock (&slot->lock);
+
+ if (callback)
+ callback (user_ptr, (success ? AE_SUCCESS : AE_ERR_INVALID));
+
+ return ret;
+
+#else
const int newstatus = (success ? STATUS_COMPLETED_SUCCESS
: STATUS_COMPLETED_CANCEL);
@@ -84,6 +137,7 @@ static int rb_callback (rb_slot_t * slot, int success)
}
}
return AE_SUCCESS; /* silence warning */
+#endif
}
int rb_slot_complete (rb_slot_t * slot)
@@ -107,6 +161,43 @@ void rb_slot_destroy (rb_slot_t * slot)
ae_define_post (int, rb_slot_capture, rb_slot_t * slot)
{
+#ifdef RB_NO_OPA
+ int ret;
+ int aret;
+
+ ae_mutex_lock (&slot->lock);
+ switch (slot->status)
+ {
+ case STATUS_COMPLETED_SUCCESS:
+ ret = AE_SUCCESS;
+ aret = AE_IMMEDIATE_COMPLETION;
+ break;
+ case STATUS_COMPLETED_CANCEL:
+ aret = AE_ERR_INVALID;
+ ret = AE_IMMEDIATE_COMPLETION;
+ break;
+ case STATUS_UNINITIALIZED:
+ ret = AE_ERR_NOT_FOUND;
+ aret = AE_IMMEDIATE_COMPLETION;
+ break;
+ case STATUS_ARMED:
+ ret = AE_ERR_INVALID;
+ aret = AE_IMMEDIATE_COMPLETION;
+ break;
+ case STATUS_EMPTY:
+ ae_op_fill (&slot->op);
+ slot->op_id = ae_id_gen (rb_resource_id, (uintptr_t) slot);
+ ret = AE_SUCCESS;
+ aret = AE_SUCCESS;
+ slot->status = STATUS_ARMED;
+ break;
+ }
+ ae_mutex_unlock (&slot->lock);
+
+ *__ae_retval = ret;
+ return aret;
+
+#else
/* Only arm the slot if it hasn't completed yet */
int status;
@@ -147,6 +238,7 @@ ae_define_post (int, rb_slot_capture, rb_slot_t * slot)
/* we just transitioned from empty to armed */
return AE_SUCCESS;
+#endif
}
static int rb_cancel (ae_context_t rb_ctx, ae_op_id_t op_id)
diff --git a/resources/resourcebuilder/resourcebuilder.hae b/resources/resourcebuilder/resourcebuilder.hae
index 5c9ed0a..dd8edb8 100644
--- a/resources/resourcebuilder/resourcebuilder.hae
+++ b/resources/resourcebuilder/resourcebuilder.hae
@@ -6,13 +6,19 @@
#include "resource.h"
#include "op.h"
+// #define RB_NO_OPA
+
struct rb_slot_t
{
ae_op_id_t op_id;
struct ae_op op;
+#ifdef RB_NO_OPA
+ ae_mutex_t lock;
+ int status;
+#else
OPA_int_t status;
- int returncode; /* in case of immediate completion */
+#endif
};
typedef struct rb_slot_t rb_slot_t;
diff --git a/src/socket/aesocket.ae b/src/socket/aesocket.ae
index 2b98b98..f0a14c6 100644
--- a/src/socket/aesocket.ae
+++ b/src/socket/aesocket.ae
@@ -48,7 +48,8 @@ typedef struct aesocket_entry_t aesocket_entry_t;
static aesocket_entry_t * socket_thread_add = 0;
static aesocket_entry_t * socket_thread_remove = 0;
-static void socket_thread_wake_cb (struct ev_loop * loop, ev_async * w, int revents)
+static void socket_thread_wake_cb (struct ev_loop * loop, ev_async * w, int
+ revents)
{
}
@@ -61,6 +62,7 @@ static void aesocket_check_queue (void)
aesocket_entry_t * e = socket_thread_add;
ev_io_start (socket_ev_loop, &e->watcher);
socket_thread_add = socket_thread_add->next;
+ e->next = 0;
}
while (socket_thread_remove != 0)
@@ -69,9 +71,14 @@ static void aesocket_check_queue (void)
ev_io_stop (socket_ev_loop, &e->watcher);
e->mode = MODE_COMPLETED;
socket_thread_remove = socket_thread_remove->next;
+ e->next = 0;
}
+ assert (!socket_thread_remove);
+ assert (!socket_thread_add);
+
pthread_cond_broadcast (&cond);
+
ae_mutex_unlock (&mutex);
}
@@ -126,6 +133,9 @@ static void aesocket_fd_ready (struct ev_loop * loop, struct ev_io * io,
int revents)
{
aesocket_entry_t * e = io->data;
+
+ ev_io_stop (loop, &e->watcher);
+
e->mode = MODE_COMPLETED;
rb_slot_complete (&e->slot);
}
@@ -146,11 +156,16 @@ __blocking int aesocket_ready (int fd, int flags, int * err)
rb_slot_initialize (&entry.slot);
ae_mutex_lock (&mutex);
- entry.next = socket_thread_add->next;
- socket_thread_add = &entry;
+
+ {
+ entry.next = socket_thread_add;
+ socket_thread_add = &entry;
+
+ aesocket_thread_wakeup ();
+ }
+
ae_mutex_unlock (&mutex);
- aesocket_thread_wakeup ();
ret = rb_slot_capture (&entry.slot);
if (ret != AE_SUCCESS)
@@ -190,6 +205,8 @@ __blocking int aesocket_ready (int fd, int flags, int * err)
entry.next = socket_thread_remove;
socket_thread_remove = &entry;
+ aesocket_thread_wakeup ();
+
while (entry.mode != MODE_REMOVED)
{
pthread_cond_wait (&cond, &mutex);
diff --git a/src/socket/test/simple.ae b/src/socket/test/simple.ae
index 7ee9be2..c3b39c6 100644
--- a/src/socket/test/simple.ae
+++ b/src/socket/test/simple.ae
@@ -8,28 +8,31 @@
#include <stdio.h>
#include <assert.h>
+
static __blocking int test1 ()
{
int fd;
char filename[128];
+ int err;
+ int tret;
+
strcpy (filename, "/tmp/aesocketXXXXXX");
fd = mkstemp (filename);
pwait
{
- pbranch
+ /* pbranch
{
- int err;
- aesocket_ready (fd, AESOCKET_WRITE, &err);
- aesop_cancel_branches_wait ();
- }
+ tret = triton_timer (100);
+ assert (tret != AE_SUCCESS && "File did not become read??");
+ // aesop_cancel_branches_wait ();
+ } */
pbranch
{
- int tret;
- tret = triton_timer (10000);
- assert (tret != AE_SUCCESS && "File did not become read??");
- }
+ aesocket_ready (fd, AESOCKET_WRITE, &err);
+ //aesop_cancel_branches_wait ();
+ }
}
close (fd);
@@ -37,6 +40,7 @@ static __blocking int test1 ()
return 0;
}
+
static __blocking int doSendRecv (int * fd)
{
size_t todo = 1024*1024*64;
@@ -49,11 +53,12 @@ static __blocking int doSendRecv (int * fd)
i=0;
char buf[4096];
int iter2 = 0;
+ int r;
+ int err;
+ int tret;
+
while (i < todo)
{
- int r;
- int err;
- int tret;
++iter2;
tret = aesocket_ready (fd[0], AESOCKET_READ, &err);
if (tret != AE_SUCCESS)
@@ -62,11 +67,16 @@ static __blocking int doSendRecv (int * fd)
printf ("Cancelled read!");
pbreak;
}
- printf ("R");
+ printf ("R"); fflush (stdout);
r= read (fd[0], &buf[0], sizeof(buf));
if (r< 0)
+ {
perror ("read");
- i += r;
+ }
+ else
+ {
+ i += r;
+ }
}
}
pbranch
@@ -75,11 +85,13 @@ static __blocking int doSendRecv (int * fd)
int err;
i=0;
char buf[1024];
+ memset (buf, 0, sizeof(buf));
int w;
int iter = 0;
+ int tret;
+
while (i< todo)
{
- int tret;
++iter;
tret = aesocket_ready (fd[1], AESOCKET_WRITE, &err);
if (tret != AE_SUCCESS)
@@ -88,7 +100,7 @@ static __blocking int doSendRecv (int * fd)
printf ("Cancelled write!");
pbreak;
}
- printf ("W");
+ printf ("W"); fflush (stdout);
w = write (fd[1], &buf[0], sizeof(buf));
if (w < 0)
perror ("write");
@@ -150,6 +162,7 @@ static __blocking int test2 ()
static __blocking int dotest (int argc, char ** args)
{
+ // aesop_set_debugging ("ae_blocking", 1);
aesocket_init ();
test1 ();
test2 ();
hooks/post-receive
--
aesop Repository
1
0
aesop Repository branch, master, updated. 3ec79f55ec2327ca8cd591398277aa4e369efdc0
by noreply@mcs.anl.gov 07 Feb '12
by noreply@mcs.anl.gov 07 Feb '12
07 Feb '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "aesop Repository".
The branch, master has been updated
via 3ec79f55ec2327ca8cd591398277aa4e369efdc0 (commit)
via 0c3892fa5fe69291ca98d83fbdd6067ca158be95 (commit)
via 16a8718a577148847ecd5c0af10003c3ba642c31 (commit)
from 6334b6b00d0a665a09b44a770e44450506b9f9df (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3ec79f55ec2327ca8cd591398277aa4e369efdc0
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Tue Feb 7 13:36:21 2012 -0600
aesop socket module using resourcebuilder(untested)
Code is not production quality.
Use with caution.
commit 0c3892fa5fe69291ca98d83fbdd6067ca158be95
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Mon Feb 6 14:32:06 2012 -0600
Add some more ae error codes
AESOP_ERR_CANCELLED
AESOP_ERR_OTHER
commit 16a8718a577148847ecd5c0af10003c3ba642c31
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Mon Feb 6 14:31:54 2012 -0600
Add AE_MUTEX_INITIALIZER to ae-thread.h
-----------------------------------------------------------------------
Summary of changes:
ae-error.h | 2 +
ae-thread.h | 2 +
configure.ac | 2 +
src/socket/aesocket.ae | 395 ++++++++++++++++++++++++++++++++++++++++++
src/socket/aesocket.hae | 80 +++++++++
src/socket/module.mk.in | 5 +
src/socket/test/module.mk.in | 4 +
src/socket/test/simple.ae | 169 ++++++++++++++++++
8 files changed, 659 insertions(+), 0 deletions(-)
create mode 100644 src/socket/aesocket.ae
create mode 100644 src/socket/aesocket.hae
create mode 100644 src/socket/module.mk.in
create mode 100644 src/socket/test/module.mk.in
create mode 100644 src/socket/test/simple.ae
Diff of changes:
diff --git a/ae-error.h b/ae-error.h
index 0b5b97e..255f2ce 100644
--- a/ae-error.h
+++ b/ae-error.h
@@ -17,5 +17,7 @@
#define AE_ERR_EXIST (-4) /* object or entity already exists */
#define AE_ERR_TIMEDOUT (-5) /* timed out */
#define AE_ERR_OVERFLOW (-6) /* overflow of some resource limitation */
+#define AE_ERR_CANCELLED (-7) /* Call was cancelled. */
+#define AE_ERR_OTHER (-8) /* Other error */
#endif
diff --git a/ae-thread.h b/ae-thread.h
index eeb133b..fce17ed 100644
--- a/ae-thread.h
+++ b/ae-thread.h
@@ -8,6 +8,8 @@
*/
#include "triton-thread.h"
+#define AE_MUTEX_INITIALIZER TRITON_MUTEX_INITIALIZER
+
typedef triton_mutex_t ae_mutex_t;
#define ae_mutex_init triton_mutex_init
#define ae_mutex_lock triton_mutex_lock
diff --git a/configure.ac b/configure.ac
index edc99ff..ccd61a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,5 +292,7 @@ module.mk
tests/module.mk
parser/module.mk
parser/tests/blocking/module.mk
+src/socket/module.mk
+src/socket/test/module.mk
])
diff --git a/src/socket/aesocket.ae b/src/socket/aesocket.ae
new file mode 100644
index 0000000..2b98b98
--- /dev/null
+++ b/src/socket/aesocket.ae
@@ -0,0 +1,395 @@
+#include "aesocket.hae"
+#include "resources/resourcebuilder/resourcebuilder.hae"
+
+#include <unistd.h>
+#include <assert.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <errno.h>
+#include "libev/ev.h"
+
+/**
+ * If true, before testing if the socket is ready, try to read/write under the
+ * assumption that it will be ready. When it is not ready, wait until ready
+ * and try again.
+ */
+static int immediate_completion = 1;
+
+
+/* Number of zero byte reads in a row that we will observe before assuming
+ * that the peer has closed the socket; this is a hack to weed out
+ * spurious zero byte reads that can show up on some systems.
+ */
+#define ZERO_BYTE_READ_THRESHOLD 0
+
+
+static ae_mutex_t mutex = AE_MUTEX_INITIALIZER;
+static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+static unsigned int refcount = 0;
+
+static pthread_t socket_thread;
+static volatile sig_atomic_t socket_thread_done;
+static struct ev_async socket_thread_wake;
+
+static struct ev_loop * socket_ev_loop = 0;
+
+enum { MODE_WAITING, MODE_COMPLETED, MODE_REMOVED };
+struct aesocket_entry_t
+{
+ ev_io watcher;
+ rb_slot_t slot;
+ struct aesocket_entry_t * next;
+ int flags;
+ int mode;
+};
+
+typedef struct aesocket_entry_t aesocket_entry_t;
+
+static aesocket_entry_t * socket_thread_add = 0;
+static aesocket_entry_t * socket_thread_remove = 0;
+
+static void socket_thread_wake_cb (struct ev_loop * loop, ev_async * w, int revents)
+{
+}
+
+static void aesocket_check_queue (void)
+{
+ ae_mutex_lock (&mutex);
+
+ while (socket_thread_add != 0)
+ {
+ aesocket_entry_t * e = socket_thread_add;
+ ev_io_start (socket_ev_loop, &e->watcher);
+ socket_thread_add = socket_thread_add->next;
+ }
+
+ while (socket_thread_remove != 0)
+ {
+ aesocket_entry_t * e = socket_thread_remove;
+ ev_io_stop (socket_ev_loop, &e->watcher);
+ e->mode = MODE_COMPLETED;
+ socket_thread_remove = socket_thread_remove->next;
+ }
+
+ pthread_cond_broadcast (&cond);
+ ae_mutex_unlock (&mutex);
+}
+
+static void aesocket_thread_wakeup (void)
+{
+ ev_async_send (socket_ev_loop, &socket_thread_wake);
+}
+
+static void * aesocket_thread_main (void * arg)
+{
+ while (!socket_thread_done)
+ {
+ aesocket_check_queue ();
+ ev_loop (socket_ev_loop, EVLOOP_ONESHOT);
+ }
+}
+
+int aesocket_init (void)
+{
+ ae_mutex_lock (&mutex);
+ if (!refcount++)
+ {
+ socket_ev_loop = ev_loop_new (EVFLAG_AUTO);
+ socket_thread_done = 0;
+ ev_async_init (&socket_thread_wake, &socket_thread_wake_cb);
+
+ pthread_create (&socket_thread, 0, aesocket_thread_main, 0);
+ }
+ ae_mutex_unlock (&mutex);
+ return AE_SUCCESS;
+}
+
+int aesocket_done (void)
+{
+ ae_mutex_lock (&mutex);
+ if (0 == --refcount)
+ {
+ socket_thread_done = 1;
+ aesocket_thread_wakeup ();
+ pthread_join (socket_thread, 0);
+
+ ev_loop_destroy (socket_ev_loop);
+ }
+ ae_mutex_unlock (&mutex);
+ return AE_SUCCESS;
+}
+
+/**
+ * libev callback for when fd is ready.
+ */
+static void aesocket_fd_ready (struct ev_loop * loop, struct ev_io * io,
+ int revents)
+{
+ aesocket_entry_t * e = io->data;
+ e->mode = MODE_COMPLETED;
+ rb_slot_complete (&e->slot);
+}
+
+__blocking int aesocket_ready (int fd, int flags, int * err)
+{
+ int ret;
+ aesocket_entry_t entry;
+
+ entry.flags = flags;
+ ev_io_init (&entry.watcher, &aesocket_fd_ready, fd,
+ (flags & AESOCKET_READ ? EV_READ : 0)
+ | (flags & AESOCKET_WRITE ? EV_WRITE : 0));
+
+ entry.watcher.data = &entry;
+ entry.mode = MODE_WAITING;
+
+ rb_slot_initialize (&entry.slot);
+
+ ae_mutex_lock (&mutex);
+ entry.next = socket_thread_add->next;
+ socket_thread_add = &entry;
+ ae_mutex_unlock (&mutex);
+
+ aesocket_thread_wakeup ();
+
+ ret = rb_slot_capture (&entry.slot);
+ if (ret != AE_SUCCESS)
+ {
+ /* note: could save time here by checking for completion */
+
+ int added = 1;
+ /* we're cancelled */
+
+ ae_mutex_lock (&mutex);
+
+ /* check if the libev thread already added the fd */
+ if (socket_thread_add == &entry)
+ {
+ socket_thread_add = entry.next;
+ added = 0;
+ }
+ else
+ {
+ aesocket_entry_t * cur = socket_thread_add;
+ while (cur)
+ {
+ if (cur->next == &entry)
+ {
+ cur->next = entry.next;
+ added = 0;
+ break;
+ }
+ cur = cur->next;
+ }
+ }
+
+ if (added)
+ {
+ /* we need to add it to the remove list and wait
+ * until it is removed */
+ entry.next = socket_thread_remove;
+ socket_thread_remove = &entry;
+
+ while (entry.mode != MODE_REMOVED)
+ {
+ pthread_cond_wait (&cond, &mutex);
+ }
+ }
+
+ ae_mutex_unlock (&mutex);
+
+ ret = AE_ERR_CANCELLED;
+ }
+ else
+ {
+ /* completed OK */
+ ret = AE_SUCCESS;
+ }
+
+ rb_slot_destroy (&entry.slot);
+ *err = 0;
+
+ return ret;
+}
+
+
+int aesocket_prepare (int fd)
+{
+ /* mark socket as nonblocking */
+ return fcntl(fd, F_SETFL, O_NONBLOCK);
+}
+
+__blocking int aesocket_accept(
+ int sockfd,
+ struct sockaddr *addr,
+ socklen_t * addrlen,
+ int *newfd,
+ int * err)
+{
+ int ret;
+ int r;
+
+ *newfd = -1;
+
+ *err = 0;
+
+ while(1)
+ {
+ if(!immediate_completion)
+ {
+ ret = aesocket_ready(sockfd, AESOCKET_READ, err);
+ if (ret != AE_SUCCESS)
+ return ret;
+ }
+
+ r = accept(sockfd, addr, addrlen);
+ if (r >= 0)
+ {
+ *newfd = r;
+ return(AE_SUCCESS);
+ }
+ else if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
+ {
+ *err = errno;
+ return AE_ERR_OTHER;
+ }
+
+ if(immediate_completion)
+ {
+ ret = aesocket_ready(sockfd, AESOCKET_READ, err);
+ if (ret != AE_SUCCESS)
+ return ret;
+ }
+ }
+
+ return AE_SUCCESS;
+}
+
+
+__blocking int aesocket_read(
+ int fd,
+ void *buf,
+ size_t count,
+ int *len,
+ int * err)
+{
+ int ret;
+ int r;
+ char* tmp_buf = (char*)buf;
+ int tmp_count = count;
+ int zero_reads = 0;
+
+ assert(buf && count);
+ *len = 0;
+
+ *err = 0;
+
+ do
+ {
+ if(!immediate_completion)
+ {
+ ret = aesocket_ready(fd, AESOCKET_READ, err);
+
+ if (ret != AE_SUCCESS)
+ return ret;
+ }
+ r = read(fd, tmp_buf, tmp_count);
+
+ if(r > 0)
+ {
+ tmp_buf += r;
+ tmp_count -= r;
+ zero_reads = 0;
+ }
+ else if(r == 0)
+ {
+ zero_reads++;
+ if(zero_reads >= ZERO_BYTE_READ_THRESHOLD)
+ {
+ /* assume that the peer has closed the socket */
+ *err = errno;
+ return(AE_ERR_OTHER);
+ }
+ }
+ else if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
+ {
+ *err = errno;
+ return AE_ERR_OTHER;
+ }
+
+ if(immediate_completion && tmp_count > 0)
+ {
+ ret = aesocket_ready(fd, AESOCKET_READ, err);
+
+ if (ret != AE_SUCCESS)
+ return ret;
+ }
+
+ } while (tmp_count > 0);
+
+ *len = count;
+
+ return AE_SUCCESS;
+}
+
+__blocking int aesocket_write(
+ int fd,
+ const void *buf,
+ size_t count,
+ int *len,
+ int * err)
+{
+ int ret;
+ int r;
+ const char* tmp_buf = (const char*)buf;
+ int tmp_count = count;
+
+ assert(buf && count);
+ *len = 0;
+
+ *err = 0;
+
+ do
+ {
+ if(!immediate_completion)
+ {
+ ret = aesocket_ready(fd, AESOCKET_WRITE, err);
+
+ if (ret != AE_SUCCESS)
+ return ret;
+ }
+
+ r = write(fd, tmp_buf, tmp_count);
+ if(r >= 0)
+ {
+ tmp_buf += r;
+ tmp_count -= r;
+ }
+ else if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
+ {
+ *err = errno;
+ return AE_ERR_OTHER;
+ }
+
+ if(immediate_completion && tmp_count > 0)
+ {
+ ret = aesocket_ready(fd, AESOCKET_WRITE, err);
+
+ if (ret != AE_ERR_OTHER)
+ return ret;
+ }
+
+ } while (tmp_count > 0);
+ *len = count;
+
+ return AE_SUCCESS;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/src/socket/aesocket.hae b/src/socket/aesocket.hae
new file mode 100644
index 0000000..503b1a8
--- /dev/null
+++ b/src/socket/aesocket.hae
@@ -0,0 +1,80 @@
+#ifndef SOCKET_TRITON_SOCKET_HAE
+#define SOCKET_TRITON_SOCKET_HAE
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include "aesop.h"
+
+
+/**
+ * Prepare fd for use with the functions in the triton-socket module.
+ * This function might change the blocking/non-blocking nature of the fd.
+ **/
+int aesocket_prepare (int fd);
+
+/** initialize the socket module.
+ * Can be called multiple times
+ */
+int aesocket_init (void);
+
+/**
+ * Inform the socket module it is no longer needed.
+ */
+int aesocket_done (void);
+
+
+/**
+ * Wait for a successful accept on the fd.
+ * Returns AE_ERR_CANCELLED if cancelled,
+ * AE_ERR_OTHER if the accept call returned an error
+ * (storing the error in *error),
+ * and AE_SUCCESS otherwise.
+ */
+__blocking int aesocket_accept(
+ int sockfd,
+ struct sockaddr *addr,
+ socklen_t * addrlen,
+ int *newfd,
+ int * err);
+
+/**
+ * Returns the number of bytes read in *ret.
+ * Returns errno on error, 0 otherwise.
+ */
+__blocking int aesocket_read(
+ int fd,
+ void *buf,
+ size_t count,
+ int *ret,
+ int * err);
+
+/**
+ * Returns the number of bytes written in *ret.
+ * Returns errno on error, otherwise 0.
+ */
+__blocking int aesocket_write(
+ int fd,
+ const void *buf,
+ size_t count,
+ int *ret,
+ int * err);
+
+
+enum
+{
+ AESOCKET_READ = 0x01,
+ AESOCKET_WRITE = 0x02
+};
+
+__blocking int aesocket_ready (int fd, int flags, int * err);
+
+#endif
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/src/socket/module.mk.in b/src/socket/module.mk.in
new file mode 100644
index 0000000..1b86cbb
--- /dev/null
+++ b/src/socket/module.mk.in
@@ -0,0 +1,5 @@
+DIR := src/socket
+
+AELIBSRC += $(DIR)/aesocket.ae
+AESOP_HDR += $(DIR)/aesocket.hae
+
diff --git a/src/socket/test/module.mk.in b/src/socket/test/module.mk.in
new file mode 100644
index 0000000..f7476ce
--- /dev/null
+++ b/src/socket/test/module.mk.in
@@ -0,0 +1,4 @@
+DIR := src/socket/test
+
+AETESTSRC += $(DIR)/simple.ae
+
diff --git a/src/socket/test/simple.ae b/src/socket/test/simple.ae
new file mode 100644
index 0000000..7ee9be2
--- /dev/null
+++ b/src/socket/test/simple.ae
@@ -0,0 +1,169 @@
+#include "aesop.h"
+#include "aesop-support.hae"
+#include "resources/timer/timer.hae"
+#include "src/socket/aesocket.hae"
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <assert.h>
+
+static __blocking int test1 ()
+{
+ int fd;
+ char filename[128];
+ strcpy (filename, "/tmp/aesocketXXXXXX");
+
+ fd = mkstemp (filename);
+
+ pwait
+ {
+ pbranch
+ {
+ int err;
+ aesocket_ready (fd, AESOCKET_WRITE, &err);
+ aesop_cancel_branches_wait ();
+ }
+ pbranch
+ {
+ int tret;
+ tret = triton_timer (10000);
+ assert (tret != AE_SUCCESS && "File did not become read??");
+ }
+ }
+
+ close (fd);
+
+ return 0;
+}
+
+static __blocking int doSendRecv (int * fd)
+{
+ size_t todo = 1024*1024*64;
+ int ret = AE_SUCCESS;
+ pwait
+ {
+ pbranch
+ {
+ int i;
+ i=0;
+ char buf[4096];
+ int iter2 = 0;
+ while (i < todo)
+ {
+ int r;
+ int err;
+ int tret;
+ ++iter2;
+ tret = aesocket_ready (fd[0], AESOCKET_READ, &err);
+ if (tret != AE_SUCCESS)
+ {
+ ret = tret;
+ printf ("Cancelled read!");
+ pbreak;
+ }
+ printf ("R");
+ r= read (fd[0], &buf[0], sizeof(buf));
+ if (r< 0)
+ perror ("read");
+ i += r;
+ }
+ }
+ pbranch
+ {
+ int i;
+ int err;
+ i=0;
+ char buf[1024];
+ int w;
+ int iter = 0;
+ while (i< todo)
+ {
+ int tret;
+ ++iter;
+ tret = aesocket_ready (fd[1], AESOCKET_WRITE, &err);
+ if (tret != AE_SUCCESS)
+ {
+ ret = tret;
+ printf ("Cancelled write!");
+ pbreak;
+ }
+ printf ("W");
+ w = write (fd[1], &buf[0], sizeof(buf));
+ if (w < 0)
+ perror ("write");
+ i += w;
+ }
+ }
+ }
+ return ret;
+}
+
+static __blocking int test2 ()
+{
+ int fd[2];
+ if (pipe (&fd[0]) < 0)
+ {
+ perror ("pipe");
+ assert (0);
+ }
+ fcntl (fd[0], F_SETFL, O_NONBLOCK);
+ fcntl (fd[1], F_SETFL, O_NONBLOCK);
+
+ pwait
+ {
+ pbranch
+ {
+ int ret;
+ ret = doSendRecv (fd);
+ if (ret == AE_SUCCESS)
+ {
+ printf ("Test done... Cancelling timeout!\n");
+ aesop_cancel_branches_wait ();
+ }
+ else
+ {
+ printf ("Test cancelled!\n");
+ }
+ }
+ pbranch
+ {
+ int ret;
+ ret = triton_timer (10000);
+ if (ret == AE_SUCCESS)
+ {
+ printf ("Cancelling!");
+ aesop_cancel_branches_wait ();
+ }
+ else
+ {
+ printf ("Cancelling timer\n");
+ }
+ }
+ }
+
+ close (fd[0]);
+ close (fd[1]);
+
+ return 0;
+}
+
+static __blocking int dotest (int argc, char ** args)
+{
+ aesocket_init ();
+ test1 ();
+ test2 ();
+ aesocket_done ();
+ return 0;
+}
+
+aesop_main_set(dotest);
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */
hooks/post-receive
--
aesop Repository
1
0
1
0
I will be calling in from the road, hopefully with good signal.
We've provided ORNL with everything they've requested and anticipate final contract soon.
Students, since I'm away there won't be a meeting this week after the call
- Jill
1
0
aesop Repository branch, master, updated. 6334b6b00d0a665a09b44a770e44450506b9f9df
by noreply@mcs.anl.gov 05 Feb '12
by noreply@mcs.anl.gov 05 Feb '12
05 Feb '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "aesop Repository".
The branch, master has been updated
via 6334b6b00d0a665a09b44a770e44450506b9f9df (commit)
via 233c430b785d213d4cf4dd12c6cbb650a7e39ed1 (commit)
via 7783d568af3b8f22666c11cdaabe5552551ea276 (commit)
via eb94e24b727ae65749cdad29d4f0284dbf6dc48e (commit)
via 806d340b28c3f5bcc7073f1e96b58c0af45d6b7d (commit)
via 1777383e9f6547bcec267e4556b980170b7d2b2a (commit)
from c96325166f18ba62b5f835498cc894b09f552bee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6334b6b00d0a665a09b44a770e44450506b9f9df
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sun Feb 5 20:54:40 2012 -0500
filled in more file functions
commit 233c430b785d213d4cf4dd12c6cbb650a7e39ed1
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sun Feb 5 20:26:43 2012 -0500
convert thread/file tests to use aesop_main_set()
commit 7783d568af3b8f22666c11cdaabe5552551ea276
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sun Feb 5 14:21:13 2012 -0500
update parser tests to not use context by default
commit eb94e24b727ae65749cdad29d4f0284dbf6dc48e
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sun Feb 5 14:12:42 2012 -0500
update to new c-utils
commit 806d340b28c3f5bcc7073f1e96b58c0af45d6b7d
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sat Feb 4 17:31:11 2012 -0500
added aefile resource proof of concept
commit 1777383e9f6547bcec267e4556b980170b7d2b2a
Author: Phil Carns <carns(a)mcs.anl.gov>
Date: Sat Feb 4 07:37:25 2012 -0500
added thread resource
- based on old branch-threader concept, but using a thread pool
-----------------------------------------------------------------------
Summary of changes:
ae-init.c | 3 +-
configure.ac | 4 +
parser/tests/blocking/afterwhile.ae | 2 +-
parser/tests/blocking/basic-struct-init.ae | 2 +-
parser/tests/blocking/basic-struct-return.ae | 2 +-
parser/tests/blocking/basic.ae | 2 +-
parser/tests/blocking/cancel-pbranch-loop.ae | 2 +-
parser/tests/blocking/cancel-pbranch1.ae | 2 +-
parser/tests/blocking/cancel-pbranch2.ae | 2 +-
parser/tests/blocking/cancel-pbranch3.ae | 2 +-
parser/tests/blocking/cancel-pbranch4.ae | 2 +-
parser/tests/blocking/compound.ae | 2 +-
parser/tests/blocking/dowhileloop.ae | 2 +-
parser/tests/blocking/forloop.ae | 2 +-
parser/tests/blocking/forloop2.ae | 2 +-
parser/tests/blocking/forloop3.ae | 2 +-
parser/tests/blocking/funptrs.ae | 2 +-
parser/tests/blocking/icpfor.ae | 2 +-
parser/tests/blocking/if.ae | 2 +-
parser/tests/blocking/ifnbelse.ae | 2 +-
parser/tests/blocking/ifnoelse.ae | 2 +-
parser/tests/blocking/ifnoelse2.ae | 2 +-
.../blocking/lonely-pbranch-variable-scope.ae | 2 +-
parser/tests/blocking/lonely-pbranch.ae | 2 +-
parser/tests/blocking/lonely-pbranch2.ae | 2 +-
parser/tests/blocking/lonely-pbranch3.ae | 2 +-
parser/tests/blocking/lonely-pbranch4.ae | 2 +-
parser/tests/blocking/mixed.ae | 2 +-
parser/tests/blocking/multif.ae | 2 +-
parser/tests/blocking/nbfun.ae | 2 +-
parser/tests/blocking/nested-forloop.ae | 2 +-
parser/tests/blocking/nested.ae | 2 +-
parser/tests/blocking/parallel1.ae | 2 +-
parser/tests/blocking/parallel2.ae | 2 +-
parser/tests/blocking/parallel3.ae | 2 +-
parser/tests/blocking/parallel4.ae | 2 +-
parser/tests/blocking/parallelfor.ae | 2 +-
parser/tests/blocking/parallelfor2.ae | 2 +-
parser/tests/blocking/parallelfor3.ae | 2 +-
parser/tests/blocking/params.ae | 2 +-
parser/tests/blocking/pbranch-completion.ae | 2 +-
parser/tests/blocking/pbranch-with-return.ae | 2 +-
parser/tests/blocking/pbreak-before-blocking.ae | 2 +-
parser/tests/blocking/pbreak-immed-cancel.ae | 2 +-
parser/tests/blocking/pbreak.ae | 2 +-
parser/tests/blocking/pbreak2.ae | 2 +-
parser/tests/blocking/pbreak3.ae | 2 +-
parser/tests/blocking/pbreak4.ae | 2 +-
parser/tests/blocking/pbreak5.ae | 2 +-
parser/tests/blocking/pbreak6.ae | 2 +-
parser/tests/blocking/pbreak7.ae | 2 +-
parser/tests/blocking/pbreak8.ae | 2 +-
parser/tests/blocking/pprivate.ae | 2 +-
parser/tests/blocking/pshared.ae | 2 +-
parser/tests/blocking/pwait-in-for.ae | 2 +-
parser/tests/blocking/pwait-in-while.ae | 2 +-
parser/tests/blocking/tcpfor.ae | 2 +-
parser/tests/blocking/threefors.ae | 2 +-
parser/tests/blocking/twofors.ae | 2 +-
parser/tests/blocking/whilebreak.ae | 2 +-
parser/tests/blocking/whilebreak2.ae | 2 +-
parser/tests/blocking/whilebreak3.ae | 2 +-
parser/tests/blocking/whileloop.ae | 2 +-
resources/file/aefile.ae | 128 ++++++++++
resources/file/aefile.hae | 20 ++
resources/file/module.mk.in | 5 +
resources/file/test/aefile-example.ae | 127 ++++++++++
resources/file/test/module.mk.in | 4 +
resources/thread/aethread.c | 245 ++++++++++++++++++++
resources/thread/aethread.hae | 17 ++
resources/thread/module.mk.in | 5 +
resources/thread/test/aethread-example.ae | 116 +++++++++
resources/thread/test/module.mk.in | 4 +
src/c-utils | 2 +-
74 files changed, 739 insertions(+), 63 deletions(-)
create mode 100644 resources/file/aefile.ae
create mode 100644 resources/file/aefile.hae
create mode 100644 resources/file/module.mk.in
create mode 100644 resources/file/test/aefile-example.ae
create mode 100644 resources/file/test/module.mk.in
create mode 100644 resources/thread/aethread.c
create mode 100644 resources/thread/aethread.hae
create mode 100644 resources/thread/module.mk.in
create mode 100644 resources/thread/test/aethread-example.ae
create mode 100644 resources/thread/test/module.mk.in
Diff of changes:
diff --git a/ae-init.c b/ae-init.c
index 3fcbe0a..bb8f914 100644
--- a/ae-init.c
+++ b/ae-init.c
@@ -1,10 +1,11 @@
#include "ae-init.h"
__attribute__((constructor)) void triton_timer_init_register(void);
-
+__attribute__((constructor)) void triton_aethread_init_register(void);
int ae_init (void)
{
/* Call the constructor functions here */
triton_timer_init_register ();
+ triton_aethread_init_register ();
}
diff --git a/configure.ac b/configure.ac
index 9aa279b..edc99ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -282,6 +282,10 @@ AC_CONFIG_FILES([bin/aecc], [chmod +x bin/aecc])
AC_OUTPUT([Makefile
resources/timer/test/module.mk
resources/timer/module.mk
+resources/file/module.mk
+resources/file/test/module.mk
+resources/thread/module.mk
+resources/thread/test/module.mk
resources/resourcebuilder/module.mk
resources/resourcebuilder/test/module.mk
module.mk
diff --git a/parser/tests/blocking/afterwhile.ae b/parser/tests/blocking/afterwhile.ae
index d4010fb..01e6ca1 100644
--- a/parser/tests/blocking/afterwhile.ae
+++ b/parser/tests/blocking/afterwhile.ae
@@ -31,4 +31,4 @@ __blocking int aesop_main(int argc, char **argv)
run_outer();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/basic-struct-init.ae b/parser/tests/blocking/basic-struct-init.ae
index 7c55959..3f0440a 100644
--- a/parser/tests/blocking/basic-struct-init.ae
+++ b/parser/tests/blocking/basic-struct-init.ae
@@ -36,5 +36,5 @@ __blocking int aesop_main(int argc, char **argv)
run_basic();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/basic-struct-return.ae b/parser/tests/blocking/basic-struct-return.ae
index 5dd1a85..ad25659 100644
--- a/parser/tests/blocking/basic-struct-return.ae
+++ b/parser/tests/blocking/basic-struct-return.ae
@@ -39,5 +39,5 @@ __blocking int aesop_main(int argc, char **argv)
run_basic();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/basic.ae b/parser/tests/blocking/basic.ae
index fc73f6a..91af433 100644
--- a/parser/tests/blocking/basic.ae
+++ b/parser/tests/blocking/basic.ae
@@ -50,5 +50,5 @@ __blocking int aesop_main(int argc, char **argv)
run_basic();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/cancel-pbranch-loop.ae b/parser/tests/blocking/cancel-pbranch-loop.ae
index a94250d..c71287a 100644
--- a/parser/tests/blocking/cancel-pbranch-loop.ae
+++ b/parser/tests/blocking/cancel-pbranch-loop.ae
@@ -44,5 +44,5 @@ __blocking int aesop_main(int argc, char **argv)
run_test();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/cancel-pbranch1.ae b/parser/tests/blocking/cancel-pbranch1.ae
index e1d1c53..fbe7500 100644
--- a/parser/tests/blocking/cancel-pbranch1.ae
+++ b/parser/tests/blocking/cancel-pbranch1.ae
@@ -158,5 +158,5 @@ __blocking int aesop_main(int argc, char **argv)
run_test();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/cancel-pbranch2.ae b/parser/tests/blocking/cancel-pbranch2.ae
index 12fb967..83f3938 100644
--- a/parser/tests/blocking/cancel-pbranch2.ae
+++ b/parser/tests/blocking/cancel-pbranch2.ae
@@ -53,5 +53,5 @@ __blocking int aesop_main(int argc, char **argv)
run_test();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/cancel-pbranch3.ae b/parser/tests/blocking/cancel-pbranch3.ae
index 49df7fe..694af3d 100644
--- a/parser/tests/blocking/cancel-pbranch3.ae
+++ b/parser/tests/blocking/cancel-pbranch3.ae
@@ -41,5 +41,5 @@ __blocking int aesop_main(int argc, char **argv)
run_test();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/cancel-pbranch4.ae b/parser/tests/blocking/cancel-pbranch4.ae
index aafbc34..22f371d 100644
--- a/parser/tests/blocking/cancel-pbranch4.ae
+++ b/parser/tests/blocking/cancel-pbranch4.ae
@@ -36,5 +36,5 @@ __blocking int aesop_main(int argc, char **argv)
run_test();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/compound.ae b/parser/tests/blocking/compound.ae
index b2c8e12..9bb0039 100644
--- a/parser/tests/blocking/compound.ae
+++ b/parser/tests/blocking/compound.ae
@@ -47,5 +47,5 @@ __blocking int aesop_main(int argc, char **argv)
{
return run_compound();
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/dowhileloop.ae b/parser/tests/blocking/dowhileloop.ae
index 1627955..6964b41 100644
--- a/parser/tests/blocking/dowhileloop.ae
+++ b/parser/tests/blocking/dowhileloop.ae
@@ -24,5 +24,5 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/forloop.ae b/parser/tests/blocking/forloop.ae
index 0f75579..560c8ba 100644
--- a/parser/tests/blocking/forloop.ae
+++ b/parser/tests/blocking/forloop.ae
@@ -30,5 +30,5 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/forloop2.ae b/parser/tests/blocking/forloop2.ae
index 806f96e..998ce57 100644
--- a/parser/tests/blocking/forloop2.ae
+++ b/parser/tests/blocking/forloop2.ae
@@ -28,5 +28,5 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/forloop3.ae b/parser/tests/blocking/forloop3.ae
index 14d841c..beaed32 100644
--- a/parser/tests/blocking/forloop3.ae
+++ b/parser/tests/blocking/forloop3.ae
@@ -30,5 +30,5 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/funptrs.ae b/parser/tests/blocking/funptrs.ae
index 94639f2..cefa61f 100644
--- a/parser/tests/blocking/funptrs.ae
+++ b/parser/tests/blocking/funptrs.ae
@@ -74,5 +74,5 @@ __blocking int aesop_main(int argc, char **argv)
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/icpfor.ae b/parser/tests/blocking/icpfor.ae
index 1848a6f..ec51759 100644
--- a/parser/tests/blocking/icpfor.ae
+++ b/parser/tests/blocking/icpfor.ae
@@ -33,5 +33,5 @@ __blocking int aesop_main(int argc, char **argv)
run_parfor();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/if.ae b/parser/tests/blocking/if.ae
index 9f04c78..c0ee71b 100644
--- a/parser/tests/blocking/if.ae
+++ b/parser/tests/blocking/if.ae
@@ -41,5 +41,5 @@ __blocking int aesop_main(int argc, char **argv)
run_if();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/ifnbelse.ae b/parser/tests/blocking/ifnbelse.ae
index dbe111b..7e42c74 100644
--- a/parser/tests/blocking/ifnbelse.ae
+++ b/parser/tests/blocking/ifnbelse.ae
@@ -30,5 +30,5 @@ __blocking int aesop_main(int argc, char **argv)
run_ifnbelse();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/ifnoelse.ae b/parser/tests/blocking/ifnoelse.ae
index 69eeb10..57f0ef6 100644
--- a/parser/tests/blocking/ifnoelse.ae
+++ b/parser/tests/blocking/ifnoelse.ae
@@ -26,5 +26,5 @@ __blocking int aesop_main(int argc, char **argv)
run_ifnoelse();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/ifnoelse2.ae b/parser/tests/blocking/ifnoelse2.ae
index 4baa3b6..fb10dd8 100644
--- a/parser/tests/blocking/ifnoelse2.ae
+++ b/parser/tests/blocking/ifnoelse2.ae
@@ -28,5 +28,5 @@ __blocking int aesop_main(int argc, char **argv)
run_ifnoelse2();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/lonely-pbranch-variable-scope.ae b/parser/tests/blocking/lonely-pbranch-variable-scope.ae
index bba1f6c..573a244 100644
--- a/parser/tests/blocking/lonely-pbranch-variable-scope.ae
+++ b/parser/tests/blocking/lonely-pbranch-variable-scope.ae
@@ -59,7 +59,7 @@ __blocking int aesop_main(int argc, char **argv)
printf("Test complete.\n");
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/lonely-pbranch.ae b/parser/tests/blocking/lonely-pbranch.ae
index 3bacfb7..8626add 100644
--- a/parser/tests/blocking/lonely-pbranch.ae
+++ b/parser/tests/blocking/lonely-pbranch.ae
@@ -46,7 +46,7 @@ __blocking int aesop_main(int argc, char **argv)
lonely_pbranch();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/lonely-pbranch2.ae b/parser/tests/blocking/lonely-pbranch2.ae
index 24532b4..04d05cc 100644
--- a/parser/tests/blocking/lonely-pbranch2.ae
+++ b/parser/tests/blocking/lonely-pbranch2.ae
@@ -46,7 +46,7 @@ __blocking int aesop_main(int argc, char **argv)
lonely_pbranch();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/lonely-pbranch3.ae b/parser/tests/blocking/lonely-pbranch3.ae
index 8a9a177..b5a32ba 100644
--- a/parser/tests/blocking/lonely-pbranch3.ae
+++ b/parser/tests/blocking/lonely-pbranch3.ae
@@ -56,7 +56,7 @@ __blocking int aesop_main(int argc, char **argv)
lonely_pbranch_wrapper();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/lonely-pbranch4.ae b/parser/tests/blocking/lonely-pbranch4.ae
index 715024a..2c8d911 100644
--- a/parser/tests/blocking/lonely-pbranch4.ae
+++ b/parser/tests/blocking/lonely-pbranch4.ae
@@ -53,7 +53,7 @@ __blocking int aesop_main(int argc, char **argv)
lonely_pbranch();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/mixed.ae b/parser/tests/blocking/mixed.ae
index 30ec18c..76baba6 100644
--- a/parser/tests/blocking/mixed.ae
+++ b/parser/tests/blocking/mixed.ae
@@ -82,4 +82,4 @@ __blocking int aesop_main(int argc, char **argv)
run_mixed();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/multif.ae b/parser/tests/blocking/multif.ae
index 9464fa3..6d9da4d 100644
--- a/parser/tests/blocking/multif.ae
+++ b/parser/tests/blocking/multif.ae
@@ -67,4 +67,4 @@ __blocking int aesop_main(int argc, char **argv)
run_multiif();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/nbfun.ae b/parser/tests/blocking/nbfun.ae
index 9317f2c..d62639a 100644
--- a/parser/tests/blocking/nbfun.ae
+++ b/parser/tests/blocking/nbfun.ae
@@ -20,4 +20,4 @@ __blocking int aesop_main(int argc, char **argv)
{
return run_outer_nbfun1();
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/nested-forloop.ae b/parser/tests/blocking/nested-forloop.ae
index 7829df7..047e51a 100644
--- a/parser/tests/blocking/nested-forloop.ae
+++ b/parser/tests/blocking/nested-forloop.ae
@@ -25,5 +25,5 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/nested.ae b/parser/tests/blocking/nested.ae
index 60faa4e..9d996b5 100644
--- a/parser/tests/blocking/nested.ae
+++ b/parser/tests/blocking/nested.ae
@@ -25,4 +25,4 @@ __blocking int aesop_main(int argc, char **argv)
run_outer();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallel1.ae b/parser/tests/blocking/parallel1.ae
index d841616..8d065f6 100644
--- a/parser/tests/blocking/parallel1.ae
+++ b/parser/tests/blocking/parallel1.ae
@@ -42,4 +42,4 @@ __blocking int aesop_main(int argc, char **argv)
run_par1();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallel2.ae b/parser/tests/blocking/parallel2.ae
index 49745be..1e50c2b 100644
--- a/parser/tests/blocking/parallel2.ae
+++ b/parser/tests/blocking/parallel2.ae
@@ -51,6 +51,6 @@ __blocking int aesop_main(int argc, char **argv)
run_par2();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallel3.ae b/parser/tests/blocking/parallel3.ae
index 2c516d0..c2b138e 100644
--- a/parser/tests/blocking/parallel3.ae
+++ b/parser/tests/blocking/parallel3.ae
@@ -69,4 +69,4 @@ __blocking int aesop_main(int argc, char **argv)
run_par3();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallel4.ae b/parser/tests/blocking/parallel4.ae
index a7d7cb1..4b1f64a 100644
--- a/parser/tests/blocking/parallel4.ae
+++ b/parser/tests/blocking/parallel4.ae
@@ -67,4 +67,4 @@ __blocking int aesop_main(int argc, char **argv)
run_par4();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallelfor.ae b/parser/tests/blocking/parallelfor.ae
index 41ace9a..11eac19 100644
--- a/parser/tests/blocking/parallelfor.ae
+++ b/parser/tests/blocking/parallelfor.ae
@@ -42,5 +42,5 @@ __blocking int aesop_main(int argc, char **argv)
run_parfor();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/parallelfor2.ae b/parser/tests/blocking/parallelfor2.ae
index b609945..292186e 100644
--- a/parser/tests/blocking/parallelfor2.ae
+++ b/parser/tests/blocking/parallelfor2.ae
@@ -37,7 +37,7 @@ __blocking int aesop_main(int argc, char **argv)
run_parfor();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/parallelfor3.ae b/parser/tests/blocking/parallelfor3.ae
index 58a3426..1f7f42e 100644
--- a/parser/tests/blocking/parallelfor3.ae
+++ b/parser/tests/blocking/parallelfor3.ae
@@ -40,7 +40,7 @@ __blocking int aesop_main(int argc, char **argv)
run_parfor();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/params.ae b/parser/tests/blocking/params.ae
index a086e9f..c5d72a6 100644
--- a/parser/tests/blocking/params.ae
+++ b/parser/tests/blocking/params.ae
@@ -23,4 +23,4 @@ __blocking int aesop_main(int argc, char **argv)
run_params(10, "FOO", "BAR");
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbranch-completion.ae b/parser/tests/blocking/pbranch-completion.ae
index 5f3828a..d2bdd23 100644
--- a/parser/tests/blocking/pbranch-completion.ae
+++ b/parser/tests/blocking/pbranch-completion.ae
@@ -74,5 +74,5 @@ __blocking int aesop_main(int argc, char **argv)
}
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbranch-with-return.ae b/parser/tests/blocking/pbranch-with-return.ae
index 257ceb5..041fc78 100644
--- a/parser/tests/blocking/pbranch-with-return.ae
+++ b/parser/tests/blocking/pbranch-with-return.ae
@@ -29,5 +29,5 @@ __blocking int aesop_main(int argc, char **argv)
pbranch_with_return();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak-before-blocking.ae b/parser/tests/blocking/pbreak-before-blocking.ae
index 8bd61a1..e175653 100644
--- a/parser/tests/blocking/pbreak-before-blocking.ae
+++ b/parser/tests/blocking/pbreak-before-blocking.ae
@@ -87,7 +87,7 @@ __blocking int aesop_main(int argc, char **argv)
run_par1();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/pbreak-immed-cancel.ae b/parser/tests/blocking/pbreak-immed-cancel.ae
index 4d609af..55b5492 100644
--- a/parser/tests/blocking/pbreak-immed-cancel.ae
+++ b/parser/tests/blocking/pbreak-immed-cancel.ae
@@ -56,5 +56,5 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak.ae b/parser/tests/blocking/pbreak.ae
index edd8554..cdd6e7a 100644
--- a/parser/tests/blocking/pbreak.ae
+++ b/parser/tests/blocking/pbreak.ae
@@ -54,5 +54,5 @@ __blocking int aesop_main(int argc, char **argv)
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak2.ae b/parser/tests/blocking/pbreak2.ae
index 45fae6e..b9ab983 100644
--- a/parser/tests/blocking/pbreak2.ae
+++ b/parser/tests/blocking/pbreak2.ae
@@ -47,5 +47,5 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak2();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak3.ae b/parser/tests/blocking/pbreak3.ae
index 26f738f..2ef6154 100644
--- a/parser/tests/blocking/pbreak3.ae
+++ b/parser/tests/blocking/pbreak3.ae
@@ -56,4 +56,4 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak3();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak4.ae b/parser/tests/blocking/pbreak4.ae
index 9ae0c4b..04c26d4 100644
--- a/parser/tests/blocking/pbreak4.ae
+++ b/parser/tests/blocking/pbreak4.ae
@@ -66,4 +66,4 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak4();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak5.ae b/parser/tests/blocking/pbreak5.ae
index 51eae26..dfb89ad 100644
--- a/parser/tests/blocking/pbreak5.ae
+++ b/parser/tests/blocking/pbreak5.ae
@@ -61,4 +61,4 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak5();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak6.ae b/parser/tests/blocking/pbreak6.ae
index b4cbfe7..d0f6748 100644
--- a/parser/tests/blocking/pbreak6.ae
+++ b/parser/tests/blocking/pbreak6.ae
@@ -55,4 +55,4 @@ __blocking int aesop_main(int argc, char **argv)
run_pbreak6();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pbreak7.ae b/parser/tests/blocking/pbreak7.ae
index 2b049f4..7056963 100644
--- a/parser/tests/blocking/pbreak7.ae
+++ b/parser/tests/blocking/pbreak7.ae
@@ -76,7 +76,7 @@ __blocking int aesop_main(int argc, char **argv)
run_par1();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/pbreak8.ae b/parser/tests/blocking/pbreak8.ae
index 385a306..7d4f3a7 100644
--- a/parser/tests/blocking/pbreak8.ae
+++ b/parser/tests/blocking/pbreak8.ae
@@ -74,7 +74,7 @@ __blocking int aesop_main(int argc, char **argv)
run_par1();
return 0;
}
-aesop_main_set(aesop_main, "btest", "timer");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/pprivate.ae b/parser/tests/blocking/pprivate.ae
index fbe6a90..7959ebf 100644
--- a/parser/tests/blocking/pprivate.ae
+++ b/parser/tests/blocking/pprivate.ae
@@ -46,7 +46,7 @@ __blocking int aesop_main(int argc, char **argv)
run_pprivate();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/pshared.ae b/parser/tests/blocking/pshared.ae
index 14ad3ea..c9f947c 100644
--- a/parser/tests/blocking/pshared.ae
+++ b/parser/tests/blocking/pshared.ae
@@ -64,7 +64,7 @@ __blocking int aesop_main(int argc, char **argv)
run_pshared();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
/*
* Local variables:
diff --git a/parser/tests/blocking/pwait-in-for.ae b/parser/tests/blocking/pwait-in-for.ae
index 85c4340..e66005c 100644
--- a/parser/tests/blocking/pwait-in-for.ae
+++ b/parser/tests/blocking/pwait-in-for.ae
@@ -43,4 +43,4 @@ __blocking int aesop_main(int argc, char **argv)
run_forloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/pwait-in-while.ae b/parser/tests/blocking/pwait-in-while.ae
index 5f73bd3..80c5ae8 100644
--- a/parser/tests/blocking/pwait-in-while.ae
+++ b/parser/tests/blocking/pwait-in-while.ae
@@ -42,4 +42,4 @@ __blocking int aesop_main(int argc, char **argv)
run_whileloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/tcpfor.ae b/parser/tests/blocking/tcpfor.ae
index f585651..2596fb4 100644
--- a/parser/tests/blocking/tcpfor.ae
+++ b/parser/tests/blocking/tcpfor.ae
@@ -33,5 +33,5 @@ __blocking int aesop_main(int argc, char **argv)
run_parfor();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/threefors.ae b/parser/tests/blocking/threefors.ae
index cc76c90..401972b 100644
--- a/parser/tests/blocking/threefors.ae
+++ b/parser/tests/blocking/threefors.ae
@@ -96,5 +96,5 @@ __blocking int aesop_main(int argc, char **argv)
run_threefors();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/twofors.ae b/parser/tests/blocking/twofors.ae
index c4343c2..e0cfd16 100644
--- a/parser/tests/blocking/twofors.ae
+++ b/parser/tests/blocking/twofors.ae
@@ -80,4 +80,4 @@ __blocking int aesop_main(int argc, char **argv)
run_twofors();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/whilebreak.ae b/parser/tests/blocking/whilebreak.ae
index 36ec675..8dde7f0 100644
--- a/parser/tests/blocking/whilebreak.ae
+++ b/parser/tests/blocking/whilebreak.ae
@@ -28,5 +28,5 @@ __blocking int aesop_main(int argc, char **argv)
run_whilebreak();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/whilebreak2.ae b/parser/tests/blocking/whilebreak2.ae
index f38dbe1..07480d3 100644
--- a/parser/tests/blocking/whilebreak2.ae
+++ b/parser/tests/blocking/whilebreak2.ae
@@ -26,4 +26,4 @@ __blocking int aesop_main(int argc, char **argv)
run_whilebreak();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/whilebreak3.ae b/parser/tests/blocking/whilebreak3.ae
index f201a4e..46007ea 100644
--- a/parser/tests/blocking/whilebreak3.ae
+++ b/parser/tests/blocking/whilebreak3.ae
@@ -33,4 +33,4 @@ __blocking int aesop_main(int argc, char **argv)
run_whilebreak();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/parser/tests/blocking/whileloop.ae b/parser/tests/blocking/whileloop.ae
index 9fd2e2b..556b6ff 100644
--- a/parser/tests/blocking/whileloop.ae
+++ b/parser/tests/blocking/whileloop.ae
@@ -29,4 +29,4 @@ __blocking int aesop_main(int argc, char **argv)
run_whileloop();
return 0;
}
-aesop_main_set(aesop_main, "btest");
+aesop_main_set(aesop_main);
diff --git a/resources/file/aefile.ae b/resources/file/aefile.ae
new file mode 100644
index 0000000..27ada83
--- /dev/null
+++ b/resources/file/aefile.ae
@@ -0,0 +1,128 @@
+#define _GNU_SOURCE
+#define _XOPEN_SOURCE 600
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "resources/file/aefile.hae"
+#include "resources/thread/aethread.hae"
+
+struct aethread_group* file_threads = NULL;
+
+int aefile_init(void)
+{
+ assert(file_threads == NULL);
+ /* TODO: make this configurable */
+ file_threads = aethread_create_group_pool(32);
+ if(!file_threads)
+ return(AE_ERR_SYSTEM);
+
+ return(0);
+}
+
+void aefile_finalize(void)
+{
+ assert(file_threads);
+ aethread_destroy_group(file_threads);
+
+ return;
+}
+
+__blocking ssize_t aefile_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+ ssize_t ret;
+
+ aethread_hint(file_threads);
+
+ ret = pwrite(fd, buf, count, offset);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+__blocking ssize_t aefile_pread(int fd, void *buf, size_t count, off_t offset)
+{
+ ssize_t ret;
+
+ aethread_hint(file_threads);
+
+ ret = pread(fd, buf, count, offset);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+__blocking int aefile_fsync(int fd)
+{
+ int ret;
+
+ aethread_hint(file_threads);
+
+ ret = fsync(fd);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+__blocking int aefile_fdatasync(int fd)
+{
+ int ret;
+
+ aethread_hint(file_threads);
+
+ ret = fdatasync(fd);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+__blocking int aefile_ftruncate(int fd, off_t length)
+{
+ int ret;
+
+ aethread_hint(file_threads);
+
+ ret = ftruncate(fd, length);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+__blocking int aefile_unlink(const char *pathname)
+{
+ int ret;
+
+ aethread_hint(file_threads);
+
+ ret = unlink(pathname);
+ if(ret < 0)
+ {
+ ret = -errno;
+ }
+
+ return(ret);
+}
+
+
+
diff --git a/resources/file/aefile.hae b/resources/file/aefile.hae
new file mode 100644
index 0000000..f10eb1e
--- /dev/null
+++ b/resources/file/aefile.hae
@@ -0,0 +1,20 @@
+#ifndef __AEFILE_HAE__
+#define __AEFILE_HAE__
+
+#include "aesop.h"
+
+#include <unistd.h>
+#include <sys/types.h>
+
+int aefile_init(void);
+void aefile_finalize(void);
+
+__blocking ssize_t aefile_pwrite(int fd, const void *buf, size_t count, off_t offset);
+__blocking ssize_t aefile_pread(int fd, void *buf, size_t count, off_t offset);
+__blocking int aefile_fsync(int fd);
+__blocking int aefile_fdatasync(int fd);
+__blocking int aefile_ftruncate(int fd, off_t length);
+__blocking int aefile_unlink(const char *pathname);
+
+#endif
+
diff --git a/resources/file/module.mk.in b/resources/file/module.mk.in
new file mode 100644
index 0000000..d23d62d
--- /dev/null
+++ b/resources/file/module.mk.in
@@ -0,0 +1,5 @@
+DIR := resources/file
+
+AESOP_HDR += $(DIR)/aefile.hae
+
+AELIBSRC += $(DIR)/aefile.ae
diff --git a/resources/file/test/aefile-example.ae b/resources/file/test/aefile-example.ae
new file mode 100644
index 0000000..b971d09
--- /dev/null
+++ b/resources/file/test/aefile-example.ae
@@ -0,0 +1,127 @@
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+
+#include "aesop.h"
+#include "resources/file/aefile.hae"
+#include "resources/thread/aethread.hae"
+
+static double wtime(void)
+{
+ struct timeval t;
+ gettimeofday(&t, (void *) 0);
+ return ( (double) t.tv_sec + ( (double) t.tv_usec / 1000000 ) );
+}
+
+static __blocking int dotest(void)
+{
+ int fd;
+ int ret;
+ double start, end;
+ char fname_template[256];
+ char buf[4096];
+
+ start = wtime();
+
+ /* create a temporary file */
+ sprintf(fname_template, "/tmp/aefile-example.XXXXXX");
+ fd = mkstemp(fname_template);
+ if(fd < 0)
+ {
+ perror("mkstemp");
+ return(-1);
+ }
+
+ /* use aefile resource to access file */
+ /* NOTE: the aefile calls do not set errno; check the return code for
+ * -errno instead
+ */
+ ret = aefile_pwrite(fd, buf, 4096, 0);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_pwrite: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ ret = aefile_fsync(fd);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_fsync: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ ret = aefile_fdatasync(fd);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_fdatasync: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ ret = aefile_pread(fd, buf, 4096, 0);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_pread: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ ret = aefile_ftruncate(fd, 100);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_ftruncate: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ ret = close(fd);
+ if(ret < 0)
+ {
+ perror("close");
+ return(-1);
+ }
+
+ ret = aefile_unlink(fname_template);
+ if(ret < 0)
+ {
+ fprintf(stderr, "aefile_ftruncate: %s\n", strerror(-ret));
+ return(-1);
+ }
+
+ end = wtime();
+
+ printf("Example complete: %f seconds.\n", (end-start));
+
+ return 0;
+}
+
+__blocking int aesop_main(int argc, char **argv)
+{
+ int ret;
+
+ ret = aefile_init();
+ assert(ret == 0);
+
+ ret = dotest();
+ if(ret == 0)
+ printf("Success.\n");
+ else
+ printf("Failure.\n");
+
+ aefile_finalize();
+
+ return(ret);
+}
+
+aesop_main_set(aesop_main);
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/resources/file/test/module.mk.in b/resources/file/test/module.mk.in
new file mode 100644
index 0000000..03dc4d7
--- /dev/null
+++ b/resources/file/test/module.mk.in
@@ -0,0 +1,4 @@
+DIR := resources/file/test
+
+AETESTSRC += $(DIR)/aefile-example.ae
+
diff --git a/resources/thread/aethread.c b/resources/thread/aethread.c
new file mode 100644
index 0000000..d6b2cdf
--- /dev/null
+++ b/resources/thread/aethread.c
@@ -0,0 +1,245 @@
+#include <signal.h>
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <unistd.h>
+#include "aesop.h"
+#include "op.h"
+#include "opcache.h"
+#include "resources/thread/aethread.h"
+
+struct aethread_op
+{
+ ae_op_id_t op_id;
+ struct ae_op op;
+};
+
+struct aethread_group
+{
+ int pool_size;
+ int pool_active;
+ int pool_started;
+ pthread_t* pool_tids;
+ pthread_cond_t pool_cond;
+ pthread_mutex_t pool_mutex;
+ ae_ops_t oplist;
+};
+/* TODO: make configurable, or better yet dynamic based a runtime
+ * calculation that compares typical op service times against how long it
+ * takes to wake up a thread.
+ */
+#define THREAD_WORK_THRESHOLD 1
+static int aethread_resource_id;
+#define AETHREAD_DEFAULT_OPCACHE_SIZE 1024
+static ae_opcache_t aethread_opcache;
+static int initialized = 0;
+
+static void* thread_pool_fn(void* foo);
+
+void aethread_destroy_group(struct aethread_group* group)
+{
+ int i;
+
+ pthread_mutex_lock(&group->pool_mutex);
+ group->pool_started = 0;
+ pthread_cond_broadcast(&group->pool_cond);
+ pthread_mutex_unlock(&group->pool_mutex);
+
+ for(i=0; i<group->pool_size; i++)
+ {
+ pthread_join(group->pool_tids[i], NULL);
+ }
+
+ free(group->pool_tids);
+
+ return;
+}
+
+struct aethread_group* aethread_create_group_pool(int size)
+{
+ struct aethread_group* group;
+ int i;
+ int ret;
+
+ assert(initialized);
+
+ group = malloc(sizeof(*group));
+ if(!group)
+ {
+ return(NULL);
+ }
+ memset(group, 0, sizeof(*group));
+
+ group->pool_size = size;
+ group->pool_tids = malloc(size*sizeof(*group->pool_tids));
+ if(!group->pool_tids)
+ {
+ free(group);
+ return(NULL);
+ }
+ pthread_cond_init(&group->pool_cond, NULL);
+ pthread_mutex_init(&group->pool_mutex, NULL);
+ ae_ops_init(&group->oplist);
+
+ group->pool_active = size;
+ group->pool_started = 1;
+ for(i=0; i<size; i++)
+ {
+ ret = pthread_create(&group->pool_tids[i], NULL, thread_pool_fn, group);
+ assert(ret == 0); /* TODO: err handling */
+ }
+
+ return(group);
+}
+
+static void* thread_pool_fn(void* foo)
+{
+ struct aethread_group* group = (struct aethread_group*)foo;
+ struct ae_op* op = NULL;
+ void* user_ptr;
+ void (*callback)(void*);
+
+ while(1)
+ {
+ pthread_mutex_lock(&group->pool_mutex);
+ while(ae_ops_empty(&group->oplist) && group->pool_started)
+ {
+ group->pool_active--;
+ pthread_cond_wait(&group->pool_cond, &group->pool_mutex);
+ group->pool_active++;
+ }
+ if(!group->pool_started)
+ {
+ triton_mutex_unlock(&group->pool_mutex);
+ pthread_exit(NULL);
+ }
+ op = ae_ops_dequeue(&group->oplist);
+
+ if(ae_ops_count(&group->oplist)/group->pool_active >=
+ THREAD_WORK_THRESHOLD &&
+ group->pool_active < group->pool_size)
+ {
+ /* there is enough work available that we could make use of
+ * another thread
+ */
+ pthread_cond_signal(&group->pool_cond);
+ }
+
+ pthread_mutex_unlock(&group->pool_mutex);
+
+ /* no work; just run callback in the context of this thread */
+ /* trigger completion of the operation */
+ /* TODO: follow up on this. Can't use the usual complete_op macro
+ * because there is no return code
+ */
+ user_ptr = op->user_ptr;
+ callback = op->callback;
+ callback(user_ptr);
+ ae_opcache_put(aethread_opcache, op);
+ }
+
+ return(NULL);
+}
+
+int aethread_hint(void (*__ae_callback)(void *ptr), \
+ void *__ae_user_ptr, \
+ ae_hints_t *__ae_hints, \
+ ae_context_t __ae_ctx, \
+ ae_op_id_t *__ae_op_id, \
+ int __ae_internal, \
+ struct aethread_group* group)
+{
+ struct ae_op *op;
+ struct aethread_op *a_op;
+ pthread_t tid;
+ pthread_attr_t attr;
+ int ret;
+
+ assert(initialized && group);
+
+ if(!aethread_opcache)
+ {
+ fprintf(stderr, "Error: thread resource not initialized.\n");
+ assert(0);
+ }
+
+ op = ae_opcache_get(aethread_opcache);
+ ae_op_fill(op);
+
+ a_op = ae_op_entry(op, struct aethread_op, op);
+ a_op->op_id = ae_id_gen(aethread_resource_id, (intptr_t) op);
+
+ *__ae_op_id = a_op->op_id;
+
+ pthread_mutex_lock(&group->pool_mutex);
+ ae_ops_enqueue(op, &group->oplist);
+ if(group->pool_active == 0)
+ {
+ /* need to wake up at least one servicing thread */
+ pthread_cond_signal(&group->pool_cond);
+ }
+ pthread_mutex_unlock(&group->pool_mutex);
+
+ return AE_SUCCESS;
+}
+
+static int triton_aethread_poll(ae_context_t context)
+{
+ return AE_SUCCESS;
+}
+
+static int triton_aethread_cancel(ae_context_t triton_ctx, ae_op_id_t op_id)
+{
+ return AE_SUCCESS;
+}
+
+struct ae_resource triton_aethread_resource =
+{
+ .resource_name = "thread",
+ .poll_context = triton_aethread_poll,
+ .cancel = triton_aethread_cancel,
+ .config_array = NULL
+};
+
+__attribute__((constructor)) void triton_aethread_init_register(void);
+
+__attribute__((constructor)) void triton_aethread_init_register(void)
+{
+ ae_resource_init_register("thread", aethread_init, aethread_finalize);
+}
+
+int aethread_init(void)
+{
+ int ret;
+
+ assert(!initialized);
+
+ ret = AE_OPCACHE_INIT(struct aethread_op, op, AETHREAD_DEFAULT_OPCACHE_SIZE, &aethread_opcache);
+ if(ret != 0)
+ {
+ return AE_ERR_SYSTEM;
+ }
+
+ initialized = 1;
+ return ae_resource_register(&triton_aethread_resource, &aethread_resource_id);
+}
+
+void aethread_finalize(void)
+{
+ assert(initialized);
+
+ ae_resource_unregister(aethread_resource_id);
+
+ ae_opcache_destroy(aethread_opcache);
+
+ initialized = 0;
+}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/resources/thread/aethread.hae b/resources/thread/aethread.hae
new file mode 100644
index 0000000..b95f050
--- /dev/null
+++ b/resources/thread/aethread.hae
@@ -0,0 +1,17 @@
+#ifndef __AETHREAD_HAE__
+#define __AETHREAD_HAE__
+
+#include "aesop.h"
+
+struct aethread_group;
+
+struct aethread_group* aethread_create_group_pool(int size);
+void aethread_destroy_group(struct aethread_group* group);
+
+__blocking void aethread_hint(struct aethread_group* group);
+
+int aethread_init(void);
+void aethread_finalize(void);
+
+#endif
+
diff --git a/resources/thread/module.mk.in b/resources/thread/module.mk.in
new file mode 100644
index 0000000..c952dab
--- /dev/null
+++ b/resources/thread/module.mk.in
@@ -0,0 +1,5 @@
+DIR := resources/thread
+
+AESOP_HDR += $(DIR)/aethread.hae
+
+LIBSRC += $(DIR)/aethread.c
diff --git a/resources/thread/test/aethread-example.ae b/resources/thread/test/aethread-example.ae
new file mode 100644
index 0000000..03d045e
--- /dev/null
+++ b/resources/thread/test/aethread-example.ae
@@ -0,0 +1,116 @@
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#include "aesop.h"
+#include "resources/thread/aethread.hae"
+
+static double wtime(void)
+{
+ struct timeval t;
+ gettimeofday(&t, (void *) 0);
+ return ( (double) t.tv_sec + ( (double) t.tv_usec / 1000000 ) );
+}
+
+static __blocking int dotest(void)
+{
+ struct aethread_group* agroup;
+ double start, end;
+
+ agroup = aethread_create_group_pool(8);
+ assert(agroup);
+
+ start = wtime();
+ pwait
+ {
+ pbranch
+ {
+ sleep(3);
+ }
+
+ pbranch
+ {
+ sleep(3);
+ }
+
+ pbranch
+ {
+ sleep(3);
+ }
+ }
+ end = wtime();
+
+ printf("First example (should be about 9 seconds): %f seconds.\n", (end-start));
+
+ start = wtime();
+ pwait
+ {
+ pbranch
+ {
+ aethread_hint(agroup);
+ sleep(3);
+ }
+
+ pbranch
+ {
+ aethread_hint(agroup);
+ sleep(3);
+ }
+
+ pbranch
+ {
+ aethread_hint(agroup);
+ sleep(3);
+ }
+ }
+ end = wtime();
+
+ printf("Second example (should be about 3 seconds): %f seconds.\n", (end-start));
+
+ start = wtime();
+ pwait
+ {
+ pprivate int i;
+
+ /* deliberately go one past the thread pool size */
+ for(i=0; i<9; i++)
+ {
+ pbranch
+ {
+ aethread_hint(agroup);
+ sleep(3);
+ }
+ }
+ }
+ end = wtime();
+
+ printf("Third example (should be about 6 seconds): %f seconds.\n", (end-start));
+
+ aethread_destroy_group(agroup);
+ return 0;
+}
+
+__blocking int aesop_main(int argc, char **argv)
+{
+ int ret;
+
+ ret = dotest();
+ if(ret == 0)
+ printf("Success.\n");
+ else
+ printf("Failure.\n");
+
+ return(ret);
+}
+
+aesop_main_set(aesop_main);
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ft=c ts=8 sts=4 sw=4 expandtab
+ */
diff --git a/resources/thread/test/module.mk.in b/resources/thread/test/module.mk.in
new file mode 100644
index 0000000..8b4d1db
--- /dev/null
+++ b/resources/thread/test/module.mk.in
@@ -0,0 +1,4 @@
+DIR := resources/thread/test
+
+AETESTSRC += $(DIR)/aethread-example.ae
+
diff --git a/src/c-utils b/src/c-utils
index 3b86ef2..e4d1f58 160000
--- a/src/c-utils
+++ b/src/c-utils
@@ -1 +1 @@
-Subproject commit 3b86ef28bcd17863fdf67cb4af6aa1558560ad9d
+Subproject commit e4d1f589cf370787f8d62aedf5887251c0d0ab81
hooks/post-receive
--
aesop Repository
1
0