Changes in / [2e42098:0071c88]


Ignore:
Files:
41 added
38 deleted
77 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r7834bb5 rf93cc34  
    1 # Generated by autoreconf
     1*.a
     2*.o
     3*.par
     4*~
     5.#*
     6.*.swp
     7.deps
     8META.yml
     9Makefile
    210Makefile.in
    3 /aclocal.m4
    4 /autom4te.cache/
    5 /compile
    6 /config.h.in
    7 /config.h.in~
    8 /configure
    9 /depcomp
    10 /install-sh
    11 /missing
    12 /test-driver
    13 
    14 # Generated by configure
    15 Makefile
    16 .deps/
    17 /config.cache
    18 /config.h
    19 /config.log
    20 /config.status
    21 /stamp-h1
    22 
    23 # Generated by make
    24 *.o
    25 *.a
    26 /BUILD_VERSION.mk
    27 /barnowl
    28 /bin/
    29 /gmarshal_funcs.c
    30 /gmarshal_funcs.h
    31 /owl_prototypes.h
    32 /owl_prototypes.h.new
    33 /perlglue.c
    34 /varstubs.c
    35 /version.c
    36 /version.c.new
    37 /zcrypt
    38 
    39 # Generated by make check
    40 /runtests.sh.log
    41 /runtests.sh.trs
    42 /test-suite.log
    43 /tester
    44 
    45 # Generated by make tags et al.
    46 ID
     11Makefile.old
    4712TAGS
    48 tags
    49 /GPATH
    50 /GRTAGS
    51 /GSYMS
    52 /GTAGS
    53 /cscope.files
    54 /cscope.in.out
    55 /cscope.out
    56 /cscope.po.out
     13\#*#
     14aclocal.m4
     15autom4te.cache
     16barnowl.bin
     17tester.bin
     18zcrypt
     19blib
     20config.cache
     21config.h
     22config.h.in
     23config.log
     24config.status
     25configure
     26core
     27depcomp
     28install-sh
     29jabber.log
     30missing
     31owl_prototypes.h
     32owl_prototypes.h.new
     33perlglue.c
     34perlwrap.c
     35pm_to_blib
     36stamp-h1
     37varstubs.c
  • AUTHORS

    r80c0fc7 r1d2c4c3  
    33
    44The following people have provided patches or other contributions:
     5  Sam Hartman
    56  Alex Vandiver
    6   Kevin Chen
    7   Arun Tharuvai
    8   Sam Hartman
     7  Geoffrey Thomas
    98  Derrick Brashear
    109  David Glasser
     10  Matthew Goldstein
     11  Arun Tharuvai
     12  Kevin Chen
    1113  Eric Price
    12   Matthew Goldstein
    13   Geoffrey Thomas
    14   Anders Kaseorg
    15   Greg Price
    16   Chris Lesniewski-Laas
    17   Alex Dehnert
    18   Edward Z. Yang
    19   Karl Ramm
    20   Evan Broder
    21   David Benjamin
    22   Cathy Zhang
    23   Joshua Oreman
    24   Leonid Grinberg
    25   Kevin Riggle
    26   Brian Sniffen
    27   William Throwe
    28   Jason Gross
    29   Adam Glasgall
    30   Tim Hill
    31   DD Liu
    32   Betsy Riley
    33   Robert Jacobs
    3414
    35 BarnOwl is based on code from Owl, which was originally primarily
     15BarnOwl is based on code from Owl, which was originally primarly
    3616written by James Kretchmar.  Erik Nygren also made substantial
    37 contributions and improvements to the program.
     17contributions and improvemnts to the program.
    3818
    39 The following people provided patches and other technical support for
     19The following people provided patches and other techincal support for
    4020Owl:
    4121
     
    5030  Mark Eichin
    5131
    52 Mark Eichin is also maintaining the Debian package of Owl.
     32Mark Eichin is also maintaining the debian package of Owl.
    5333
    5434The following people helped with beta testing the earliest versions of
  • COPYING

    rccc182c rb03c714  
    549549
    550550That's all there is to it!
    551 
    552 ======================================================================
    553 
    554 Files under perl/modules/Facebook/lib/Facebook are copyright (c) 2010 Plain
    555 Black Corporation.
    556 
    557 This software is copyright (c) 2010 by Plain Black Corporation.
    558 
    559 This is free software; you can redistribute it and/or modify it under
    560 the same terms as the Perl 5 programming language system itself.
    561 
    562 Terms of the Perl programming language system itself
    563 
    564 a) the GNU General Public License as published by the Free
    565    Software Foundation; either version 1, or (at your option) any
    566    later version, or
    567 b) the "Artistic License"
    568 
    569 --- The GNU General Public License, Version 1, February 1989 ---
    570 
    571 This software is Copyright (c) 2010 by Plain Black Corporation.
    572 
    573 This is free software, licensed under:
    574 
    575   The GNU General Public License, Version 1, February 1989
    576 
    577                     GNU GENERAL PUBLIC LICENSE
    578                      Version 1, February 1989
    579 
    580  Copyright (C) 1989 Free Software Foundation, Inc.
    581                     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    582 
    583  Everyone is permitted to copy and distribute verbatim copies
    584  of this license document, but changing it is not allowed.
    585 
    586                             Preamble
    587 
    588   The license agreements of most software companies try to keep users
    589 at the mercy of those companies.  By contrast, our General Public
    590 License is intended to guarantee your freedom to share and change free
    591 software--to make sure the software is free for all its users.  The
    592 General Public License applies to the Free Software Foundation's
    593 software and to any other program whose authors commit to using it.
    594 You can use it for your programs, too.
    595 
    596   When we speak of free software, we are referring to freedom, not
    597 price.  Specifically, the General Public License is designed to make
    598 sure that you have the freedom to give away or sell copies of free
    599 software, that you receive source code or can get it if you want it,
    600 that you can change the software or use pieces of it in new free
    601 programs; and that you know you can do these things.
    602 
    603   To protect your rights, we need to make restrictions that forbid
    604 anyone to deny you these rights or to ask you to surrender the rights.
    605 These restrictions translate to certain responsibilities for you if you
    606 distribute copies of the software, or if you modify it.
    607 
    608   For example, if you distribute copies of a such a program, whether
    609 gratis or for a fee, you must give the recipients all the rights that
    610 you have.  You must make sure that they, too, receive or can get the
    611 source code.  And you must tell them their rights.
    612 
    613   We protect your rights with two steps: (1) copyright the software, and
    614 (2) offer you this license which gives you legal permission to copy,
    615 distribute and/or modify the software.
    616 
    617   Also, for each author's protection and ours, we want to make certain
    618 that everyone understands that there is no warranty for this free
    619 software.  If the software is modified by someone else and passed on, we
    620 want its recipients to know that what they have is not the original, so
    621 that any problems introduced by others will not reflect on the original
    622 authors' reputations.
    623 
    624   The precise terms and conditions for copying, distribution and
    625 modification follow.
    626 
    627                     GNU GENERAL PUBLIC LICENSE
    628    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    629 
    630   0. This License Agreement applies to any program or other work which
    631 contains a notice placed by the copyright holder saying it may be
    632 distributed under the terms of this General Public License.  The
    633 "Program", below, refers to any such program or work, and a "work based
    634 on the Program" means either the Program or any work containing the
    635 Program or a portion of it, either verbatim or with modifications.  Each
    636 licensee is addressed as "you".
    637 
    638   1. You may copy and distribute verbatim copies of the Program's source
    639 code as you receive it, in any medium, provided that you conspicuously and
    640 appropriately publish on each copy an appropriate copyright notice and
    641 disclaimer of warranty; keep intact all the notices that refer to this
    642 General Public License and to the absence of any warranty; and give any
    643 other recipients of the Program a copy of this General Public License
    644 along with the Program.  You may charge a fee for the physical act of
    645 transferring a copy.
    646 
    647   2. You may modify your copy or copies of the Program or any portion of
    648 it, and copy and distribute such modifications under the terms of Paragraph
    649 1 above, provided that you also do the following:
    650 
    651     a) cause the modified files to carry prominent notices stating that
    652     you changed the files and the date of any change; and
    653 
    654     b) cause the whole of any work that you distribute or publish, that
    655     in whole or in part contains the Program or any part thereof, either
    656     with or without modifications, to be licensed at no charge to all
    657     third parties under the terms of this General Public License (except
    658     that you may choose to grant warranty protection to some or all
    659     third parties, at your option).
    660 
    661     c) If the modified program normally reads commands interactively when
    662     run, you must cause it, when started running for such interactive use
    663     in the simplest and most usual way, to print or display an
    664     announcement including an appropriate copyright notice and a notice
    665     that there is no warranty (or else, saying that you provide a
    666     warranty) and that users may redistribute the program under these
    667     conditions, and telling the user how to view a copy of this General
    668     Public License.
    669 
    670     d) You may charge a fee for the physical act of transferring a
    671     copy, and you may at your option offer warranty protection in
    672     exchange for a fee.
    673 
    674 Mere aggregation of another independent work with the Program (or its
    675 derivative) on a volume of a storage or distribution medium does not bring
    676 the other work under the scope of these terms.
    677 
    678   3. You may copy and distribute the Program (or a portion or derivative of
    679 it, under Paragraph 2) in object code or executable form under the terms of
    680 Paragraphs 1 and 2 above provided that you also do one of the following:
    681 
    682     a) accompany it with the complete corresponding machine-readable
    683     source code, which must be distributed under the terms of
    684     Paragraphs 1 and 2 above; or,
    685 
    686     b) accompany it with a written offer, valid for at least three
    687     years, to give any third party free (except for a nominal charge
    688     for the cost of distribution) a complete machine-readable copy of the
    689     corresponding source code, to be distributed under the terms of
    690     Paragraphs 1 and 2 above; or,
    691 
    692     c) accompany it with the information you received as to where the
    693     corresponding source code may be obtained.  (This alternative is
    694     allowed only for noncommercial distribution and only if you
    695     received the program in object code or executable form alone.)
    696 
    697 Source code for a work means the preferred form of the work for making
    698 modifications to it.  For an executable file, complete source code means
    699 all the source code for all modules it contains; but, as a special
    700 exception, it need not include source code for modules which are standard
    701 libraries that accompany the operating system on which the executable
    702 file runs, or for standard header files or definitions files that
    703 accompany that operating system.
    704 
    705   4. You may not copy, modify, sublicense, distribute or transfer the
    706 Program except as expressly provided under this General Public License.
    707 Any attempt otherwise to copy, modify, sublicense, distribute or transfer
    708 the Program is void, and will automatically terminate your rights to use
    709 the Program under this License.  However, parties who have received
    710 copies, or rights to use copies, from you under this General Public
    711 License will not have their licenses terminated so long as such parties
    712 remain in full compliance.
    713 
    714   5. By copying, distributing or modifying the Program (or any work based
    715 on the Program) you indicate your acceptance of this license to do so,
    716 and all its terms and conditions.
    717 
    718   6. Each time you redistribute the Program (or any work based on the
    719 Program), the recipient automatically receives a license from the original
    720 licensor to copy, distribute or modify the Program subject to these
    721 terms and conditions.  You may not impose any further restrictions on the
    722 recipients' exercise of the rights granted herein.
    723 
    724   7. The Free Software Foundation may publish revised and/or new versions
    725 of the General Public License from time to time.  Such new versions will
    726 be similar in spirit to the present version, but may differ in detail to
    727 address new problems or concerns.
    728 
    729 Each version is given a distinguishing version number.  If the Program
    730 specifies a version number of the license which applies to it and "any
    731 later version", you have the option of following the terms and conditions
    732 either of that version or of any later version published by the Free
    733 Software Foundation.  If the Program does not specify a version number of
    734 the license, you may choose any version ever published by the Free Software
    735 Foundation.
    736 
    737   8. If you wish to incorporate parts of the Program into other free
    738 programs whose distribution conditions are different, write to the author
    739 to ask for permission.  For software which is copyrighted by the Free
    740 Software Foundation, write to the Free Software Foundation; we sometimes
    741 make exceptions for this.  Our decision will be guided by the two goals
    742 of preserving the free status of all derivatives of our free software and
    743 of promoting the sharing and reuse of software generally.
    744 
    745                             NO WARRANTY
    746 
    747   9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    748 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    749 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    750 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    751 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    752 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    753 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    754 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    755 REPAIR OR CORRECTION.
    756 
    757   10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    758 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    759 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
    760 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    761 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    762 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    763 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    764 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    765 POSSIBILITY OF SUCH DAMAGES.
    766 
    767                      END OF TERMS AND CONDITIONS
    768 
    769         Appendix: How to Apply These Terms to Your New Programs
    770 
    771   If you develop a new program, and you want it to be of the greatest
    772 possible use to humanity, the best way to achieve this is to make it
    773 free software which everyone can redistribute and change under these
    774 terms.
    775 
    776   To do so, attach the following notices to the program.  It is safest to
    777 attach them to the start of each source file to most effectively convey
    778 the exclusion of warranty; and each file should have at least the
    779 "copyright" line and a pointer to where the full notice is found.
    780 
    781     <one line to give the program's name and a brief idea of what it does.>
    782     Copyright (C) 19yy  <name of author>
    783 
    784     This program is free software; you can redistribute it and/or modify
    785     it under the terms of the GNU General Public License as published by
    786     the Free Software Foundation; either version 1, or (at your option)
    787     any later version.
    788 
    789     This program is distributed in the hope that it will be useful,
    790     but WITHOUT ANY WARRANTY; without even the implied warranty of
    791     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    792     GNU General Public License for more details.
    793 
    794     You should have received a copy of the GNU General Public License
    795     along with this program; if not, write to the Free Software
    796     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
    797 
    798 
    799 Also add information on how to contact you by electronic and paper mail.
    800 
    801 If the program is interactive, make it output a short notice like this
    802 when it starts in an interactive mode:
    803 
    804     Gnomovision version 69, Copyright (C) 19xx name of author
    805     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    806     This is free software, and you are welcome to redistribute it
    807     under certain conditions; type `show c' for details.
    808 
    809 The hypothetical commands `show w' and `show c' should show the
    810 appropriate parts of the General Public License.  Of course, the
    811 commands you use may be called something other than `show w' and `show
    812 c'; they could even be mouse-clicks or menu items--whatever suits your
    813 program.
    814 
    815 You should also get your employer (if you work as a programmer) or your
    816 school, if any, to sign a "copyright disclaimer" for the program, if
    817 necessary.  Here a sample; alter the names:
    818 
    819   Yoyodyne, Inc., hereby disclaims all copyright interest in the
    820   program `Gnomovision' (a program to direct compilers to make passes
    821   at assemblers) written by James Hacker.
    822 
    823   <signature of Ty Coon>, 1 April 1989
    824   Ty Coon, President of Vice
    825 
    826 That's all there is to it!
    827 
    828 
    829 --- The Artistic License 1.0 ---
    830 
    831 This software is Copyright (c) 2010 by Plain Black Corporation.
    832 
    833 This is free software, licensed under:
    834 
    835   The Artistic License 1.0
    836 
    837 The Artistic License
    838 
    839 Preamble
    840 
    841 The intent of this document is to state the conditions under which a Package
    842 may be copied, such that the Copyright Holder maintains some semblance of
    843 artistic control over the development of the package, while giving the users of
    844 the package the right to use and distribute the Package in a more-or-less
    845 customary fashion, plus the right to make reasonable modifications.
    846 
    847 Definitions:
    848 
    849   - "Package" refers to the collection of files distributed by the Copyright
    850     Holder, and derivatives of that collection of files created through
    851     textual modification.
    852   - "Standard Version" refers to such a Package if it has not been modified,
    853     or has been modified in accordance with the wishes of the Copyright
    854     Holder.
    855   - "Copyright Holder" is whoever is named in the copyright or copyrights for
    856     the package.
    857   - "You" is you, if you're thinking about copying or distributing this Package.
    858   - "Reasonable copying fee" is whatever you can justify on the basis of media
    859     cost, duplication charges, time of people involved, and so on. (You will
    860     not be required to justify it to the Copyright Holder, but only to the
    861     computing community at large as a market that must bear the fee.)
    862   - "Freely Available" means that no fee is charged for the item itself, though
    863     there may be fees involved in handling the item. It also means that
    864     recipients of the item may redistribute it under the same conditions they
    865     received it.
    866 
    867 1. You may make and give away verbatim copies of the source form of the
    868 Standard Version of this Package without restriction, provided that you
    869 duplicate all of the original copyright notices and associated disclaimers.
    870 
    871 2. You may apply bug fixes, portability fixes and other modifications derived
    872 from the Public Domain or from the Copyright Holder. A Package modified in such
    873 a way shall still be considered the Standard Version.
    874 
    875 3. You may otherwise modify your copy of this Package in any way, provided that
    876 you insert a prominent notice in each changed file stating how and when you
    877 changed that file, and provided that you do at least ONE of the following:
    878 
    879   a) place your modifications in the Public Domain or otherwise make them
    880      Freely Available, such as by posting said modifications to Usenet or an
    881      equivalent medium, or placing the modifications on a major archive site
    882      such as ftp.uu.net, or by allowing the Copyright Holder to include your
    883      modifications in the Standard Version of the Package.
    884 
    885   b) use the modified Package only within your corporation or organization.
    886 
    887   c) rename any non-standard executables so the names do not conflict with
    888      standard executables, which must also be provided, and provide a separate
    889      manual page for each non-standard executable that clearly documents how it
    890      differs from the Standard Version.
    891 
    892   d) make other distribution arrangements with the Copyright Holder.
    893 
    894 4. You may distribute the programs of this Package in object code or executable
    895 form, provided that you do at least ONE of the following:
    896 
    897   a) distribute a Standard Version of the executables and library files,
    898      together with instructions (in the manual page or equivalent) on where to
    899      get the Standard Version.
    900 
    901   b) accompany the distribution with the machine-readable source of the Package
    902      with your modifications.
    903 
    904   c) accompany any non-standard executables with their corresponding Standard
    905      Version executables, giving the non-standard executables non-standard
    906      names, and clearly documenting the differences in manual pages (or
    907      equivalent), together with instructions on where to get the Standard
    908      Version.
    909 
    910   d) make other distribution arrangements with the Copyright Holder.
    911 
    912 5. You may charge a reasonable copying fee for any distribution of this
    913 Package.  You may charge any fee you choose for support of this Package. You
    914 may not charge a fee for this Package itself. However, you may distribute this
    915 Package in aggregate with other (possibly commercial) programs as part of a
    916 larger (possibly commercial) software distribution provided that you do not
    917 advertise this Package as a product of your own.
    918 
    919 6. The scripts and library files supplied as input to or produced as output
    920 from the programs of this Package do not automatically fall under the copyright
    921 of this Package, but belong to whomever generated them, and may be sold
    922 commercially, and may be aggregated with this Package.
    923 
    924 7. C or perl subroutines supplied by you and linked into this Package shall not
    925 be considered part of this Package.
    926 
    927 8. The name of the Copyright Holder may not be used to endorse or promote
    928 products derived from this software without specific prior written permission.
    929 
    930 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
    931 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
    932 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    933 
    934 The End
  • ChangeLog

    r6f87658 r65ff3f4  
    1 1.9
    2  * Update Jabber module for Net::DNS changes -james2vegas@aim.com
    3  * Update and make configurable the Zephyr default format -adehnert@mit.edu
    4  * Fix a crash when zcrypt fails -andersk@mit.edu
    5  * Fix building with OpenSSL before 0.9.8 -andersk@mit.edu
    6  * Make :loadsubs reload instanced personals too -davidben@mit.edu
    7  * Make Perl zephyr_zwrite call die() when it fails -jgross@mit.edu
    8  * Tell gpg calls from zcrypt to ignore ~/.gnupg -andersk@mit.edu
    9  * Replace outgoing zephyr default format with a small URL -geofft@mit.edu
    10  * Add getnumlines() to perl interface -asedeno@mit.edu
    11  * Include names of invalid filters on filter errors -adehnert@mit.edu
    12  * Don't incorrectly mark decryption failures as decrypted -davidben@mit.edu
    13  * Hide the default cursor when possible -davidben@mit.edu
    14  * Complete viewperson and vp as viewuser and vu -davidben@mit.edu
    15  * Set z_charset = ZCHARSET_UTF_8 -andersk@mit.edu
    16  * Allow zsender spoofing on cross-realm classes -andersk@mit.edu
    17  * Append the realm to the zsender if missing -andersk@mit.edu
    18  * Redisplay on setting colorztext -jgross@mit.edu
    19  * Rename default config file to .owl/init.pl -kevinr@free-dissociation.com
    20  * Add completion for jabberlogout -adehnert@mit.edu
    21  * Switch to interactive context before sourcing the startup file -davidben@mit.edu
    22  * Add completion for reload-module -adehnert@mit.edu
    23  * editwin callback for canceling the editwin -jgross@mit.edu
    24  * Fix dirtying windows inside a redraw handler -davidben@mit.edu
    25  * Facebook module -ezyang@mit.edu
    26  * Complete unstartup command just like startup command -jgross@mit.edu
    27  * Fix the description of disable-ctrl-d -jgross@mit.edu
    28  * Use wbkgrndset instead of wbkgdset in _owl_fmtext_wcolor_set -davidben@mit.edu
    29  * Show the time zone in :info -jgross@mit.edu
    30  * Treat [!.?]" as end of sentence in edit:fill-paragraph -jgross@mit.edu
    31  * Correctly display multiline fields in :info -jgross@mit.edu
    32 
    33 1.8.1
    34  * Only add outgoing messages for personal part of half-personal messages -andersk@mit.edu
    35  * Don’t write CC: line on zwrite -C '' -andersk@mit.edu
    36  * Don’t send public pings on zwrite '' or zwrite @REALM -andersk@mit.edu
    37  * Don’t treat zwrite '' as personal -andersk@mit.edu
    38  * Stop pretending to support zwrite * -andersk@mit.edu
    39  * Show foreign realms on non-personal zephyrs like Owl did -andersk@mit.edu
    40  * Fix memory leak in zcrypt -davidben@mit.edu
    41  * Don't attempt to switch filters in :view -d if invalid -davidben@mit.edu
    42  * Fixed typo in unbindkey usage error -rileyb@mit.edu
    43  * Fix bug generating filter text in 256-color mode -asedeno@mit.edu
    44  * Remove ^noc from reply-lockout -geofft@mit.edu
    45  * Avoid quadratic loops when receiving zephyrs -andersk@mit.edu
    46  * Fix hang on empty zcrypt messages -adehnert@MIT.EDU
    47 
    4811.8
    492 * Compute the home directory in zcrypt consistently with BarnOwl -davidben@mit.edu
     
    329282 * Support --program-{prefix,suffix,transform}. -nelhage
    330283 * Send instanced pings and give useful error messages -adehnert
    331  * Add <message,*,%me%> to default BarnOwl subs. -adehnert
     284 * Add <message,*,%me%> to default Barnowl subs. -adehnert
    332285 * Maintain instance when using shift-R on personals -adehnert
    333286 * Improve handling of outgoing instanced personals -adehnert
  • Makefile.am

    rca1fb26a rc266281  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null))
    4 VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@)
    5 -include BUILD_VERSION.mk
     3GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null))
     4GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
    65
    7 FORCE:
    8 BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE)
    9         echo 'BUILD_VERSION = $(VERSION)' > $@
    10 
    11 bin_PROGRAMS = bin/barnowl
     6bin_PROGRAMS = barnowl.bin
    127if ENABLE_ZCRYPT
    138bin_PROGRAMS += zcrypt
    149endif
    1510
    16 zcrypt_SOURCES = zcrypt.c filterproc.c version.c
     11zcrypt_SOURCES = zcrypt.c filterproc.c
    1712
    18 check_PROGRAMS = bin/tester
    19 dist_check_DATA = t
    20 dist_check_SCRIPTS = runtests.sh
     13check_PROGRAMS = tester.bin
    2114
    22 noinst_SCRIPTS = barnowl
    23 check_SCRIPTS = tester
     15barnowl_bin_SOURCES = $(BASE_SRCS) \
     16     owl.h owl_perl.h config.h \
     17     owl.c \
     18     $(GEN_C) $(GEN_H)
    2419
    25 barnowl tester: %: barnowl-wrapper.in bin/% Makefile
    26         sed \
    27             -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \
    28             -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
    29             $< > $@
    30         chmod +x $@
     20man_MANS = doc/barnowl.1
     21doc_DATA = doc/intro.txt doc/advanced.txt
    3122
    32 bin_barnowl_SOURCES = $(BASE_SRCS) \
    33      owl.h owl_perl.h \
    34      owl.c
    35 nodist_bin_barnowl_SOURCES = $(GEN_C) $(GEN_H)
     23barnowl_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
    3624
    37 dist_man_MANS = doc/barnowl.1
    38 dist_doc_DATA = doc/intro.txt doc/advanced.txt
     25tester_bin_SOURCES = $(BASE_SRCS) \
     26     owl.h owl_perl.h config.h \
     27     $(GEN_C) $(GEN_H) \
     28     tester.c
    3929
    40 bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a
    41 
    42 bin_tester_SOURCES = $(BASE_SRCS) \
    43      owl.h owl_perl.h \
    44      tester.c
    45 nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H)
    46 
    47 bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a
     30tester_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
    4831
    4932TESTS=runtests.sh
    5033
    51 AM_CPPFLAGS = \
     34AM_CPPFLAGS = -I$(top_srcdir)/ \
    5235           -I$(top_srcdir)/libfaim/ \
    5336           -DDATADIR='"$(pkgdatadir)"' \
    54            -DBINDIR='"$(bindir)"'
     37           -DBINDIR='"$(bindir)"' \
     38           $(GIT_FLAGS)
    5539
    5640CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
    57      commands.c global.c text.c fmtext.c editwin.c \
    58      util.c logging.c \
     41     commands.c global.c text.c fmtext.c editwin.c util.c logging.c \
    5942     perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
    6043     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
     
    6245     aim.c buddy.c buddylist.c style.c errqueue.c \
    6346     zbuddylist.c popexec.c select.c wcwidth.c \
    64      mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
     47     mainpanel.c msgwin.c sepbar.c editcontext.c signal.c
    6548
    66 NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c
     49NORMAL_SRCS = filterproc.c window.c windowcb.c
    6750
    6851BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
    6952
    70 GEN_C = varstubs.c perlglue.c gmarshal_funcs.c version.c version.c.new
    71 GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
     53GEN_C = varstubs.c perlglue.c
     54GEN_H = owl_prototypes.h
    7255
    73 BUILT_SOURCES = $(GEN_H)
     56BUILT_SOURCES = $(GEN_C) $(GEN_H)
    7457
    7558# Only copy file into place if file.new is different
    76 owl_prototypes.h version.c: %: %.new
     59%: %.new
    7760        @diff -U0 $@ $< || { \
    7861         test -f $@ && echo '$@ changed!'; \
     
    8265proto: owl_prototypes.h
    8366
    84 perlglue.c: perlglue.xs typemap
    85         $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@
     67perlglue.c: perlglue.xs $(TYPEMAP)
     68        $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
    8669
    8770varstubs.c: stubgen.pl variable.c
     
    9174        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
    9275
    93 version.c.new: Makefile BUILD_VERSION.mk
    94         $(AM_V_GEN)echo 'const char *version = "$(VERSION)";' > $@
    95 
    96 gmarshal_funcs.h: marshal_types
    97         glib-genmarshal --header $< > $@
    98 gmarshal_funcs.c: marshal_types
    99         glib-genmarshal --body $< > $@
    100 
    10176# For emacs flymake-mode
    10277check-syntax: proto
    10378        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
    10479
    105 CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk
    106 EXTRA_DIST = \
    107     autogen.sh \
    108     barnowl-wrapper.in \
    109     codelist.pl \
    110     doc/code.txt \
    111     doc/owl-window.txt \
    112     doc/releasing-barnowl.txt \
    113     examples \
    114     marshal_types \
    115     perlglue.xs \
    116     scripts \
    117     stubgen.pl \
    118     typemap
     80install-data-local:
     81        $(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib
     82        (cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - )
     83
     84do_transform = $(shell echo '$(1)' | sed '$(transform)')
     85install-exec-hook:
     86        mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \
     87              $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
    11988
    12089SUBDIRS = compat libfaim perl
  • README

    r1c22155 rb711711  
    1010following CPAN modules:
    1111
    12 Facebook::Graph
    1312Net::Jabber
    1413Net::XMPP
    1514XML::Stream
    1615
    17 Some have been modified slightly for the needs of this project.
     16They have been modified slightly for the needs of this project.
    1817
    1918BarnOwl currently requires the following perl modules off of CPAN:
     
    2120AnyEvent
    2221Class::Accessor
    23 ExtUtils::Depends
    2422Glib
    25 Module::Install
    2623PAR
    2724
     
    2926We plan to soon add targets to the Makefile to check for and install
    3027these for you.
    31 
    32 The Facebook module requires:
    33 
    34 Any::Moose
    35 AnyEvent::HTTP
    36 DateTime
    37 DateTime::Format::Strptime
    38 JSON
    39 MIME::Base64::URLSafe
    40 Ouch
    41 URI
    42 URI::Encode
    4328
    4429The IRC module requires:
     
    5136Authen::SASL::Perl
    5237IO::Socket::SSL
    53 Digest::SHA
     38Digest::SHA1
    5439
    5540The Twitter module requires:
  • aim.c

    r7dcef03 rf271129  
    707707{
    708708  aim_clientready(sess, fr->conn);
    709   owl_function_debugmsg("conninitdone_admin: initialization done for admin connection");
     709  owl_function_debugmsg("conninitdone_admin: initializtion done for admin connection");
    710710  return(1);
    711711}
     
    836836  params = va_arg(ap, struct aim_icbmparameters *);
    837837  va_end(ap);
    838 
    839   owl_function_debugmsg("faimtest_icbmparaminfo: ICBM Parameters: maxchannel = %d, default flags = 0x%08x, max msg len = %d, max sender evil = %f, max receiver evil = %f, min msg interval = %u",
     838 
     839  owl_function_debugmsg("faimtest_icbmparaminfo: ICBM Parameters: maxchannel = %d, default flags = 0x%08x, max msg len = %d, max sender evil = %f, max reciever evil = %f, min msg interval = %u",
    840840                       params->maxchan, params->flags, params->maxmsglen, ((float)params->maxsenderwarn)/10.0, ((float)params->maxrecverwarn)/10.0, params->minmsginterval);
    841841     
     
    10491049  wrapmsg=owl_text_wordwrap(stripmsg, 70);
    10501050  nz_screenname=owl_aim_normalize_screenname(userinfo->sn);
    1051   m=g_slice_new(owl_message);
     1051  m=g_new(owl_message, 1);
    10521052  owl_message_create_aim(m,
    10531053                         nz_screenname,
  • buddy.c

    r7dcef03 rd4927a7  
    7272{
    7373  owl_buddy_cleanup(b);
    74   g_slice_free(owl_buddy, b);
     74  g_free(b);
    7575}
  • buddylist.c

    r7dcef03 r3cdd6d2  
    1111{
    1212  owl_buddy *b;
    13   b=g_slice_new(owl_buddy);
     13  b=g_new(owl_buddy, 1);
    1414 
    1515  owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname);
     
    5050
    5151    /* if not, create the login message */
    52     m=g_slice_new(owl_message);
     52    m=g_new(owl_message, 1);
    5353    owl_message_create_aim(m,
    5454                           screenname,
     
    6969
    7070  if (owl_buddylist_is_aim_buddy_loggedin(bl, screenname)) {
    71     m=g_slice_new(owl_message);
     71    m=g_new(owl_message, 1);
    7272    owl_message_create_aim(m,
    7373                           screenname,
  • cmd.c

    r7dcef03 rf271129  
    3535void owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) {
    3636  owl_cmd *cmd;
    37   cmd = g_slice_new(owl_cmd);
     37  cmd = g_new(owl_cmd, 1);
    3838  owl_cmd_create_alias(cmd, alias_from, alias_to);
    3939  owl_perlconfig_new_command(cmd->name);
     
    4242
    4343int owl_cmddict_add_cmd(owl_cmddict *cd, const owl_cmd * cmd) {
    44   owl_cmd * newcmd = g_slice_new(owl_cmd);
     44  owl_cmd * newcmd = g_new(owl_cmd, 1);
    4545  if(owl_cmd_create_from_template(newcmd, cmd) < 0) {
    46     g_slice_free(owl_cmd, newcmd);
     46    g_free(newcmd);
    4747    return -1;
    4848  }
     
    141141{
    142142  owl_cmd_cleanup(cmd);
    143   g_slice_free(owl_cmd, cmd);
     143  g_free(cmd);
    144144}
    145145
  • commands.c

    rca1fb26a rf271129  
    9696  OWLCMD_ARGS("unbindkey", owl_command_unbindkey, OWL_CTX_ANY,
    9797              "removes a binding in a keymap",
    98               "unbindkey <keymap> <keyseq>",
     98              "bindkey <keymap> <keyseq>",
    9999              "Removes a binding of a key sequence within a keymap.\n"
    100100              "Use 'show keymaps' to see the existing keymaps.\n"
     
    479479
    480480  OWLCMD_ARGS("away", owl_command_away, OWL_CTX_INTERACTIVE,
    481               "Set, enable or disable all away messages",
     481              "Set, enable or disable both AIM and zephyr away messages",
    482482              "away [ on | off | toggle ]\n"
    483483              "away <message>",
    484               "Turn on or off all away messages.  If\n"
     484              "Turn on or off the AIM and zephyr away message.  If\n"
    485485              "'message' is specified turn them on with that message,\n"
    486486              "otherwise use the default.\n"
     487              "\n"
     488              "This command really just runs the 'aaway' and 'zaway'\n"
     489              "commands together\n"
    487490              "\n"
    488491              "SEE ALSO: aaway, zaway"),
     
    10301033  OWLCMD_ARGS_CTX("popless:start-search", owl_viewwin_command_start_search, OWL_CTX_POPLESS,
    10311034                  "starts a command line to search for particular string",
    1032                   "popless:start-search [-r] [initial-value]",
     1035                  "popless:start-search [-r] [inital-value]",
    10331036                  "Initializes the command-line to search for initial-value. If\n"
    10341037                  "-r is used, the search will be performed backwards.\n\n"
     
    11141117void owl_command_version(void)
    11151118{
    1116   owl_function_makemsg("BarnOwl version %s", version);
     1119  owl_function_makemsg("BarnOwl version %s", OWL_VERSION_STRING);
    11171120}
    11181121
     
    15281531char *owl_command_away(int argc, const char *const *argv, const char *buff)
    15291532{
    1530   bool away_off;
    1531   const char *message = NULL;
    1532 
    1533   if (argc == 1 ||
    1534       (argc == 2 && !strcmp(argv[1], "on"))) {
    1535     away_off = false;
     1533  if ((argc==1) ||
     1534      ((argc==2) && !strcmp(argv[1], "on"))) {
    15361535    owl_global_set_aaway_msg(&g, owl_global_get_aaway_msg_default(&g));
    15371536    owl_global_set_zaway_msg(&g, owl_global_get_zaway_msg_default(&g));
    1538   } else if (argc == 2 && !strcmp(argv[1], "off")) {
    1539     away_off = true;
    1540   } else if (argc == 2 && !strcmp(argv[1], "toggle")) {
    1541     away_off = owl_function_is_away();
    1542   } else {
    1543     away_off = false;
    1544     message = skiptokens(buff, 1);
    1545   }
    1546 
    1547   if (away_off) {
     1537    owl_function_aaway_on();
     1538    owl_function_zaway_on();
     1539    owl_function_makemsg("Away messages set.");
     1540    return NULL;
     1541  }
     1542
     1543  if (argc==2 && !strcmp(argv[1], "off")) {
    15481544    owl_function_aaway_off();
    15491545    owl_function_zaway_off();
    1550     owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_off", 0, NULL);
    1551     owl_function_makemsg("Away messages off.");
    1552   } else if (message != NULL) {
    1553     owl_global_set_aaway_msg(&g, message);
    1554     owl_global_set_zaway_msg(&g, message);
    1555     owl_function_aaway_on();
    1556     owl_function_zaway_on();
    1557     owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_on", 1, &message);
    1558     owl_function_makemsg("Away messages set (%s).", message);
    1559   } else {
    1560     owl_function_aaway_on();
    1561     owl_function_zaway_on();
    1562     owl_perlconfig_perl_call_norv("BarnOwl::Hooks::_away_on", 0, NULL);
    1563     owl_function_makemsg("Away messages set.");
    1564   }
    1565 
     1546    return NULL;
     1547  }
     1548
     1549  if (argc==2 && !strcmp(argv[1], "toggle")) {
     1550    /* if either one is on, turn it off, otherwise toggle both (turn
     1551     *  them both on)
     1552     */
     1553    if (!owl_global_is_zaway(&g) && !owl_global_is_aaway(&g)) {
     1554      owl_function_aaway_toggle();
     1555      owl_function_zaway_toggle();
     1556      owl_function_makemsg("Away messages set.");
     1557    } else {
     1558      if (owl_global_is_zaway(&g)) owl_function_zaway_toggle();
     1559      if (owl_global_is_aaway(&g)) owl_function_aaway_toggle();
     1560      owl_function_makemsg("Away messages off.");
     1561    }
     1562    return NULL;
     1563  }
     1564
     1565  buff = skiptokens(buff, 1);
     1566  owl_global_set_aaway_msg(&g, buff);
     1567  owl_global_set_zaway_msg(&g, buff);
     1568  owl_function_aaway_on();
     1569  owl_function_zaway_on();
     1570  owl_function_makemsg("Away messages set.");
    15661571  return NULL;
    15671572}
     
    15991604  if (v == NULL) {
    16001605    if (!silent) owl_function_error("Unknown variable '%s'", var);
    1601   } else if (requirebool && !v->takes_on_off) {
     1606  } else if (requirebool && owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
    16021607    if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
    16031608  } else {
     
    16281633  if (v == NULL) {
    16291634    if (!silent) owl_function_error("Unknown variable '%s'", var);
    1630   } else if (!v->takes_on_off) {
     1635  } else if (owl_variable_get_type(v) != OWL_VARIABLE_BOOL) {
    16311636    if (!silent) owl_function_error("Variable '%s' is not a boolean", var);
    16321637  } else {
     
    17731778
    17741779  if (argc < 3) {
    1775     owl_function_makemsg("Usage: unbindkey <keymap> <binding>");
     1780    owl_function_makemsg("Usage: bindkey <keymap> <binding>");
    17761781    return NULL;
    17771782  }
     
    19801985  }
    19811986  /* check for a zwrite -m */
    1982   z = owl_zwrite_new(argc, argv);
     1987  z = owl_zwrite_new(buff);
    19831988  if (!z) {
    19841989    owl_function_error("Error in zwrite arguments");
     
    21852190    if (!strcmp(argv[0], "-f")) {
    21862191      if (argc<2) {
    2187         owl_function_makemsg("Too few arguments to the view command");
     2192        owl_function_makemsg("Too few argments to the view command");
    21882193        return(NULL);
    21892194      }
     
    21972202    } else if (!strcmp(argv[0], "-s")) {
    21982203      if (argc<2) {
    2199         owl_function_makemsg("Too few arguments to the view command");
     2204        owl_function_makemsg("Too few argments to the view command");
    22002205        return(NULL);
    22012206      }
     
    22042209      argv+=2;
    22052210    } else {
    2206       owl_function_makemsg("Too few arguments to the view command");
     2211      owl_function_makemsg("Too few argments to the view command");
    22072212      return(NULL);
    22082213    }
     
    27912796    owl_history_store(hist, owl_editwin_get_text(e), false);
    27922797
    2793   /* Take a reference to the editwin, so that it survives the pop
    2794    * context. TODO: We should perhaps refcount or otherwise protect
    2795    * the context so that, even if a command pops a context, the
    2796    * context itself will last until the command returns. */
    2797   owl_editwin_ref(e);
    27982798  owl_global_pop_context(&g);
    2799 
    2800   owl_editwin_do_callback(e, false);
    2801   owl_editwin_unref(e);
    28022799}
    28032800
     
    28592856  owl_global_pop_context(&g);
    28602857
    2861   owl_editwin_do_callback(e, true);
     2858  owl_editwin_do_callback(e);
    28622859  owl_editwin_unref(e);
    28632860}
  • compat/Makefile.am

    rb80bae0 r12a6616  
    11noinst_LIBRARIES = libcompat.a
    22
    3 libcompat_a_SOURCES = compat.h
     3libcompat_a_SOURCES =
    44libcompat_a_LIBADD = $(LIBOBJS)
  • compat/compat.h

    r6249a88f r4dde585  
    22#define INC_BARNOWL_COMPAT_COMPAT_H
    33
    4 #include <config.h>
     4#include "../config.h"
    55
    66#include <stddef.h>
  • configure.ac

    r77dfeb1 r883502d  
    11dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT([BarnOwl],[1.10dev],[bug-barnowl@mit.edu])
    3 AM_INIT_AUTOMAKE([1.7.0 foreign std-options -Wall -Wno-portability])
    4 AM_MAINTAINER_MODE([enable])
     2AC_INIT([BarnOwl],[1.9dev],[bug-barnowl@mit.edu])
     3AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability foreign])
    54m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
    65
     
    109AC_PROG_CC
    1110AC_PROG_CC_C99
    12 AC_PROG_LN_S
    13 
    14 AC_ARG_WITH([zephyr-default-format],
    15     [AS_HELP_STRING([--with-zephyr-default-format],
    16                     [value for the default format zephyrgram field])],
    17     [
    18         case $withval in
    19             yes) withval='Config error: see http://mit.edu/df';;
    20             no) withval='';;
    21         esac
    22         zephyr_default_format=$withval
    23     ],
    24     [zephyr_default_format='Config error: see http://mit.edu/df'])
    25 AC_DEFINE_UNQUOTED(
    26     [ZEPHYR_DEFAULT_FORMAT], ["$zephyr_default_format"],
    27     [Value for the default format zephyrgram field]
    28 )
    2911
    3012AC_ARG_WITH([stack-protector],
     
    5941
    6042AS_IF([test "x$with_zephyr" != xno],
    61   [have_krb4=no
    62 
    63    AS_IF([test "x$with_krb4" != "xno"],
     43  [AS_IF([test "x$with_krb4" != "xno"],
    6444   [AC_MSG_CHECKING([for Kerberos IV])
    6545    AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
    6646      [AC_MSG_RESULT([yes])
    67        have_krb4=yes
    6847       AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
    6948       AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`"
     
    7251      [AC_MSG_RESULT([no])
    7352       AS_IF([test "x$with_krb4" = "xyes"],
    74              [AC_MSG_ERROR([Kerberos IV requested but not found])])])])
    75 
    76    AS_IF([test "x$have_krb4" != xyes],
    77      [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto],
    78         [AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
    79          LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
    80         ],
    81         [PKG_CHECK_MODULES([OPENSSL], [openssl],
    82            [AM_CFLAGS="${AM_CFLAGS} ${OPENSSL_CFLAGS}"
    83             LIBS="${LIBS} ${OPENSSL_LIBS}"
    84            ])])])
    85 
     53             [AC_MSG_ERROR([Kerberos IV requested but not found])])
     54       PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
     55       AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
     56       LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
     57     ])])
    8658   AC_CHECK_LIB([zephyr], [ZGetSender],
    8759   [LIBS="$LIBS -lzephyr"
     
    11890dnl Find the location of perl XSUBPP
    11991AC_MSG_CHECKING(for the perl xsubpp precompiler)
    120 XSUBPPDIR="`cd "$srcdir" && perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;' | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
     92XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
    12193if test -n "${XSUBPPDIR}"; then
    12294   AC_MSG_RESULT(${XSUBPPDIR})
     
    141113AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
    142114                     [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
    143 AX_PROG_PERL_MODULES([ExtUtils::Depends],,
    144                      [AC_MSG_ERROR([cannot find perl module ExtUtils::Depends])])
    145115AX_PROG_PERL_MODULES([Glib],,
    146116                     [AC_MSG_ERROR([cannot find perl module Glib.])])
    147 AX_PROG_PERL_MODULES([Module::Install::Base],,
    148                      [AC_MSG_ERROR([cannot find perl module Module::Install::Base])])
    149117AX_PROG_PERL_MODULES([PAR],,
    150118                     [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
     
    161129   prefix="${ac_default_prefix}"
    162130fi
    163 
    164 dnl Add CFLAGS for glib-perl
    165 GLIB_PERL_CFLAGS=`perl -MExtUtils::Depends -e 'my $e = ExtUtils::Depends->new("BarnOwl","Glib"); my %h = $e->get_makefile_vars; print $h{"INC"}'`
    166 AC_MSG_NOTICE([Adding glib-perl CFLAGS ${GLIB_PERL_CFLAGS}])
    167 AM_CFLAGS="${GLIB_PERL_CFLAGS} ${AM_CFLAGS}"
    168131
    169132dnl Checks for typedefs, structures, and compiler characteristics.
     
    187150dnl Define __EXTENSIONS__ for strcasecmp on Solaris.
    188151AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__"
    189 dnl Define _XOPEN_SOURCE_EXTENDED for some features in ncurses,
    190 dnl including cchar_t.  This should not be necessary with
    191 dnl _XOPEN_SOURCE=600, but some versions of ncurses
    192 dnl apparently still need it.
    193 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE_EXTENDED"
    194152
    195153AC_SUBST([AM_CFLAGS])
     
    210168AC_REPLACE_FUNCS([memrchr])
    211169
    212 AC_SUBST([abs_builddir])
    213 AC_SUBST([abs_srcdir])
    214 
    215170AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
    216171AC_OUTPUT
  • context.c

    r7dcef03 rf271129  
    1010  if (!(mode & OWL_CTX_MODE_BITS))
    1111    mode |= OWL_CTX_INTERACTIVE;
    12   c = g_slice_new0(owl_context);
     12  c = g_new0(owl_context, 1);
    1313  c->mode = mode;
    1414  c->data = data;
     
    7171  if (ctx->delete_cb)
    7272    ctx->delete_cb(ctx);
    73   g_slice_free(owl_context, ctx);
     73  g_free(ctx);
    7474}
  • doc/barnowl.1

    r8135737 rbad4496  
    3535.TP
    3636\fB\-c\fP, \fB\-\-config\-file\fP=\fIFILE\fP
    37 Specify an alternate config file for \fBBarnOwl\fP to use.  The config file is
    38 an arbitrary Perl script evaluated in the \fImain\fP package, and if it
    39 overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP
    40 starts.  (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands
    41 that are run at startup after the config file is loaded.)
    42 
    43 By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP,
    44 \fI~/.barnowlconf\fP, or \fI~/.owlconf\fP that exists.
     37Specify an alternate config file for \fBBarnOwl\fP to use.  By default,
     38\fBBarnOwl\fP uses \fI~/.barnowlconf\fP if it exists, and \fI~/.owlconf\fP otherwise.
    4539
    4640.TP
  • doc/releasing-barnowl.txt

    rd995ff3 r5f08dbe  
    1616  - [ ] Do a locker build (See DOING A LOCKER BUILD)
    1717  - [ ] Update configure.ac on master to bump the version to 1.(N+1)dev
    18   - [ ] Add the barnowl-1.(N+1)dev git tag
    1918  - [ ] Push git git:
    2019   - [ ] The RC commit
    2120   - [ ] The configure.ac change on master
    2221   - [ ] A release-1.N branch pointing at the RC commit
    23    - [ ] the new git tags
    24   - [ ] Update debian/changelog on the launchpad build using `dch -v 1.(N+1)`
    25    - [ ] bzr branch lp:~barnowl/barnowl/packaging && cd packaging && dch -v 1.(N+1)
    26    - [ ] Add relevant changelog entries such as "New upstream release" or
    27          "Placeholder version number for daily builds."; fix your name and email
    28          if necessary
    29    - [ ] bzr commit && bzr push
    3022  - [ ] Copy tarball into /mit/barnowl/web_scripts/dist
    3123  - [ ] Send mail announcing the RC to barnowl-dev@mit.edu
     
    3931* DOING THE ACTUAL RELEASE
    4032  - [ ] Update the changelog and configure.ac for barnowl 1.N
    41   - [ ] Copy the changelog changes to the master branch
    4233  - [ ] run ./scripts/do-release
    4334  - [ ] Do the locker build
  • editwin.c

    r7dcef03 rf271129  
    3333  oe_excursion *excursions;
    3434
    35   void (*callback)(struct _owl_editwin *e, bool success);
     35  void (*callback)(struct _owl_editwin*);
    3636  void (*destroy_cbdata)(void *);
    3737  void *cbdata;
     
    6868static CALLER_OWN owl_editwin *owl_editwin_allocate(void)
    6969{
    70   owl_editwin *e = g_slice_new0(owl_editwin);
     70  owl_editwin *e = g_new0(owl_editwin, 1);
    7171  e->refcount = 1;
    7272  return e;
     
    8787  oe_destroy_cbdata(e);
    8888
    89   g_slice_free(owl_editwin, e);
     89  g_free(e);
    9090}
    9191
     
    220220}
    221221
    222 void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin *, bool))
     222void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin*))
    223223{
    224224  e->callback = cb;
    225225}
    226226
    227 void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin *, bool)
     227void (*owl_editwin_get_callback(owl_editwin *e))(owl_editwin*)
    228228{
    229229  return e->callback;
     
    248248}
    249249
    250 void owl_editwin_do_callback(owl_editwin *e, bool success)
    251 {
    252   void (*cb)(owl_editwin *, bool);
    253   cb = owl_editwin_get_callback(e);
    254   if (!cb) {
     250void owl_editwin_do_callback(owl_editwin *e) {
     251  void (*cb)(owl_editwin*);
     252  cb=owl_editwin_get_callback(e);
     253  if(!cb) {
    255254    owl_function_error("Internal error: No editwin callback!");
    256255  } else {
    257     cb(e, success);
     256    /* owl_function_error("text: |%s|", owl_editwin_get_text(e)); */
     257    cb(e);
    258258  }
    259259}
     
    373373owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e)
    374374{
    375   owl_editwin_excursion *x = g_slice_new(owl_editwin_excursion);
     375  owl_editwin_excursion *x = g_new(owl_editwin_excursion, 1);
    376376  oe_save_excursion(e, x);
    377377  return x;
     
    381381{
    382382  oe_restore_excursion(e, x);
    383   g_slice_free(owl_editwin_excursion, x);
     383  g_free(x);
    384384}
    385385
     
    619619
    620620  if (!g_utf8_validate(s, -1, NULL)) {
    621     owl_function_debugmsg("owl_editwin_insert_string: received non-UTF-8 string.");
     621    owl_function_debugmsg("owl_editwin_insert_string: received non-utf-8 string.");
    622622    return 0;
    623623  }
  • filter.c

    r7dcef03 rf271129  
    1818  owl_filter *f;
    1919
    20   f = g_slice_new(owl_filter);
     20  f = g_new(owl_filter, 1);
    2121
    2222  f->name=g_strdup(name);
     
    6969  if(!argc) return NULL;
    7070
    71   fe = g_slice_new(owl_filterelement);
     71  fe = g_new(owl_filterelement, 1);
    7272  owl_filterelement_create(fe);
    7373
     
    114114err:
    115115  owl_filterelement_cleanup(fe);
    116   g_slice_free(owl_filterelement, fe);
     116  g_free(fe);
    117117  return NULL;
    118118}
     
    124124
    125125  op1 = owl_filter_parse_primitive_expression(argc-i, argv+i, &skip);
     126  i += skip;
    126127  if(!op1) goto err;
    127   i += skip;
    128128
    129129  while(i < argc) {
     
    132132    op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip);
    133133    if(!op2) goto err;
    134     tmp = g_slice_new(owl_filterelement);
     134    tmp = g_new(owl_filterelement, 1);
    135135    if(!strcasecmp(argv[i], "and")) {
    136136      owl_filterelement_create_and(tmp, op1, op2);
     
    152152  if(op1) {
    153153    owl_filterelement_cleanup(op1);
    154     g_slice_free(owl_filterelement, op1);
     154    g_free(op1);
    155155  }
    156156  return NULL;
     
    219219    }
    220220    else {
    221       g_string_append_printf(out, "%i",f->bgcolor);
     221      g_string_append_printf(out, "%i",f->fgcolor);
    222222    }
    223223    g_string_append(out, " ");
     
    262262  if (f->root) {
    263263    owl_filterelement_cleanup(f->root);
    264     g_slice_free(owl_filterelement, f->root);
     264    g_free(f->root);
    265265  }
    266266  if (f->name)
    267267    g_free(f->name);
    268   g_slice_free(owl_filter, f);
    269 }
     268  g_free(f);
     269}
  • filterelement.c

    r7dcef03 r7756dde  
    328328  if (fe->left) {
    329329    owl_filterelement_cleanup(fe->left);
    330     g_slice_free(owl_filterelement, fe->left);
     330    g_free(fe->left);
    331331  }
    332332  if (fe->right) {
    333333    owl_filterelement_cleanup(fe->right);
    334     g_slice_free(owl_filterelement, fe->right);
     334    g_free(fe->right);
    335335  }
    336336  owl_regex_cleanup(&(fe->re));
  • filterproc.c

    r7155955 rf271129  
    1 #include "filterproc.h"
     1#include "owl.h"
    22#include <sys/wait.h>
    3 #include <fcntl.h>
    4 #include <glib.h>
    53#include <poll.h>
    6 #include <string.h>
    7 #include <unistd.h>
    84
    9 /* Even in case of error, send_receive is responsible for closing wfd
    10  * (to EOF the child) and rfd (for consistency). */
    11 static int send_receive(int rfd, int wfd, const char *out, char **in)
     5int send_receive(int rfd, int wfd, const char *out, char **in)
    126{
    137  GString *str = g_string_new("");
     
    2418  fds[1].fd = wfd;
    2519  fds[1].events = POLLOUT;
    26 
    27   if(!out || !*out) {
    28     /* Nothing to write. Close our end so the child doesn't hang waiting. */
    29     close(wfd); wfd = -1;
    30     out = NULL;
    31   }
    3220
    3321  while(1) {
     
    5240      }
    5341      if(!out || !*out || fds[1].revents & (POLLERR | POLLHUP)) {
    54         close(wfd); wfd = -1;
     42        close(wfd);
    5543        out = NULL;
    5644      }
     
    6856  }
    6957
    70   if (wfd >= 0) close(wfd);
    71   close(rfd);
    7258  *in = g_string_free(str, err < 0);
    7359  return err;
    7460}
    7561
    76 int call_filter(const char *const *argv, const char *in, char **out, int *status)
     62int call_filter(const char *prog, const char *const *argv, const char *in, char **out, int *status)
    7763{
    78   int err;
    79   GPid child_pid;
    80   int child_stdin, child_stdout;
     64  int err = 0;
     65  pid_t pid;
     66  int rfd[2];
     67  int wfd[2];
    8168
    82   if (!g_spawn_async_with_pipes(NULL, (char**)argv, NULL,
    83                                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
    84                                 NULL, NULL,
    85                                 &child_pid, &child_stdin, &child_stdout, NULL,
    86                                 NULL)) {
    87     *out = NULL;
    88     return 1;
     69  if((err = pipe(rfd))) goto out;
     70  if((err = pipe(wfd))) goto out_close_rfd;
     71
     72  pid = fork();
     73  if(pid < 0) {
     74    err = pid;
     75    goto out_close_all;
     76  }
     77  if(pid) {
     78    /* parent */
     79    close(rfd[1]);
     80    close(wfd[0]);
     81    err = send_receive(rfd[0], wfd[1], in, out);
     82    if(err == 0) {
     83      waitpid(pid, status, 0);
     84    }
     85  } else {
     86    /* child */
     87    close(rfd[0]);
     88    close(wfd[1]);
     89    dup2(rfd[1], 1);
     90    dup2(wfd[0], 0);
     91    close(rfd[1]);
     92    close(wfd[0]);
     93
     94    if(execvp(prog, (char *const *)argv)) {
     95      _exit(-1);
     96    }
    8997  }
    9098
    91   err = send_receive(child_stdout, child_stdin, in, out);
    92   if (err == 0) {
    93     waitpid(child_pid, status, 0);
    94   }
     99 out_close_all:
     100  close(wfd[0]);
     101  close(wfd[1]);
     102 out_close_rfd:
     103  close(rfd[0]);
     104  close(rfd[1]);
     105 out:
    95106  return err;
    96107}
  • filterproc.h

    r97cdbaf5 r06adc25  
    22#define INC_BARNOWL_FILTER_PROC_H
    33
    4 int call_filter(const char *const *argv,
     4int call_filter(const char *prog,
     5                const char *const *argv,
    56                const char *in,
    67                char **out, int *status);
  • functions.c

    r7dcef03 r0071c88  
    115115void owl_function_show_license(void)
    116116{
    117   char *text = g_strdup_printf(
    118     "BarnOwl version %s\n"
     117  const char *text;
     118
     119  text=""
     120    "BarnOwl version " OWL_VERSION_STRING "\n"
    119121    "Copyright (c) 2006-2011 The BarnOwl Developers. All rights reserved.\n"
    120122    "Copyright (c) 2004 James Kretchmar. All rights reserved.\n"
     
    153155    "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n"
    154156    "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n"
    155     "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
    156     version);
     157    "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n";
    157158  owl_function_popless_text(text);
    158   g_free(text);
    159159}
    160160
     
    196196  owl_message *m;
    197197
    198   m=g_slice_new(owl_message);
     198  m=g_new(owl_message, 1);
    199199  owl_message_create_admin(m, header, body);
    200200 
     
    204204
    205205  /* do followlast if necessary */
    206   if (owl_global_should_followlast(&g)) owl_function_lastmsg();
     206  if (owl_global_should_followlast(&g)) owl_function_lastmsg_noredisplay();
    207207
    208208  /* redisplay etc. */
     
    216216void owl_function_add_outgoing_zephyrs(const owl_zwrite *z)
    217217{
    218   if (z->cc && owl_zwrite_is_personal(z)) {
     218  if (z->cc || owl_zwrite_get_numrecips(z) == 0) {
    219219    /* create the message */
    220     owl_message *m = g_slice_new(owl_message);
     220    owl_message *m = g_new(owl_message, 1);
    221221    owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), 0);
    222222
     
    225225    int i;
    226226    for (i = 0; i < owl_zwrite_get_numrecips(z); i++) {
    227       owl_message *m;
    228 
    229       if (!owl_zwrite_recip_is_personal(owl_zwrite_get_recip_n(z, i)))
    230         continue;
    231 
    232227      /* create the message */
    233       m = g_slice_new(owl_message);
     228      owl_message *m = g_new(owl_message, 1);
    234229      owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i);
    235230
     
    251246  if (!owl_global_is_aimloggedin(&g)) return(NULL);
    252247 
    253   m=g_slice_new(owl_message);
     248  m=g_new(owl_message, 1);
    254249  owl_message_create_aim(m,
    255250                         owl_global_get_aim_screenname(&g),
     
    270265
    271266  /* create the message */
    272   m=g_slice_new(owl_message);
     267  m=g_new(owl_message, 1);
    273268  owl_message_create_loopback(m, body);
    274269  owl_message_set_direction_out(m);
     
    277272}
    278273
    279 owl_editwin *owl_function_start_edit_win(const char *line)
     274void owl_function_start_edit_win(const char *line, void (*callback)(owl_editwin *), void *data, void (*cleanup)(void *))
    280275{
    281276  owl_editwin *e;
     
    291286  g_free(s);
    292287
     288  owl_editwin_set_cbdata(e, data, cleanup);
     289  owl_editwin_set_callback(e, callback);
    293290  ctx = owl_editcontext_new(OWL_CTX_EDITMULTI, e, "editmulti",
    294291                            owl_global_deactivate_editcontext, &g);
    295292  owl_global_push_context_obj(&g, ctx);
    296   return e;
     293
    297294}
    298295
     
    312309void owl_function_zwrite_setup(owl_zwrite *z)
    313310{
    314   owl_editwin *e;
    315311  /* send a ping if necessary */
    316312  if (owl_global_is_txping(&g)) {
     
    320316
    321317  owl_function_write_setup("zephyr");
    322   e = owl_function_start_edit_win(z->zwriteline);
    323   owl_editwin_set_cbdata(e, z, (void (*)(void *))owl_zwrite_delete);
    324   owl_editwin_set_callback(e, &owl_callback_zwrite);
     318  owl_function_start_edit_win(z->zwriteline,
     319                              &owl_callback_zwrite,
     320                              z, (void(*)(void*))owl_zwrite_delete);
    325321}
    326322
    327323void owl_function_aimwrite_setup(const char *to)
    328324{
    329   owl_editwin *e;
    330325  /* TODO: We probably actually want an owl_aimwrite object like
    331326   * owl_zwrite. */
    332327  char *line = g_strdup_printf("aimwrite %s", to);
    333328  owl_function_write_setup("message");
    334   e = owl_function_start_edit_win(line);
    335   owl_editwin_set_cbdata(e, g_strdup(to), g_free);
    336   owl_editwin_set_callback(e, &owl_callback_aimwrite);
     329  owl_function_start_edit_win(line,
     330                              &owl_callback_aimwrite,
     331                              g_strdup(to),
     332                              g_free);
    337333  g_free(line);
    338334}
     
    340336void owl_function_loopwrite_setup(void)
    341337{
    342   owl_editwin *e;
    343338  owl_function_write_setup("message");
    344   e = owl_function_start_edit_win("loopwrite");
    345   owl_editwin_set_callback(e, &owl_callback_loopwrite);
    346 }
    347 
    348 void owl_callback_zwrite(owl_editwin *e, bool success)
    349 {
    350   if (!success) return;
     339  owl_function_start_edit_win("loopwrite",
     340                              &owl_callback_loopwrite,
     341                              NULL, NULL);
     342}
     343
     344void owl_callback_zwrite(owl_editwin *e) {
    351345  owl_zwrite *z = owl_editwin_get_cbdata(e);
    352346  owl_function_zwrite(z, owl_editwin_get_text(e));
     
    378372  owl_function_makemsg("Waiting for ack...");
    379373
    380   /* create the outgoing message */
    381   owl_function_add_outgoing_zephyrs(z);
     374  /* If it's personal */
     375  if (owl_zwrite_is_personal(z)) {
     376    /* create the outgoing message */
     377    owl_function_add_outgoing_zephyrs(z);
     378  }
    382379}
    383380#else
     
    405402
    406403  zcrypt = g_build_filename(owl_get_bindir(), "zcrypt", NULL);
    407   argv[0] = zcrypt;
     404  argv[0] = "zcrypt";
    408405  argv[1] = "-E";
    409406  argv[2] = "-c"; argv[3] = owl_zwrite_get_class(z);
     
    411408  argv[6] = NULL;
    412409
    413   rv = call_filter(argv, owl_zwrite_get_message(z), &cryptmsg, &status);
     410  rv = call_filter(zcrypt, argv, owl_zwrite_get_message(z), &cryptmsg, &status);
    414411
    415412  g_free(zcrypt);
     
    429426  owl_function_makemsg("Waiting for ack...");
    430427
    431   /* Create the outgoing message. Restore the un-crypted message for display. */
    432   owl_zwrite_set_message_raw(z, old_msg);
    433   owl_function_add_outgoing_zephyrs(z);
    434 
    435   /* Clean up. */
     428  /* If it's personal */
     429  if (owl_zwrite_is_personal(z)) {
     430    /* Create the outgoing message. Restore the un-crypted message for display. */
     431    owl_zwrite_set_message_raw(z, old_msg);
     432    owl_function_add_outgoing_zephyrs(z);
     433  }
     434
     435  /* free the zwrite */
    436436  g_free(cryptmsg);
    437   g_free(old_msg);
    438 }
    439 
    440 void owl_callback_aimwrite(owl_editwin *e, bool success)
    441 {
    442   if (!success) return;
     437}
     438
     439void owl_callback_aimwrite(owl_editwin *e) {
    443440  char *to = owl_editwin_get_cbdata(e);
    444441  owl_function_aimwrite(to, owl_editwin_get_text(e), true);
     
    504501}
    505502
    506 void owl_callback_loopwrite(owl_editwin *e, bool success)
    507 {
    508   if (!success) return;
     503void owl_callback_loopwrite(owl_editwin *e) {
    509504  owl_function_loopwrite(owl_editwin_get_text(e));
    510505}
     
    516511  /* create a message and put it on the message queue.  This simulates
    517512   * an incoming message */
    518   min=g_slice_new(owl_message);
     513  min=g_new(owl_message, 1);
    519514  mout=owl_function_make_outgoing_loopback(msg);
    520515
     
    813808}
    814809
    815 void owl_function_lastmsg(void)
     810void owl_function_lastmsg_noredisplay(void)
    816811{
    817812  int oldcurmsg, curmsg;
     
    831826    owl_global_set_curmsg(&g, curmsg+1);
    832827  }
    833   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     828  /* owl_mainwin_redisplay(owl_global_get_mainwin(&g)); */
    834829  owl_global_set_direction_downwards(&g);
     830}
     831
     832void owl_function_lastmsg(void)
     833{
     834  owl_function_lastmsg_noredisplay();
     835  owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
    835836}
    836837
     
    855856void owl_function_unsuball(void)
    856857{
    857   if (unsuball())
    858     owl_function_makemsg("Unsubscribed from all messages.");
     858  unsuball();
     859  owl_function_makemsg("Unsubscribed from all messages.");
    859860}
    860861
     
    871872void owl_function_loadsubs(const char *file)
    872873{
    873   int ret, ret2, ret3;
     874  int ret, ret2;
     875  const char *foo;
    874876  char *path;
    875877
     
    883885
    884886  /* for backwards compatibility for now */
    885   ret2 = owl_zephyr_loaddefaultsubs();
    886   ret3 = owl_zephyr_loadbarnowldefaultsubs();
     887  ret2=owl_zephyr_loaddefaultsubs();
    887888
    888889  if (!owl_context_is_interactive(owl_global_get_context(&g))) return;
    889890
    890   if (ret == 0 && ret2 == 0 && ret3 == 0) {
     891  foo=file?file:"file";
     892  if (ret==0 && ret2==0) {
    891893    if (!file) {
    892894      owl_function_makemsg("Subscribed to messages.");
     
    894896      owl_function_makemsg("Subscribed to messages from %s", file);
    895897    }
    896   } else if (ret == -1) {
    897     owl_function_error("Could not read %s", file ? file : "file");
    898   } else if (ret2 == -1) {
     898  } else if (ret==-1) {
     899    owl_function_error("Could not read %s", foo);
     900  } else {
    899901    owl_function_error("Error subscribing to messages");
    900   } else {
    901     owl_function_error("Error subscribing to instanced personals");
    902902  }
    903903}
     
    918918}
    919919
    920 void owl_callback_aimlogin(owl_editwin *e, bool success)
    921 {
    922   if (!success) return;
     920void owl_callback_aimlogin(owl_editwin *e) {
    923921  char *user = owl_editwin_get_cbdata(e);
    924922  owl_function_aimlogin(user,
     
    991989  /* owl_aim_set_awaymsg(""); */
    992990  owl_function_makemsg("AIM away off");
    993 }
    994 
    995 bool owl_function_is_away(void)
    996 {
    997   return owl_global_is_zaway(&g) ||
    998          owl_global_is_aaway(&g) ||
    999          owl_perlconfig_perl_call_bool("BarnOwl::Hooks::_get_is_away", 0, NULL);
    1000991}
    1001992
     
    13591350void owl_function_about(void)
    13601351{
    1361   char *text = g_strdup_printf(
    1362     "This is BarnOwl version %s.\n\n"
     1352  owl_function_popless_text(
     1353    "This is BarnOwl version " OWL_VERSION_STRING ".\n\n"
    13631354    "BarnOwl is a fork of the Owl zephyr client, written and\n"
    13641355    "maintained by Alejandro Sedeno and Nelson Elhage at the\n"
     
    13791370    "This program is free software. You can redistribute it and/or\n"
    13801371    "modify under the terms of the Sleepycat License. Use the \n"
    1381       "':show license' command to display the full license\n",
    1382       version);
    1383   owl_function_popless_text(text);
    1384   g_free(text);
     1372    "':show license' command to display the full license\n"
     1373  );
    13851374}
    13861375
     
    14411430      char *tmpbuff, *tmpbuff2;
    14421431      int i, fields;
    1443       const char *f;
    14441432
    14451433      if (!owl_message_is_pseudo(m)) {
     
    14721460        owl_fmtext_append_normal(&fm, "\n");
    14731461        owl_fmtext_appendf_normal(&fm, "  Port      : %i\n", ntohs(n->z_port));
    1474         owl_fmtext_appendf_normal(&fm, "  Charset   : %s\n", owl_zephyr_get_charsetstr(n));
    14751462        owl_fmtext_appendf_normal(&fm, "  Auth      : %s\n", owl_zephyr_get_authstr(n));
    14761463
     
    14841471        owl_fmtext_appendf_normal(&fm, "  Fields    : %i\n", fields);
    14851472
    1486         for (i = 0, f = owl_zephyr_first_raw_field(n); f != NULL;
    1487              i++, f = owl_zephyr_next_raw_field(n, f)) {
    1488           tmpbuff = owl_zephyr_field_as_utf8(n, f);
     1473        for (i = 0; i < fields; i++) {
     1474          tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
    14891475          tmpbuff2 = owl_text_indent(tmpbuff, 14, false);
    14901476          owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff2);
     
    17841770
    17851771  owl_fmtext_append_normal(&fm, "  Version: ");
    1786   owl_fmtext_append_normal(&fm, version);
     1772  owl_fmtext_append_normal(&fm, OWL_VERSION_STRING);
    17871773  owl_fmtext_append_normal(&fm, "\n");
    17881774
     
    19541940}
    19551941
    1956 void owl_callback_command(owl_editwin *e, bool success)
    1957 {
    1958   if (!success) return;
     1942void owl_callback_command(owl_editwin *e)
     1943{
    19591944  char *rv;
    19601945  const char *line = owl_editwin_get_text(e);
     
    19671952}
    19681953
    1969 owl_editwin *owl_function_start_command(const char *line)
     1954void owl_function_start_command(const char *line)
    19701955{
    19711956  owl_editwin *tw;
     
    19821967  owl_global_push_context_obj(&g, ctx);
    19831968  owl_editwin_set_callback(tw, owl_callback_command);
    1984   return tw;
    1985 }
    1986 
    1987 owl_editwin *owl_function_start_question(const char *line)
     1969}
     1970
     1971CALLER_OWN owl_editwin *owl_function_start_question(const char *line)
    19881972{
    19891973  owl_editwin *tw;
     
    20001984}
    20011985
    2002 owl_editwin *owl_function_start_password(const char *line)
     1986CALLER_OWN owl_editwin *owl_function_start_password(const char *line)
    20031987{
    20041988  owl_editwin *tw;
     
    21972181  f = owl_filter_new(argv[1], argc-2, argv+2);
    21982182  if (f == NULL) {
    2199     owl_function_error("Invalid filter: %s", argv[1]);
     2183    owl_function_error("Invalid filter");
    22002184    return false;
    22012185  }
     
    34823466  while (zaldptr) {
    34833467    ZFreeALD(zaldptr->data);
    3484     g_slice_free(ZAsyncLocateData_t, zaldptr->data);
     3468    g_free(zaldptr->data);
    34853469    zaldptr = g_list_next(zaldptr);
    34863470  }
     
    34923476    for (i = 0; i < anyone->len; i++) {
    34933477      user = anyone->pdata[i];
    3494       zald = g_slice_new(ZAsyncLocateData_t);
     3478      zald = g_new(ZAsyncLocateData_t, 1);
    34953479      if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
    34963480        *zaldlist = g_list_append(*zaldlist, zald);
    34973481      } else {
    3498         g_slice_free(ZAsyncLocateData_t, zald);
     3482        g_free(zald);
    34993483      }
    35003484    }
  • global.c

    r7dcef03 r9078f69  
    99  const char *homedir;
    1010
    11 #if !GLIB_CHECK_VERSION(2, 35, 0)
    1211  g_type_init();
    13 #endif
    14 #if !GLIB_CHECK_VERSION(2, 31, 0)
    1512  g_thread_init(NULL);
    16 #endif
    1713
    1814  owl_select_init();
     
    5652  g->starttime=time(NULL); /* assumes we call init only a start time */
    5753  g->lastinputtime=g->starttime;
    58   g->last_wakeup_time = g->starttime;
    5954  g->newmsgproc_pid=0;
    6055 
     
    8075  g_free(cd);
    8176
    82   g->msglist = owl_messagelist_new();
     77  owl_messagelist_create(&(g->msglist));
    8378
    8479  _owl_global_init_windows(g);
     
    105100
    106101  g->interrupt_count = 0;
    107 #if GLIB_CHECK_VERSION(2, 31, 0)
    108   g_mutex_init(&g->interrupt_lock);
    109 #else
    110102  g->interrupt_lock = g_mutex_new();
    111 #endif
    112103}
    113104
     
    118109
    119110  /* Create the widgets */
    120   g->mw = owl_mainwin_new(g->mainpanel.recwin);
     111  owl_mainwin_init(&(g->mw), g->mainpanel.recwin);
    121112  owl_msgwin_init(&(g->msgwin), g->mainpanel.msgwin);
    122113  owl_sepbar_init(g->mainpanel.sepwin);
     
    250241/* windows */
    251242
    252 owl_mainwin *owl_global_get_mainwin(owl_global *g)
    253 {
    254   return g->mw;
     243owl_mainwin *owl_global_get_mainwin(owl_global *g) {
     244  return(&(g->mw));
    255245}
    256246
     
    266256
    267257owl_messagelist *owl_global_get_msglist(owl_global *g) {
    268   return g->msglist;
     258  return(&(g->msglist));
    269259}
    270260
     
    485475}
    486476
    487 void owl_global_wakeup(owl_global *g)
    488 {
    489   if (time(NULL) - g->last_wakeup_time >= 1) {
    490     g_free(owl_perlconfig_execute("BarnOwl::Hooks::_wakeup()"));
    491     g->last_wakeup_time = time(NULL);
    492   }
    493 }
    494 
    495477/* viewwin */
    496478
     
    553535  e->g->filterlist = g_list_remove(e->g->filterlist, e->f);
    554536  owl_filter_delete(e->f);
    555   g_slice_free(owl_global_filter_ent, e);
     537  g_free(e);
    556538}
    557539
    558540void owl_global_add_filter(owl_global *g, owl_filter *f) {
    559   owl_global_filter_ent *e = g_slice_new(owl_global_filter_ent);
     541  owl_global_filter_ent *e = g_new(owl_global_filter_ent, 1);
    560542  e->g = g;
    561543  e->f = f;
     
    858840  } filters[] = {
    859841    { "personal",
    860       "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message$ ) )" },
     842      "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message  ) )" },
    861843    { "trash",
    862844      "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" },
     
    865847    { "auto", "opcode ^auto$" },
    866848    { "login", "not login ^none$" },
    867     { "reply-lockout", "class ^mail$ or class ^filsrv$" },
     849    { "reply-lockout", "class ^mail$" },
    868850    { "out", "direction ^out$" },
    869851    { "aim", "type ^aim$" },
     
    916898}
    917899
    918 static GMutex *owl_global_get_interrupt_lock(owl_global *g)
    919 {
    920 #if GLIB_CHECK_VERSION(2, 31, 0)
    921   return &g->interrupt_lock;
    922 #else
    923   return g->interrupt_lock;
    924 #endif
    925 }
    926 
    927900void owl_global_add_interrupt(owl_global *g) {
    928901  /* TODO: This can almost certainly be done with atomic
    929902   * operations. Whatever. */
    930   g_mutex_lock(owl_global_get_interrupt_lock(g));
     903  g_mutex_lock(g->interrupt_lock);
    931904  g->interrupt_count++;
    932   g_mutex_unlock(owl_global_get_interrupt_lock(g));
     905  g_mutex_unlock(g->interrupt_lock);
    933906}
    934907
    935908bool owl_global_take_interrupt(owl_global *g) {
    936909  bool ans = false;
    937   g_mutex_lock(owl_global_get_interrupt_lock(g));
     910  g_mutex_lock(g->interrupt_lock);
    938911  if (g->interrupt_count > 0) {
    939912    ans = true;
    940913    g->interrupt_count--;
    941914  }
    942   g_mutex_unlock(owl_global_get_interrupt_lock(g));
     915  g_mutex_unlock(g->interrupt_lock);
    943916  return ans;
    944917}
  • help.c

    r8258ea5 rf271129  
    7373     "    : , M-x       Enter command mode\n"
    7474     "\n"
    75      "    /             Forward search\n"
     75     "    /             Foward search\n"
    7676     "    ?             Reverse search\n"
    7777     "\n\n"
     
    107107     "    unsuball      Unsubscribe from all zephyr classes\n"
    108108     "    load-subs     Load zephyr subscriptions from a file\n"
    109      "    zpunt         Suppress messages from a zephyr triplet\n"
     109     "    zpunt         Supress messages from a zephyr triplet\n"
    110110     "    zlog          Send a login or logout notification\n"
    111111     "    zlist         Print a list of zephyr buddies logged in\n"
  • keybinding.c

    r7dcef03 rf271129  
    1414CALLER_OWN owl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
    1515{
    16   owl_keybinding *kb = g_slice_new(owl_keybinding);
     16  owl_keybinding *kb = g_new(owl_keybinding, 1);
    1717
    1818  owl_function_debugmsg("owl_keybinding_init: creating binding for <%s> with desc: <%s>", keyseq, desc);
    1919  if (command && function_fn) {
    20     g_slice_free(owl_keybinding, kb);
     20    g_free(kb);
    2121    return NULL;
    2222  } else if (command && !function_fn) {
     
    2929
    3030  if (owl_keybinding_make_keys(kb, keyseq) != 0) {
    31     g_slice_free(owl_keybinding, kb);
     31    g_free(kb);
    3232    return NULL;
    3333  }
     
    7070  g_free(kb->desc);
    7171  g_free(kb->command);
    72   g_slice_free(owl_keybinding, kb);
     72  g_free(kb);
    7373}
    7474
  • keymap.c

    r7dcef03 rf271129  
    189189{
    190190  owl_keymap *km;
    191   km = g_slice_new(owl_keymap);
     191  km = g_new(owl_keymap, 1);
    192192  owl_keymap_init(km, name, desc, default_fn, prealways_fn, postalways_fn);
    193193  owl_keyhandler_add_keymap(kh, km);
  • libfaim/Makefile.am

    rb80bae0 r215c119  
    1313libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \
    1414                     -I${top_srcdir}/libfaim
    15 
    16 EXTRA_DIST = oscar.c
  • logging.c

    r7dcef03 rf271129  
    177177    g_free(msg->message);
    178178    g_free(msg->filename);
    179     g_slice_free(owl_log_entry, msg);
     179    g_free(msg);
    180180  }
    181181}
     
    184184{
    185185  owl_log_entry *log_msg = NULL;
    186   log_msg = g_slice_new(owl_log_entry);
     186  log_msg = g_new(owl_log_entry,1);
    187187  log_msg->message = g_strdup(buffer);
    188188  log_msg->filename = g_strdup(filename);
     
    266266   * owl_log_shouldlog_message(void)
    267267   */
    268   m = g_slice_new(owl_message);
     268  m = g_new(owl_message, 1);
    269269  /* recip_index = 0 because there can only be one recipient anyway */
    270270  owl_message_create_from_zwrite(m, zw, text, 0);
     
    429429static gpointer owl_log_thread_func(gpointer data)
    430430{
     431  log_context = g_main_context_new();
    431432  log_loop = g_main_loop_new(log_context, FALSE);
    432433  g_main_loop_run(log_loop);
     
    436437void owl_log_init(void)
    437438{
    438   log_context = g_main_context_new();
    439 #if GLIB_CHECK_VERSION(2, 31, 0)
    440   logging_thread = g_thread_new("logging",
    441                                 owl_log_thread_func,
    442                                 NULL);
    443 #else
    444439  GError *error = NULL;
    445440  logging_thread = g_thread_create(owl_log_thread_func,
     
    453448    exit(1);
    454449  }
    455 #endif
    456450 
    457451}
  • m4/ax_cflags_warn_all.m4

    re9b4a2c r378ede7  
    2525#    - $3 action-if-found : add value to shellvariable
    2626#    - $4 action-if-not-found : nothing
    27 #
    28 #   NOTE: These macros depend on AX_APPEND_FLAG.
    2927#
    3028# LICENSE
     
    5957#   exception to the GPL to apply to your modified version as well.
    6058
    61 #serial 14
     59#serial 10
    6260
    63 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
    64 AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
    65 AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
     61AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
     62AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
     63AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
    6664AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
    6765VAR,[VAR="no, unknown"
    68 ac_save_[]FLAGS="$[]FLAGS"
     66 AC_LANG_PUSH([C])
     67 ac_save_[]FLAGS="$[]FLAGS"
     68for ac_arg dnl
     69in "-pedantic  % -Wall"       dnl   GCC
     70   "-xstrconst % -v"          dnl Solaris C
     71   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
     72   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
     73   "-ansi -ansiE % -fullwarn" dnl IRIX
     74   "+ESlit     % +w1"         dnl HP-UX C
     75   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
     76   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
     77   #
     78do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
     79   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
     80                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
     81done
     82 FLAGS="$ac_save_[]FLAGS"
     83 AC_LANG_POP([C])
     84])
     85case ".$VAR" in
     86     .ok|.ok,*) m4_ifvaln($3,$3) ;;
     87   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
     88        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
     89                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
     90   *) m4_ifvaln($3,$3,[
     91   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
     92   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
     93   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
     94                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
     95   fi ]) ;;
     96esac
     97AS_VAR_POPDEF([VAR])dnl
     98AS_VAR_POPDEF([FLAGS])dnl
     99])
     100
     101dnl the only difference - the LANG selection... and the default FLAGS
     102
     103AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
     104AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
     105AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl
     106AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
     107VAR,[VAR="no, unknown"
     108 AC_LANG_PUSH([C++])
     109 ac_save_[]FLAGS="$[]FLAGS"
     110for ac_arg dnl
     111in "-pedantic  % -Wall"       dnl   GCC
     112   "-xstrconst % -v"          dnl Solaris C
     113   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
     114   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
     115   "-ansi -ansiE % -fullwarn" dnl IRIX
     116   "+ESlit     % +w1"         dnl HP-UX C
     117   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
     118   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
     119   #
     120do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
     121   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
     122                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
     123done
     124 FLAGS="$ac_save_[]FLAGS"
     125 AC_LANG_POP([C++])
     126])
     127case ".$VAR" in
     128     .ok|.ok,*) m4_ifvaln($3,$3) ;;
     129   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
     130        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
     131                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
     132   *) m4_ifvaln($3,$3,[
     133   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
     134   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
     135   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
     136                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
     137   fi ]) ;;
     138esac
     139AS_VAR_POPDEF([VAR])dnl
     140AS_VAR_POPDEF([FLAGS])dnl
     141])
     142
     143dnl the only difference - the LANG selection... and the default FLAGS
     144
     145AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
     146AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl
     147AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl
     148AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
     149VAR,[VAR="no, unknown"
     150 AC_LANG_PUSH([Fortran])
     151 ac_save_[]FLAGS="$[]FLAGS"
    69152for ac_arg dnl
    70153in "-warn all  % -warn all"   dnl Intel
     
    82165                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
    83166done
    84 FLAGS="$ac_save_[]FLAGS"
     167 FLAGS="$ac_save_[]FLAGS"
     168 AC_LANG_POP([Fortran])
    85169])
    86 AS_VAR_POPDEF([FLAGS])dnl
    87 AC_REQUIRE([AX_APPEND_FLAG])
    88170case ".$VAR" in
    89171     .ok|.ok,*) m4_ifvaln($3,$3) ;;
    90    .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
    91    *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
     172   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
     173        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
     174                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
     175   *) m4_ifvaln($3,$3,[
     176   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
     177   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
     178   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
     179                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
     180   fi ]) ;;
    92181esac
    93182AS_VAR_POPDEF([VAR])dnl
    94 ])dnl AX_FLAGS_WARN_ALL
     183AS_VAR_POPDEF([FLAGS])dnl
     184])
     185
    95186dnl  implementation tactics:
    96187dnl   the for-argument contains a list of options. The first part of
     
    103194dnl   delimiter. A non-option comment can be given after "%%" marks
    104195dnl   which will be shown but not added to the respective C/CXXFLAGS.
    105 
    106 AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
    107 AC_LANG_PUSH([C])
    108 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
    109 AC_LANG_POP([C])
    110 ])
    111 
    112 AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
    113 AC_LANG_PUSH([C++])
    114 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
    115 AC_LANG_POP([C++])
    116 ])
    117 
    118 AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
    119 AC_LANG_PUSH([Fortran])
    120 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
    121 AC_LANG_POP([Fortran])
    122 ])
  • m4/pkg.m4

    r13a39ae8 r650fb2c  
    158158fi[]dnl
    159159])# PKG_CHECK_MODULES
    160 
    161 
    162 # PKG_INSTALLDIR(DIRECTORY)
    163 # -------------------------
    164 # Substitutes the variable pkgconfigdir as the location where a module
    165 # should install pkg-config .pc files. By default the directory is
    166 # $libdir/pkgconfig, but the default can be changed by passing
    167 # DIRECTORY. The user can override through the --with-pkgconfigdir
    168 # parameter.
    169 AC_DEFUN([PKG_INSTALLDIR],
    170 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
    171 m4_pushdef([pkg_description],
    172     [pkg-config installation directory @<:@]pkg_default[@:>@])
    173 AC_ARG_WITH([pkgconfigdir],
    174     [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
    175     [with_pkgconfigdir=]pkg_default)
    176 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
    177 m4_popdef([pkg_default])
    178 m4_popdef([pkg_description])
    179 ]) dnl PKG_INSTALLDIR
    180 
    181 
    182 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
    183 # -------------------------
    184 # Substitutes the variable noarch_pkgconfigdir as the location where a
    185 # module should install arch-independent pkg-config .pc files. By
    186 # default the directory is $datadir/pkgconfig, but the default can be
    187 # changed by passing DIRECTORY. The user can override through the
    188 # --with-noarch-pkgconfigdir parameter.
    189 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
    190 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
    191 m4_pushdef([pkg_description],
    192     [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
    193 AC_ARG_WITH([noarch-pkgconfigdir],
    194     [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
    195     [with_noarch_pkgconfigdir=]pkg_default)
    196 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
    197 m4_popdef([pkg_default])
    198 m4_popdef([pkg_description])
    199 ]) dnl PKG_NOARCH_INSTALLDIR
    200 
    201 
    202 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
    203 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
    204 # -------------------------------------------
    205 # Retrieves the value of the pkg-config variable for the given module.
    206 AC_DEFUN([PKG_CHECK_VAR],
    207 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
    208 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
    209 
    210 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
    211 AS_VAR_COPY([$1], [pkg_cv_][$1])
    212 
    213 AS_VAR_IF([$1], [""], [$5], [$4])dnl
    214 ])# PKG_CHECK_VAR
  • mainwin.c

    r7dcef03 r099597c  
    44static void owl_mainwin_resized(owl_window *w, void *user_data);
    55
    6 CALLER_OWN owl_mainwin *owl_mainwin_new(owl_window *window)
     6void owl_mainwin_init(owl_mainwin *mw, owl_window *window)
    77{
    8   owl_mainwin *mw = g_slice_new(owl_mainwin);
    98  mw->curtruncated=0;
    109  mw->lastdisplayed=-1;
     
    1716  /* For now, we do not bother with connecting up dependencies; that'll be a
    1817   * future refactor of the mainwin */
    19 
    20   return mw;
    2118}
    2219
  • message.c

    r7dcef03 r0071c88  
    7070
    7171  if(pair ==  NULL) {
    72     pair = g_slice_new(owl_pair);
     72    pair = g_new(owl_pair, 1);
    7373    owl_pair_create(pair, attrname, NULL);
    7474    g_ptr_array_add(m->attributes, pair);
     
    836836
    837837 
    838   /* set the "isprivate" attribute if it's a private zephyr. */
    839   if (owl_zwrite_recip_is_personal(n->z_recipient)) {
     838  /* set the "isprivate" attribute if it's a private zephyr.
     839   ``private'' means recipient is non-empty and doesn't start wit
     840   `@' */
     841  if (*n->z_recipient && *n->z_recipient != '@') {
    840842    owl_message_set_isprivate(m);
    841843  }
     
    875877  if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
    876878    const char *argv[] = {
    877       NULL,
     879      "zcrypt",
    878880      "-D",
    879881      "-c", owl_message_get_class(m),
     
    881883      NULL
    882884    };
    883     char *out = NULL;
     885    char *out;
    884886    int rv;
    885887    int status;
     
    887889
    888890    zcrypt = g_build_filename(owl_get_bindir(), "zcrypt", NULL);
    889     argv[0] = zcrypt;
    890 
    891     rv = call_filter(argv, owl_message_get_body(m), &out, &status);
     891
     892    rv = call_filter(zcrypt, argv, owl_message_get_body(m), &out, &status);
    892893    g_free(zcrypt);
    893894
     
    898899      }
    899900      owl_message_set_body(m, out);
    900     } else {
    901       /* Replace the opcode. Otherwise the UI and other bits of code think the
    902        * message was encrypted. */
    903       owl_message_set_opcode(m, "failed-decrypt");
    904     }
    905     g_free(out);
     901      g_free(out);
     902    } else if(out) {
     903      g_free(out);
     904    }
    906905  }
    907906
     
    10191018    p = m->attributes->pdata[i];
    10201019    g_free(owl_pair_get_value(p));
    1021     g_slice_free(owl_pair, p);
     1020    g_free(p);
    10221021  }
    10231022
     
    10301029{
    10311030  owl_message_cleanup(m);
    1032   g_slice_free(owl_message, m);
    1033 }
     1031  g_free(m);
     1032}
  • messagelist.c

    r7dcef03 rf271129  
    11#include "owl.h"
    22
    3 CALLER_OWN owl_messagelist *owl_messagelist_new(void)
     3void owl_messagelist_create(owl_messagelist *ml)
    44{
    5   owl_messagelist *ml = g_slice_new(owl_messagelist);
    65  ml->list = g_ptr_array_new();
    7   return ml;
    86}
    97
    10 void owl_messagelist_delete(owl_messagelist *ml, bool free_messages)
     8void owl_messagelist_cleanup(owl_messagelist *ml, bool free_messages)
    119{
    1210  if (free_messages)
    1311    g_ptr_array_foreach(ml->list, (GFunc)owl_message_delete, NULL);
    1412  g_ptr_array_free(ml->list, true);
    15   g_slice_free(owl_messagelist, ml);
    1613}
    1714
  • owl.c

    r441fd42 rf271129  
    1212#include <sys/stat.h>
    1313#include <locale.h>
    14 #include <unistd.h>
    1514
    1615#if OWL_STDERR_REDIR
     
    3433} owl_options;
    3534
    36 void usage(FILE *file)
     35void usage(void)
    3736{
    38   fprintf(file, "BarnOwl version %s\n", version);
    39   fprintf(file, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
    40   fprintf(file, "  -n,--no-subs        don't load zephyr subscriptions\n");
    41   fprintf(file, "  -d,--debug          enable debugging\n");
    42   fprintf(file, "  -v,--version        print the BarnOwl version number and exit\n");
    43   fprintf(file, "  -h,--help           print this help message\n");
    44   fprintf(file, "  -s,--config-dir     specify an alternate config dir (default ~/.owl)\n");
    45   fprintf(file, "  -c,--config-file    specify an alternate config file (default ~/.owl/init.pl)\n");
    46   fprintf(file, "  -t,--tty            set the tty name\n");
     37  fprintf(stderr, "Barnowl version %s\n", OWL_VERSION_STRING);
     38  fprintf(stderr, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
     39  fprintf(stderr, "  -n,--no-subs        don't load zephyr subscriptions\n");
     40  fprintf(stderr, "  -d,--debug          enable debugging\n");
     41  fprintf(stderr, "  -v,--version        print the Barnowl version number and exit\n");
     42  fprintf(stderr, "  -h,--help           print this help message\n");
     43  fprintf(stderr, "  -c,--config-file    specify an alternate config file\n");
     44  fprintf(stderr, "  -s,--config-dir     specify an alternate config dir (default ~/.owl)\n");
     45  fprintf(stderr, "  -t,--tty            set the tty name\n");
    4746}
    4847
     
    8079      break;
    8180    case 'v':
    82       printf("This is BarnOwl version %s\n", version);
     81      printf("This is BarnOwl version %s\n", OWL_VERSION_STRING);
    8382      exit(0);
    8483    case 'h':
    85       usage(stdout);
    86       exit(0);
    8784    default:
    88       usage(stderr);
     85      usage();
    8986      exit(1);
    9087    }
     
    265262    /* follow the last message if we're supposed to */
    266263    if (followlast)
    267       owl_function_lastmsg();
     264      owl_function_lastmsg_noredisplay();
    268265
    269266    /* do the newmsgproc thing */
     
    289286
    290287  owl_global_set_lastinputtime(&g, time(NULL));
    291   owl_global_wakeup(&g);
    292288  ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j);
    293289  if (ret!=0 && ret!=1) {
     
    431427  if (0 != pipe(pipefds)) {
    432428    perror("pipe");
    433     owl_function_debugmsg("stderr_replace: pipe FAILED");
     429    owl_function_debugmsg("stderr_replace: pipe FAILED\n");
    434430    return -1;
    435431  }
    436     owl_function_debugmsg("stderr_replace: pipe: %d,%d", pipefds[0], pipefds[1]);
    437   if (-1 == dup2(pipefds[1], STDERR_FILENO)) {
    438     owl_function_debugmsg("stderr_replace: dup2 FAILED (%s)", strerror(errno));
     432    owl_function_debugmsg("stderr_replace: pipe: %d,%d\n", pipefds[0], pipefds[1]);
     433  if (-1 == dup2(pipefds[1], 2 /*stderr*/)) {
     434    owl_function_debugmsg("stderr_replace: dup2 FAILED (%s)\n", strerror(errno));
    439435    perror("dup2");
    440436    return -1;
     
    518514#if OWL_STDERR_REDIR
    519515  /* Do this only after we've started curses up... */
    520   if (isatty(STDERR_FILENO)) {
    521     owl_function_debugmsg("startup: doing stderr redirection");
    522     channel = g_io_channel_unix_new(stderr_replace());
    523     g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, &stderr_redirect_handler, NULL);
    524     g_io_channel_unref(channel);
    525   }
     516  owl_function_debugmsg("startup: doing stderr redirection");
     517  channel = g_io_channel_unix_new(stderr_replace());
     518  g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, &stderr_redirect_handler, NULL);
     519  g_io_channel_unref(channel);
    526520#endif
    527521
     
    578572  /* welcome message */
    579573  owl_function_debugmsg("startup: creating splash message");
    580   char *welcome = g_strdup_printf(
     574  owl_function_adminmsg("",
    581575    "-----------------------------------------------------------------------\n"
    582     "Welcome to BarnOwl version %s.\n"
     576    "Welcome to BarnOwl version " OWL_VERSION_STRING ".\n"
    583577    "To see a quick introduction, type ':show quickstart'.                  \n"
    584578    "Press 'h' for on-line help.                                            \n"
     
    588582    "                                                                 OvO   \n"
    589583    "Please report any bugs or suggestions to bug-barnowl@mit.edu    (   )  \n"
    590     "-----------------------------------------------------------------m-m---\n",
    591     version);
    592   owl_function_adminmsg("", welcome);
    593   g_free(welcome);
    594 
    595   owl_function_debugmsg("startup: setting context interactive");
    596 
    597   owl_global_pop_context(&g);
    598   owl_global_push_context(&g, OWL_CTX_INTERACTIVE|OWL_CTX_RECV, NULL, "recv", NULL);
     584    "-----------------------------------------------------------------m-m---\n"
     585  );
    599586
    600587  /* process the startup file */
     
    609596      owl_function_error("No such style: %s", owl_global_get_default_style(&g));
    610597
     598  owl_function_debugmsg("startup: setting context interactive");
     599
     600  owl_global_pop_context(&g);
     601  owl_global_push_context(&g, OWL_CTX_INTERACTIVE|OWL_CTX_RECV, NULL, "recv", NULL);
     602
    611603  source = owl_window_redraw_source_new();
    612604  g_source_attach(source, NULL);
  • owl.h

    rca1fb26a rb9517cf  
    1010#define INC_BARNOWL_OWL_H
    1111
    12 #include <config.h>
     12#include "config.h"
    1313
    1414#include "compat/compat.h"
     
    4747/* Perl and curses don't play nice. */
    4848#ifdef OWL_PERL
    49 typedef struct _owl_fake_WINDOW WINDOW;
    50 typedef struct _owl_fake_PANEL PANEL;
     49typedef void WINDOW;
     50typedef void PANEL;
    5151/* logout is defined in FreeBSD. */
    5252#define logout logout_
     
    5757#include "XSUB.h"
    5858#else
    59 typedef struct _owl_fake_SV SV;
    60 typedef struct _owl_fake_AV AV;
    61 typedef struct _owl_fake_HV HV;
     59typedef void SV;
     60typedef void AV;
     61typedef void HV;
    6262#endif
    6363
    6464#include "window.h"
    6565
    66 extern const char *version;
     66#ifndef OWL_VERSION_STRING
     67#ifdef  GIT_VERSION
     68#define stringify(x)       __stringify(x)
     69#define __stringify(x)     #x
     70#define OWL_VERSION_STRING stringify(GIT_VERSION)
     71#else
     72#define OWL_VERSION_STRING PACKAGE_VERSION
     73#endif
     74#endif /* !OWL_VERSION_STRING */
    6775
    6876/* Feature that is being tested to redirect stderr through a pipe.
     
    227235  char *name;
    228236  int   type;  /* OWL_VARIABLE_* */
    229   char *default_str;            /* the default value as a string */
    230   char *validsettings;          /* documentation of valid settings */
     237  void *pval_default;  /* for types other and string */
     238  int   ival_default;  /* for types int and bool     */
     239  const char *validsettings;    /* documentation of valid settings */
    231240  char *summary;                /* summary of usage */
    232241  char *description;            /* detailed description */
    233   bool takes_on_off;            /* allow passing on/off in argument-less set/unset */
    234   GClosure *set_fromstring_fn;
     242  void *val;                    /* current value */
     243  int  (*validate_fn)(const struct _owl_variable *v, const void *newval);
     244                                /* returns 1 if newval is valid */
     245  int  (*set_fn)(struct _owl_variable *v, const void *newval);
    235246                                /* sets the variable to a value
    236                                  * of the appropriate type.
    237                                  * unless documented, this
    238                                  * should make a copy.
    239                                  * returns 0 on success. */
    240   GClosure *get_tostring_fn;
     247                                 * of the appropriate type.
     248                                 * unless documented, this
     249                                 * should make a copy.
     250                                 * returns 0 on success. */
     251  int  (*set_fromstring_fn)(struct _owl_variable *v, const char *newval);
     252                                /* sets the variable to a value
     253                                 * of the appropriate type.
     254                                 * unless documented, this
     255                                 * should make a copy.
     256                                 * returns 0 on success. */
     257  const void *(*get_fn)(const struct _owl_variable *v);
     258                                /* returns a reference to the current value.
     259                                 * WARNING:  this approach is hard to make
     260                                 * thread-safe... */
     261  CALLER_OWN char *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
    241262                                /* converts val to a string;
    242                                  * caller must free the result */
    243 
    244   /* These are only valid for OWL_VARIABLE_{INT,BOOL,STRING} */
    245   GValue val;                   /* current value, if default get_fn/set_fn */
    246 
    247   GCallback get_fn;
    248                                 /* returns a reference to the current value.
    249                                  * WARNING:  this approach is hard to make
    250                                  * thread-safe... */
    251   GCallback validate_fn;
    252                                 /* returns 1 if newval is valid */
    253   GCallback set_fn;
    254                                 /* sets the variable to a value
    255                                  * of the appropriate type.
    256                                  * unless documented, this
    257                                  * should make a copy.
    258                                  * returns 0 on success. */
     263                                 * caller must free the result */
     264  void (*delete_fn)(struct _owl_variable *v);
     265                                /* frees val as needed */
    259266} owl_variable;
    260 
    261267
    262268typedef struct _owl_input {
     
    446452  char *name;
    447453  owl_filter *filter;
    448   owl_messagelist *ml;
     454  owl_messagelist ml;
    449455  const owl_style *style;
    450456  int cachedmsgid;
     
    527533
    528534typedef struct _owl_global {
    529   owl_mainwin *mw;
     535  owl_mainwin mw;
    530536  owl_popwin *pw;
    531537  owl_msgwin msgwin;
     
    545551  int curmsg_vert_offset;
    546552  owl_view current_view;
    547   owl_messagelist *msglist;
     553  owl_messagelist msglist;
    548554  WINDOW *input_pad;
    549555  owl_mainpanel mainpanel;
     
    563569  time_t starttime;
    564570  time_t lastinputtime;
    565   time_t last_wakeup_time;
    566571  char *startupargs;
    567572  int nextmsgid;
     
    591596  char *kill_buffer;
    592597  int interrupt_count;
    593 #if GLIB_CHECK_VERSION(2, 31, 0)
    594   GMutex interrupt_lock;
    595 #else
    596598  GMutex *interrupt_lock;
    597 #endif
    598599} owl_global;
    599600
     
    601602extern owl_global g;
    602603
    603 #include <owl_prototypes.h>
     604#include "owl_prototypes.h"
    604605
    605606/* These were missing from the Zephyr includes before Zephyr 3. */
     
    609610#endif
    610611
    611 /* We have to dynamically bind these ourselves */
    612 extern gboolean (*gvalue_from_sv) (GValue * value, SV * sv);
    613 extern SV * (*sv_from_gvalue) (const GValue * value);
    614 extern GClosure * (*perl_closure_new) (SV * callback, SV * data, gboolean swap);
    615 
    616 
    617612#endif /* INC_BARNOWL_OWL_H */
  • owl_perl.h

    r92ffd89 rf271129  
    44#include <stdio.h>
    55
    6 /*
    7  * This macro defines a convenience wrapper around the boilerplate
    8  * of pushing char * arguments on to the stack for perl calling.
    9  *
    10  * Arguments are
    11  * * i     - the counter variable to use, which must be declared prior
    12  *           to calling this macro
    13  * * argc  - the number of arguments
    14  * * argv  - an array of char*s, of length at least argc; the arguments
    15  *           to push on to the stack
    16  */
    17 #define OWL_PERL_PUSH_ARGS(i, argc, argv) { \
    18   for (i = 0; i < argc; i++) { \
    19     XPUSHs(sv_2mortal(owl_new_sv(argv[i]))); \
    20   } \
    21 }
     6#define OWL_PERL_VOID_CALL (void)POPs;
    227
    238/*
    249 * This macro defines a convenience wrapper around the boilerplate of
    25  * the perlcall methods.
     10 * calling a method on a perl object (SV*) from C.
    2611 *
    2712 * Arguments are
    28  * * call       - the line of code to make the perl call
    29  * * args       - a code block responsible for pushing args
    30  * * err        - a string with a %s format specifier to log in case of error
    31  * * fatalp     - if true, perl errors terminate BarnOwl
    32  * * discardret - should be true if no return is expected
    33  *                (if the call is passed the flag G_DISCARD or G_VOID)
    34  * * ret        - a code block executed if the call succeeded
     13 * * obj    - the SV* to call the method on
     14 * * meth   - a char* method name
     15 * * args   - a code block responsible for pushing args (other than the object)
     16 * * err    - a string with a %s format specifier to log in case of error
     17 * * fatalp - if true, perl errors terminate BarnOwl
     18 * * ret    - a code block executed if the call succeeded
    3519 *
    3620 * See also: `perldoc perlcall', `perldoc perlapi'
    3721 */
    38 #define OWL_PERL_CALL(call, args, err, fatalp, discardret, ret) { \
    39   int count; \
    40   dSP; \
    41   \
    42   ENTER; \
    43   SAVETMPS; \
    44   \
    45   PUSHMARK(SP); \
    46   {args} \
    47   PUTBACK; \
    48   \
    49   count = call; \
    50   \
    51   SPAGAIN; \
    52   \
    53   if (!discardret && count != 1) { \
    54     croak("Perl returned wrong count: %d\n", count); \
    55   } \
    56   \
    57   if (SvTRUE(ERRSV)) { \
    58     if (fatalp) { \
    59       fprintf(stderr, err, SvPV_nolen(ERRSV)); \
    60       exit(-1); \
     22#define OWL_PERL_CALL_METHOD(obj, meth, args, err, fatalp, ret) { \
     23    int count; \
     24    dSP; \
     25    ENTER; \
     26    SAVETMPS; \
     27    PUSHMARK(SP); \
     28    XPUSHs(obj); \
     29    {args} \
     30    PUTBACK; \
     31    \
     32    count = call_method(meth, G_SCALAR|G_EVAL); \
     33    \
     34    SPAGAIN; \
     35    \
     36    if(count != 1) { \
     37      fprintf(stderr, "perl returned wrong count: %d\n", count); \
     38      abort();                                                   \
     39    } \
     40    if (SvTRUE(ERRSV)) { \
     41      if(fatalp) { \
     42        printf(err, SvPV_nolen(ERRSV)); \
     43        exit(-1); \
     44      } else { \
     45        owl_function_error(err, SvPV_nolen(ERRSV)); \
     46        (void)POPs; \
     47        sv_setsv(ERRSV, &PL_sv_undef); \
     48      } \
    6149    } else { \
    62       owl_function_error(err, SvPV_nolen(ERRSV)); \
    63       if (!discardret) (void)POPs; \
    64       sv_setsv(ERRSV, &PL_sv_undef); \
     50      ret; \
    6551    } \
    66   } else if (!discardret) { \
    67     ret; \
    68   } \
    69   PUTBACK; \
    70   FREETMPS; \
    71   LEAVE; \
     52    PUTBACK; \
     53    FREETMPS; \
     54    LEAVE; \
    7255}
    7356
  • perl/Makefile.am

    ra870319 r10557e6  
    11SUBDIRS = modules
    2 nobase_dist_pkgdata_DATA = \
    3         lib/BarnOwl.pm \
    4         lib/BarnOwl/Complete/AIM.pm \
    5         lib/BarnOwl/Complete/Client.pm \
    6         lib/BarnOwl/Complete/Filter.pm \
    7         lib/BarnOwl/Complete/Zephyr.pm \
    8         lib/BarnOwl/Completion.pm \
    9         lib/BarnOwl/Completion/Context.pm \
    10         lib/BarnOwl/Completion/Util.pm \
    11         lib/BarnOwl/Editwin.pm \
    12         lib/BarnOwl/Help.pm \
    13         lib/BarnOwl/Hook.pm \
    14         lib/BarnOwl/Hooks.pm \
    15         lib/BarnOwl/MainLoopCompatHook.pm \
    16         lib/BarnOwl/Message.pm \
    17         lib/BarnOwl/Message/AIM.pm \
    18         lib/BarnOwl/Message/Admin.pm \
    19         lib/BarnOwl/Message/Generic.pm \
    20         lib/BarnOwl/Message/Loopback.pm \
    21         lib/BarnOwl/Message/Zephyr.pm \
    22         lib/BarnOwl/ModuleLoader.pm \
    23         lib/BarnOwl/Parse.pm \
    24         lib/BarnOwl/Style.pm \
    25         lib/BarnOwl/Style/Basic.pm \
    26         lib/BarnOwl/Style/Default.pm \
    27         lib/BarnOwl/Style/Legacy.pm \
    28         lib/BarnOwl/Style/OneLine.pm \
    29         lib/BarnOwl/Timer.pm \
    30         lib/BarnOwl/Zephyr.pm \
    31         lib/Module/Install/BarnOwl.pm
  • perl/lib/BarnOwl.pm

    recd4edf ra130fc5  
    55
    66use base qw(Exporter);
    7 our @EXPORT_OK = qw(command getcurmsg getnumcols getnumlines getidletime
    8                     register_idle_watcher unregister_idle_watcher
     7our @EXPORT_OK = qw(command getcurmsg getnumcols getidletime
    98                    zephyr_getsender zephyr_getrealm zephyr_zwrite
    109                    zephyr_stylestrip zephyr_smartstrip_user zephyr_getsubs
    1110                    queue_message admin_message
    12                     start_edit
    1311                    start_question start_password start_edit_win
    1412                    get_data_dir get_config_dir popless_text popless_ztext
    1513                    error debug
    1614                    create_style getnumcolors wordwrap
    17                     message_matches_filter
    1815                    add_dispatch remove_dispatch
    1916                    add_io_dispatch remove_io_dispatch
    2017                    new_command
    2118                    new_variable_int new_variable_bool new_variable_string
    22                     new_variable_enum
    2319                    quote redisplay);
    2420our %EXPORT_TAGS = (all => \@EXPORT_OK);
     
    4743
    4844use List::Util qw(max);
    49 use Tie::RefHash;
    5045
    5146=head1 NAME
     
    9792command line, and C<MESSAGE> is the zephyr body to send.
    9893
    99 =cut
    100 
    101 sub zephyr_zwrite {
    102     my ($command, $message) = @_;
    103     my $ret = BarnOwl::Internal::zephyr_zwrite($command, $message);
    104     die "Error sending zephyr" unless $ret == 0;
    105 }
    106 
    10794=head2 ztext_stylestrip STRING
    10895
     
    118105Enqueue a message in the BarnOwl message list, logging it and
    119106processing it appropriately. C<MESSAGE> should be an instance of
    120 BarnOwl::Message or a subclass.
     107BarnOwl::Message or a subclass.  Returns the queued message.  This
     108is useful for, e.g., deleting a message from the message list.
    121109
    122110=head2 admin_message HEADER BODY
     
    124112Display a BarnOwl B<Admin> message, with the given header and body.
    125113
    126 =head2 start_edit %ARGS
    127 
    128 Displays a prompt on the screen and lets the user enter text,
    129 and calls a callback when the editwin is closed.
    130 
    131 C<%ARGS> must contain the following keys:
    132 
    133 =over 4
    134 
    135 =item prompt
    136 
    137 The line to display on the screen
    138 
    139 =item type
    140 
    141 One of:
    142 
    143 =over 4
    144 
    145 =item edit_win
    146 
    147 Displays the prompt on a line of its own and opens the edit_win.
    148 
    149 =item question
    150 
    151 Displays prompt on the screen and lets the user enter a line of
    152 text.
    153 
    154 =item password
    155 
    156 Like question, but echoes the user's input as C<*>s when they
     114=head2 start_question PROMPT CALLBACK
     115
     116Displays C<PROMPT> on the screen and lets the user enter a line of
     117text, and calls C<CALLBACK>, which must be a perl subroutine
     118reference, with the text the user entered
     119
     120=head2 start_password PROMPT CALLBACK
     121
     122Like C<start_question>, but echoes the user's input as C<*>s when they
    157123input.
    158124
    159 =back
    160 
    161 =item callback
    162 
    163 A Perl subroutine that is called when the user closes the edit_win.
    164 C<CALLBACK> gets called with two parameters: the text the user entered,
    165 and a C<SUCCESS> boolean parameter which is false if the user canceled
    166 the edit_win and true otherwise.
    167 
    168 =back
    169 
    170 =head2 start_question PROMPT CALLBACK
    171 
    172 =head2 start_password PROMPT CALLBACK
    173 
    174125=head2 start_edit_win PROMPT CALLBACK
    175126
    176 Roughly equivalent to C<start_edit> called with the appropriate parameters.
    177 C<CALLBACK> is only called on success, for compatibility.
    178 
    179 These are deprecated wrappers around L<BarnOwl::start_edit>, and should not
    180 be uesd in new code.
    181 
    182 =cut
    183 
    184 sub start_edit {
    185     my %args = (@_);
    186     BarnOwl::Internal::start_edit($args{type}, $args{prompt}, $args{callback});
    187 }
    188 
    189 sub start_question {
    190     my ($prompt, $callback) = @_;
    191     BarnOwl::start_edit(type => 'question', prompt => $prompt, callback => sub {
    192             my ($text, $success) = @_;
    193             $callback->($text) if $success;
    194         });
    195 }
    196 
    197 sub start_password {
    198     my ($prompt, $callback) = @_;
    199     BarnOwl::start_edit(type => 'password', prompt => $prompt, callback => sub {
    200             my ($text, $success) = @_;
    201             $callback->($text) if $success;
    202         });
    203 }
    204 
    205 sub start_edit_win {
    206     my ($prompt, $callback) = @_;
    207     BarnOwl::start_edit(type => 'edit_win', prompt => $prompt, callback => sub {
    208             my ($text, $success) = @_;
    209             $callback->($text) if $success;
    210         });
    211 }
     127Like C<start_question>, but displays C<PROMPT> on a line of its own
     128and opens the editwin. If the user cancels the edit win, C<CALLBACK>
     129is not invoked.
    212130
    213131=head2 get_data_dir
     
    242160
    243161Returns the number of colors this BarnOwl is capable of displaying
    244 
    245 =head2 message_matches_filter MESSAGE FILTER_NAME [QUIET = 0]
    246 
    247 Returns 1 if C<FILTER_NAME> is the name of a valid filter, and
    248 C<MESSAGE> matches that filter.  Returns 0 otherwise.  If
    249 C<QUIET> is false, this method displays an error message if
    250 if C<FILTER_NAME> does not name a valid filter.
    251162
    252163=head2 add_dispatch FD CALLBACK
     
    348259our @all_commands;
    349260
    350 if(!$configfile) {
    351     if (-f get_config_dir() . "/init.pl") {
    352         $configfile = get_config_dir() . "/init.pl";
    353     } elsif (-f $ENV{HOME} . "/.barnowlconf") {
    354         $configfile = $ENV{HOME} . "/.barnowlconf";
    355     } else {
    356         $configfile = $ENV{HOME}."/.owlconf";
    357     }
    358 }
     261if(!$configfile && -f $ENV{HOME} . "/.barnowlconf") {
     262    $configfile = $ENV{HOME} . "/.barnowlconf";
     263}
     264$configfile ||= $ENV{HOME}."/.owlconf";
    359265
    360266# populate global variable space for legacy owlconf files
     
    413319=head2 new_variable_string NAME [{ARGS}]
    414320
    415 =head2 new_variable_enum NAME [{ARGS}]
    416 
    417 Add a new owl variable, either an int, a bool, a string, or an enum with the
     321Add a new owl variable, either an int, a bool, or a string, with the
    418322specified name.
    419323
    420 For new_variable_enum, ARGS is required to contain a validsettings key pointing
    421 to an array reference. For all four, it can optionally contain the following
    422 keys:
     324ARGS can optionally contain the following keys:
    423325
    424326=over 4
     
    438340=back
    439341
    440 In addition, new_variable_string optionally accepts a string validsettings
    441 parameter, in case people want to set it to "<path>".
    442 
    443342=cut
    444343
    445344sub new_variable_int {
    446     my ($name, $args) = @_;
    447     my $storage = defined($args->{default}) ? $args->{default} : 0;
    448     BarnOwl::new_variable_full($name, {
    449             %{$args},
    450             get_tostring => sub { "$storage" },
    451             set_fromstring => sub {
    452                 die "Expected integer" unless $_[0] =~ /^-?[0-9]+$/;
    453                 $storage = 0 + $_[0];
    454             },
    455             validsettings => "<int>",
    456             takes_on_off => 0,
    457         });
     345    unshift @_, \&BarnOwl::Internal::new_variable_int, 0;
     346    goto \&_new_variable;
    458347}
    459348
    460349sub new_variable_bool {
    461     my ($name, $args) = @_;
    462     my $storage = defined($args->{default}) ? $args->{default} : 0;
    463     BarnOwl::new_variable_full($name, {
    464             %{$args},
    465             get_tostring => sub { $storage ? "on" : "off" },
    466             set_fromstring => sub {
    467                 die "Valid settings are on/off" unless $_[0] eq "on" || $_[0] eq "off";
    468                 $storage = $_[0] eq "on";
    469             },
    470             validsettings => "on,off",
    471             takes_on_off => 1,
    472         });
     350    unshift @_, \&BarnOwl::Internal::new_variable_bool, 0;
     351    goto \&_new_variable;
    473352}
    474353
    475354sub new_variable_string {
    476     my ($name, $args) = @_;
    477     my $storage = defined($args->{default}) ? $args->{default} : "";
    478     BarnOwl::new_variable_full($name, {
    479             # Allow people to override this one if they /reaaally/ want to for
    480             # some reason. Though we still reserve the right to interpret this
    481             # value in interesting ways for tab-completion purposes.
    482             validsettings => "<string>",
    483             %{$args},
    484             get_tostring => sub { $storage },
    485             set_fromstring => sub { $storage = $_[0]; },
    486             takes_on_off => 0,
    487         });
    488 }
    489 
    490 sub new_variable_enum {
    491     my ($name, $args) = @_;
    492 
    493     # Gather the valid settings.
    494     die "validsettings is required" unless defined($args->{validsettings});
    495     my %valid;
    496     map { $valid{$_} = 1 } @{$args->{validsettings}};
    497 
    498     my $storage = (defined($args->{default}) ?
    499                    $args->{default} :
    500                    $args->{validsettings}->[0]);
    501     BarnOwl::new_variable_full($name, {
    502             %{$args},
    503             get_tostring => sub { $storage },
    504             set_fromstring => sub {
    505                 die "Invalid input" unless $valid{$_[0]};
    506                 $storage = $_[0];
    507             },
    508             validsettings => join(",", @{$args->{validsettings}})
    509         });
    510 }
    511 
    512 =head2 new_variable_full NAME {ARGS}
    513 
    514 Create a variable, in full generality. The keyword arguments have types below:
    515 
    516  get_tostring : ()  -> string
    517  set_fromstring : string -> int
    518  -- optional --
    519  summary : string
    520  description : string
    521  validsettings : string
    522  takes_on_off : int
    523 
    524 The get/set functions are required. Note that the caller manages storage for the
    525 variable. get_tostring/set_fromstring both convert AND store the value.
    526 set_fromstring dies on failure.
    527 
    528 If the variable takes parameters 'on' and 'off' (i.e. is boolean-looking), set
    529 takes_on_off to 1. This makes :set VAR and :unset VAR work. set_fromstring will
    530 be called with those arguments.
    531 
    532 =cut
    533 
    534 sub new_variable_full {
     355    unshift @_, \&BarnOwl::Internal::new_variable_string, "";
     356    goto \&_new_variable;
     357}
     358
     359sub _new_variable {
     360    my $func = shift;
     361    my $default_default = shift;
    535362    my $name = shift;
    536363    my $args = shift || {};
    537364    my %args = (
    538         summary => "",
     365        summary     => "",
    539366        description => "",
    540         takes_on_off => 0,
    541         validsettings => "<string>",
     367        default     => $default_default,
    542368        %{$args});
    543 
    544     die "get_tostring required" unless $args{get_tostring};
    545     die "set_fromstring required" unless $args{set_fromstring};
    546 
    547     # Strip off the bogus dummy argument. Aargh perl-Glib.
    548     my $get_tostring_fn = sub { $args{get_tostring}->() };
    549     my $set_fromstring_fn = sub {
    550       my ($dummy, $val) = @_;
    551       # Translate from user-supplied die-on-failure callback to expected
    552       # non-zero on error. Less of a nuisance than interacting with ERRSV.
    553       eval { $args{set_fromstring}->($val) };
    554       # TODO: Consider changing B::I::new_variable to expect string|NULL with
    555       # string as the error message. That can then be translated to a GError in
    556       # owl_variable_set_fromstring. For now the string is ignored.
    557       return ($@ ? -1 : 0);
    558     };
    559 
    560     BarnOwl::Internal::new_variable($name, $args{summary}, $args{description}, $args{validsettings},
    561                                     $args{takes_on_off}, $get_tostring_fn, $set_fromstring_fn, undef);
     369    $func->($name, $args{default}, $args{summary}, $args{description});
    562370}
    563371
     
    795603}
    796604
    797 =head3 register_idle_watcher %ARGS
    798 
    799 Call a callback whenever the amount of time the user becomes idle or comes
    800 back from being idle.
    801 
    802 You must include the following parameters:
    803 
    804 =over 4
    805 
    806 =item name
    807 
    808 The name given to the idle watcher
    809 
    810 =item after
    811 
    812 How long the user must be idle, in seconds, before the callback is called.
    813 If the value is too small, you may have spurious or inaccurate calls.
    814 (The current lower limit is about 1 second.)
    815 
    816 =item callback
    817 
    818 The Perl subroutine that gets called when the user has been idle for C<AFTER>
    819 seconds, or comes back from being idle.  The subroutine is passed one parameter,
    820 which is true if the user is currently idle, and false otherwise.
    821 
    822 =back
    823 
    824 This method returns a unique identifier which may be passed to
    825 L<BarnOwl::unregister_idle_watcher>.
    826 
    827 =cut
    828 
    829 =head3 unregister_idle_watcher UNIQUE_ID [...]
    830 
    831 Removed and returns the idle watcher specified by C<UNIQUE_ID>.
    832 You may specify multiple unique ids.
    833 
    834 =cut
    835 
    836 my %idle_watchers;
    837 tie %idle_watchers, 'Tie::RefHash';
    838 
    839 $BarnOwl::Hooks::wakeup->add(sub {
    840         foreach my $idle_watcher (values %idle_watchers) {
    841             _wakeup_idle_watcher($idle_watcher);
    842         }
    843     });
    844 
    845 sub _wakeup_idle_watcher {
    846     my ($idle_watcher, $offset) = @_;
    847     $offset = 0 unless defined $offset;
    848     # go unidle
    849     $idle_watcher->{idle_timer}->stop if $idle_watcher->{idle_timer};
    850     undef $idle_watcher->{idle_timer};
    851     $idle_watcher->{callback}->(0) if $idle_watcher->{is_idle};
    852     $idle_watcher->{is_idle} = 0;
    853 
    854     # queue going idle
    855     $idle_watcher->{idle_timer} = BarnOwl::Timer->new({
    856         name  => $idle_watcher->{name},
    857         after => $idle_watcher->{after} - $offset,
    858         cb    => sub {
    859             $idle_watcher->{is_idle} = 1;
    860             $idle_watcher->{callback}->(1);
    861         }
    862     });
    863 }
    864 
    865 sub register_idle_watcher {
    866     my %args = (@_);
    867     $idle_watchers{\%args} = \%args;
    868     _wakeup_idle_watcher(\%args, BarnOwl::getidletime); # make sure to queue up the idle/unidle events from this idle watcher
    869     return \%args;
    870 }
    871 
    872 sub unregister_idle_watcher {
    873     my ($id) = @_;
    874     $idle_watchers{$id}->{idle_timer}->stop if $idle_watchers{$id}->{idle_timer};
    875     return delete $idle_watchers{$id};
    876 }
    877 
    878605# Stub for owl::startup / BarnOwl::startup, so it isn't bound to the
    879606# startup command. This may be redefined in a user's configfile.
  • perl/lib/BarnOwl/Complete/Client.pm

    r4626016 r58f4fb2  
    2020
    2121my %show = (
     22    information => undef,
    2223    colors      => undef,
    2324    commands    => undef,
     
    204205BarnOwl::Completion::register_completer(set     => \&complete_set);
    205206BarnOwl::Completion::register_completer(unset   => \&complete_set);
    206 BarnOwl::Completion::register_completer(startup   => \&complete_startup);
    207 BarnOwl::Completion::register_completer(unstartup => \&complete_startup);
     207BarnOwl::Completion::register_completer(startup => \&complete_startup);
    208208BarnOwl::Completion::register_completer(bindkey => \&complete_bindkey);
    209209BarnOwl::Completion::register_completer(print   => \&complete_print);
  • perl/lib/BarnOwl/Complete/Zephyr.pm

    re6e7842 r3e8625f  
    6464BarnOwl::Completion::register_completer(viewuser  => \&complete_viewuser);
    6565BarnOwl::Completion::register_completer(vu        => \&complete_viewuser);
    66 BarnOwl::Completion::register_completer(viewperson => \&complete_viewuser);
    67 BarnOwl::Completion::register_completer(vp        => \&complete_viewuser);
    6866
    6967BarnOwl::Completion::register_completer(unsub     => \&complete_unsub);
  • perl/lib/BarnOwl/Hooks.pm

    r120dac7 rb8a3e00  
    3636Called before BarnOwl shutdown
    3737
    38 =item $wakeup
    39 
    40 Called, at most once per second, on user input
    41 
    4238=item $receiveMessage
    4339
     
    6157from every function registered with this hook will be appended and
    6258displayed in a popup window, with zephyr formatting parsed.
    63 
    64 =item $awayOn
    65 
    66 Called, for all protocol handlers, to go away, with the away message,
    67 if any.
    68 
    69 =item $awayOff
    70 
    71 Called, for all protocol handlers, to come back from away.
    72 
    73 =item $getIsAway
    74 
    75 Called to check away status for all protocol handlers.  Protocol
    76 handlers should return a true value if any account of the user is away
    77 for the given protocol, and a false value otherwise.
    7859
    7960=item $getQuickstart
     
    9273
    9374our @EXPORT_OK = qw($startup $shutdown
    94                     $wakeup
    9575                    $receiveMessage $newMessage
    9676                    $mainLoop $getBuddyList
    97                     $awayOn $awayOff $getIsAway
    9877                    $getQuickstart);
    9978
     
    10483our $startup = BarnOwl::Hook->new;
    10584our $shutdown = BarnOwl::Hook->new;
    106 our $wakeup = BarnOwl::Hook->new;
    10785our $receiveMessage = BarnOwl::Hook->new;
    10886our $newMessage = BarnOwl::Hook->new;
     
    11088our $getBuddyList = BarnOwl::Hook->new;
    11189our $getQuickstart = BarnOwl::Hook->new;
    112 our $awayOn = BarnOwl::Hook->new;
    113 our $awayOff = BarnOwl::Hook->new;
    114 our $getIsAway = BarnOwl::Hook->new;
    11590
    11691# Internal startup/shutdown routines called by the C code
     
    200175}
    201176
    202 sub _wakeup {
    203     $wakeup->run;
    204 }
    205 
    206177sub _receive_msg {
    207178    my $m = shift;
     
    228199sub _get_quickstart {
    229200    return join("\n", $getQuickstart->run);
    230 }
    231 
    232 sub _away_on {
    233     $awayOn->run(@_);
    234 }
    235 
    236 sub _away_off {
    237     $awayOff->run();
    238 }
    239 
    240 sub _get_is_away {
    241     my @is_away = grep { $_ } $getIsAway->run();
    242     return scalar @is_away;
    243201}
    244202
  • perl/lib/BarnOwl/Message.pm

    r0adbce1 ra130fc5  
    5151sub is_ping     { return 0; }
    5252sub is_mail     { return 0; }
    53 sub is_personal { return BarnOwl::message_matches_filter(shift, "personal"); }
     53sub is_personal { return shift->is_private; }
    5454sub class       { return undef; }
    5555sub instance    { return undef; }
  • perl/lib/BarnOwl/Message/Zephyr.pm

    r0adbce1 redd0be7  
    5151    my ($m) = @_;
    5252    return undef if (!$m->is_loginout);
    53     return undef if (!defined($m->fields));
    5453    return $m->fields->[2];
    5554}
     
    5857    my ($m) = @_;
    5958    return undef if (!$m->is_loginout);
    60     return undef if (!defined($m->fields));
    6159    return $m->fields->[0];
    6260}
     
    6563
    6664sub is_ping     { return (lc(shift->opcode) eq "ping"); }
     65
     66sub is_personal {
     67    my ($m) = @_;
     68    return ((lc($m->class) eq "message")
     69            && $m->is_private);
     70}
    6771
    6872sub is_mail {
     
    167171        $class = $self->class;
    168172        $instance = $self->instance;
    169         if ($self->recipient eq '' || $self->recipient =~ /^@/) {
     173        if ($self->recipient eq '*' || $self->recipient eq '') {
     174            $to = '';
     175        } elsif ($self->recipient =~ /^@/) {
    170176            $to = $self->recipient;
    171177        } else {
  • perl/lib/BarnOwl/ModuleLoader.pm

    rf34728b rf544216  
    127127}
    128128
    129 sub complete_module_name {
    130     return sort(keys %modules);
    131 }
    132 
    133129sub register_keybindings {
    134130    BarnOwl::new_command('reload-modules', sub {BarnOwl::ModuleLoader->reload}, {
     
    142138                           description => q{Reloads a single module located in ~/.owl/modules or the system modules directory}
    143139                          });
    144 
    145     BarnOwl::Completion::register_completer('reload-module', \&complete_module_name);
    146140}
    147141
  • perl/lib/BarnOwl/Style/Default.pm

    rebc6f77 r5738650  
    113113        }
    114114        $header .= '@b{' . maybe($m->pretty_sender) . '}';
    115         if (defined($m->realm) && $m->realm ne BarnOwl::zephyr_getrealm()) {
    116             $header .= ' {' . $self->humanize($m->realm, 1) . '}';
    117         }
    118115    }
    119116
     
    129126    my $self = shift;
    130127    my $m = shift;
    131     my $sender = $self->humanize($m->long_sender, 1);
     128    my $sender = $m->long_sender;
     129    $sender =~ s/\n.*$//s;
    132130    if (BarnOwl::getvar('colorztext') eq 'on') {
    133131      return "  (" . $sender . '@color[default]' . ")";
  • perl/lib/BarnOwl/Zephyr.pm

    r53151d4 rdf569c5  
    1212use BarnOwl::Hook;
    1313
    14 our $zephyrStartup = BarnOwl::Hook->new;
     14my $zephyrStartup = BarnOwl::Hook->new;
    1515
    1616sub _zephyr_startup {
  • perl/lib/Module/Install/BarnOwl.pm

    re4b8f93 rb8a3e00  
    4141    my $class = ref $self;
    4242
    43     my $srcdir = $ENV{BARNOWL_SRCDIR} || '.';
    44 
    4543    $self->name("BarnOwl-Module-$name");
    46     $self->all_from("$srcdir/lib/BarnOwl/Module/$name.pm");
    47     $self->makemaker_args(PMLIBDIRS => ["$srcdir/lib"],
    48                           PMLIBPARENTDIRS => ["$srcdir/lib"]);
     44    $self->all_from("lib/BarnOwl/Module/$name.pm");
    4945
    5046    $self->postamble(<<"END_MAKEFILE");
    5147
    5248# --- $class section:
    53 
    54 BARNOWL_SRCDIR = $srcdir
    55 export BARNOWL_SRCDIR
    5649
    5750$name.par: pm_to_blib
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r926c721 rb8a3e00  
    2121
    2222use AnyEvent::IRC;
     23use Getopt::Long;
    2324use Encode;
    24 use File::Spec;
    25 use Getopt::Long;
    26 use Text::Wrap;
    2725
    2826our $VERSION = 0.02;
    29 
    30 our $IRC_SUBS_FILENAME = "ircchannels";
    3127
    3228our $irc;
     
    7167       });
    7268
    73     BarnOwl::new_variable_int('irc:max-message-length', {
    74         default     => 450,
    75         summary     => 'Split messages to at most this many characters.' .
    76                        "If non-positive, don't split messages",
    77         description => 'If set to a positive number, any paragraph in an ' .
    78                        'IRC message will be split after this many characters.'
    79        });
    80 
    8169    register_commands();
    8270    BarnOwl::filter(qw{irc type ^IRC$ or ( type ^admin$ and adminheader ^IRC$ )});
     
    141129argument listed above, and die if no channel argument can be found.
    142130
    143 =item C<CHANNEL_OR_USER>
    144 
    145 Pass the channel argument, but accept it if it's a username (e.g.
    146 has no hash).  Only relevant with C<CHANNEL_ARG>.
    147 
    148131=item C<CHANNEL_OPTIONAL>
    149132
     
    162145use constant CHANNEL_ARG        => 1;
    163146use constant CHANNEL_OPTIONAL   => 2;
    164 use constant CHANNEL_OR_USER    => 4;
    165 
    166 use constant ALLOW_DISCONNECTED => 8;
     147
     148use constant ALLOW_DISCONNECTED => 4;
    167149
    168150sub register_commands {
     
    172154            summary => 'Connect to an IRC server',
    173155            usage =>
    174 'irc-connect [-a ALIAS] [-s] [-p PASSWORD] [-n NICK] SERVER [port]',
     156'irc-connect [-a ALIAS ] [-s] [-p PASSWORD] [-n NICK] SERVER [port]',
    175157            description => <<END_DESCR
    176158Connect to an IRC server. Supported options are:
     
    206188
    207189    BarnOwl::new_command(
    208         'irc-msg' => mk_irc_command( \&cmd_msg, CHANNEL_OR_USER|CHANNEL_ARG|CHANNEL_OPTIONAL ),
     190        'irc-msg' => mk_irc_command( \&cmd_msg ),
    209191        {
    210192            summary => 'Send an IRC message',
     
    233215        {
    234216            summary => 'Join an IRC channel',
    235             usage   => 'irc-join [-a ALIAS] [-t] #channel [KEY]',
    236 
    237             description => <<END_DESCR
    238 Join an IRC channel.  If the -t option is present the subscription will only be
    239 temporary, i.e., it will not be written to the subscription file and will
    240 therefore not be present the next time BarnOwl is started, and will disappear
    241 if the connection is lost.
     217            usage   => 'irc-join [-a ALIAS] #channel [KEY]',
     218
     219            description => <<END_DESCR
     220Join an IRC channel.
    242221END_DESCR
    243222        }
     
    248227        {
    249228            summary => 'Leave an IRC channel',
    250             usage   => 'irc-part [-a ALIAS] [-t] #channel',
    251 
    252             description => <<END_DESCR
    253 Part from an IRC channel.  If the -t option is present the unsubscription will
    254 only be temporary, i.e., it will not be updated in the subscription file and
    255 will therefore not be in effect the next time BarnOwl is started, or if the
    256 connection is lost.
     229            usage   => 'irc-part [-a ALIAS] #channel',
     230
     231            description => <<END_DESCR
     232Part from an IRC channel.
    257233END_DESCR
    258234        }
     
    351327This can be used to perform some operation not yet supported by
    352328BarnOwl, or to define new IRC commands.
    353 END_DESCR
    354         }
    355     );
    356 
    357     BarnOwl::new_command(
    358         'irc-loadchannels' => \&cmd_loadchannels,
    359         {
    360             summary => 'Reload persistent channels',
    361             usage   => 'irc-loadchannels [-a ALIAS] [<file>]',
    362 
    363             description => <<END_DESCR
    364 Load persistent channels from a file.  The file defaults to
    365 \$HOME/.owl/$IRC_SUBS_FILENAME.  If the ALIAS is present, only channels
    366 on the given alias are loaded.  The ALIAS is case-sensitive.
    367 
    368 Each line of the file should describe a single channel, in the format
    369 '\$alias \$channel' (without quotes).
    370329END_DESCR
    371330        }
     
    382341######################## Owl command handlers ##################################
    383342################################################################################
    384 
    385 sub make_autoconnect_filename {
    386     # can't use ||, or else we'll treat '0' as invalid.  We could check for eq "" ...
    387     # TODO(jgross): When we move to requiring perl 5.10, combine the
    388     # following two lines using //
    389     my $filename = shift;
    390     $filename = File::Spec->catfile(BarnOwl::get_config_dir(), $IRC_SUBS_FILENAME) unless defined $filename;
    391     if (!File::Spec->file_name_is_absolute($filename)) {
    392         $filename = File::Spec->catfile($ENV{HOME}, $filename);
    393     }
    394     return $filename;
    395 }
    396 
    397 sub _get_autoconnect_lines {
    398     my $filename = shift;
    399 
    400     # TODO(jgross): Write a C-side function to do this, asynchronously;
    401     #               AIUI, perl doesn't do asynchronous I/O in any useful way
    402     if (open (my $subsfile, "<:encoding(UTF-8)", $filename)) {
    403         my @lines = <$subsfile>;
    404         close($subsfile);
    405 
    406         # strip trailing newlines
    407         local $/ = "";
    408         chomp(@lines);
    409 
    410         return @lines;
    411     }
    412 
    413     return ();
    414 }
    415 
    416 sub get_autoconnect_channels {
    417     my $filename = make_autoconnect_filename(shift);
    418     my %channel_hash = ();
    419 
    420     # Load the subs from the file
    421     my @lines = _get_autoconnect_lines($filename);
    422 
    423     foreach my $line (@lines) {
    424         my @parsed_args = split(' ', $line);
    425         if (scalar @parsed_args == 2) {
    426             push @{$channel_hash{$parsed_args[0]}}, $parsed_args[1];
    427         } else {
    428             warn "Trouble parsing irc configuration file '$filename' line '$line'; the format is '\$alias \$channel', with no spaces in either\n";
    429         }
    430     }
    431 
    432     return %channel_hash;
    433 }
    434 
    435 sub add_autoconnect_channel {
    436     my $conn = shift;
    437     my $channel = shift;
    438     my $alias = $conn->alias;
    439     my $filename = make_autoconnect_filename(shift);
    440 
    441     # we already checked for spaces in $channel in cmd_join, but we still need
    442     # to check $alias
    443     die "Alias name '$alias' contains a space; parsing will fail.  Use the -t flag.\n" unless index($alias, " ") == -1;
    444 
    445     my $line = "$alias $channel";
    446 
    447     my @lines = _get_autoconnect_lines($filename);
    448 
    449     # We don't want to be noisy about duplicated joins.  For example, some
    450     # people might have :irc-join in startup files, even though that doesn't
    451     # work correctly anymore because connect is asynchronous and so join on
    452     # startup races with connect.  Regardless, just fail silently if the line
    453     # already exists.
    454     return if grep { $_ eq $line } @lines;
    455 
    456     open (my $subsfile, ">>:encoding(UTF-8)", make_autoconnect_filename($filename))
    457         or die "Cannot open $filename for writing: $!\n";
    458     local $, = "";
    459     local $/ = "";
    460     print $subsfile "$line\n";
    461     close($subsfile);
    462 }
    463 
    464 sub remove_autoconnect_channel {
    465     my $conn = shift;
    466     my $channel = shift;
    467     my $alias = $conn->alias;
    468     my $filename = make_autoconnect_filename(shift);
    469 
    470     BarnOwl::Internal::file_deleteline($filename, "$alias $channel", 1);
    471 }
    472 
    473 sub cmd_loadchannels {
    474     my $cmd = shift;
    475     my $alias;
    476     my $getopt = Getopt::Long::Parser->new;
    477 
    478     local @ARGV = @_;
    479     $getopt->configure(qw(pass_through permute no_getopt_compat prefix_pattern=-|--));
    480     $getopt->getoptions("alias=s" => \$alias);
    481 
    482     my %channel_hash = get_autoconnect_channels(@ARGV);
    483 
    484     my $aliases = (defined $alias) ? [$alias] : [keys %channel_hash];
    485 
    486     foreach my $cur_alias (@$aliases) {
    487         # get_connection_by_alias might die, and we don't want to
    488         eval {
    489             my $conn = get_connection_by_alias($cur_alias, 1);
    490             my %existing_channels = map { $_ => 1 } @{$conn->autoconnect_channels}, @{$channel_hash{$cur_alias}};
    491             $conn->autoconnect_channels([keys %existing_channels]);
    492         };
    493         foreach my $channel (@{$channel_hash{$cur_alias}}) {
    494             if ($cur_alias eq "") {
    495                 BarnOwl::command("irc-join", "-t", $channel);
    496             } else {
    497                 BarnOwl::command("irc-join", "-t", "-a", $cur_alias, $channel);
    498             }
    499         }
    500     }
    501 }
    502343
    503344sub cmd_connect {
     
    537378    }
    538379
    539     my %channel_hash = get_autoconnect_channels;
    540 
    541380    my $conn = BarnOwl::Module::IRC::Connection->new($alias, $host, $port, {
    542         nick                 => $nick,
    543         user                 => $username,
    544         real                 => $ircname,
    545         password             => $password,
    546         SSL                  => $ssl,
    547         timeout              => sub {0},
    548         autoconnect_channels => $channel_hash{$alias}
     381        nick      => $nick,
     382        user      => $username,
     383        real      => $ircname,
     384        password  => $password,
     385        SSL       => $ssl,
     386        timeout   => sub {0}
    549387       });
    550388    $ircnets{$alias} = $conn;
     
    589427    @msgs = split "\n\n", $fullbody;
    590428    map { tr/\n/ / } @msgs;
    591     # split each body at irc:max-message-length characters, if that number
    592     # is positive.  Only split at space boundaries.  Start counting a-fresh
    593     # at the beginning of each paragraph
    594     my $max_len = BarnOwl::getvar('irc:max-message-length');
    595     if ($max_len > 0) {
    596         local($Text::Wrap::columns) = $max_len;
    597         @msgs = split "\n", wrap("", "", join "\n", @msgs);
    598     }
    599429    for my $body (@msgs) {
    600430        if ($body =~ /^\/me (.*)/) {
     
    633463sub cmd_join {
    634464    my $cmd = shift;
    635     my $is_temporary;
    636 
    637     my $getopt = Getopt::Long::Parser->new;
    638 
    639     local @ARGV = @_;
    640     $getopt->configure(qw(pass_through permute no_getopt_compat prefix_pattern=-|--));
    641     $getopt->getoptions("temporary" => \$is_temporary);
    642 
    643     my $conn = shift @ARGV;
    644     my $chan = shift @ARGV or die("Usage: $cmd channel\n");
    645 
    646     die "Channel name '$chan' contains a space.  As per RFC 2812, IRC channel names may not contain spaces.\n" unless index($chan, " ") == -1;
    647 
    648     $conn->conn->send_msg(join => $chan, @ARGV);
    649 
    650     # regardless of whether or not this is temporary, we want to persist it
    651     # across reconnects.
    652 
    653     # check if the channel is already in the list
    654     if (!grep { $_ eq $chan } @{$conn->autoconnect_channels}) {
    655         push @{$conn->autoconnect_channels}, $chan;
    656     }
    657 
    658     if (!$is_temporary) {
    659         # add the line to the subs file
    660         add_autoconnect_channel($conn, $chan);
    661     }
    662 
     465    my $conn = shift;
     466    my $chan = shift or die("Usage: $cmd channel\n");
     467    $conn->conn->send_msg(join => $chan, @_);
    663468    return;
    664469}
     
    666471sub cmd_part {
    667472    my $cmd = shift;
    668     my $is_temporary;
    669 
    670     my $getopt = Getopt::Long::Parser->new;
    671 
    672     local @ARGV = @_;
    673     $getopt->configure(qw(pass_through permute no_getopt_compat prefix_pattern=-|--));
    674     $getopt->getoptions("temporary" => \$is_temporary);
    675 
    676     my $conn = shift @ARGV;
    677     my $chan = shift @ARGV or die("Usage: $cmd channel\n");
    678 
     473    my $conn = shift;
     474    my $chan = shift;
    679475    $conn->conn->send_msg(part => $chan);
    680 
    681     # regardless of whether or not this is temporary, we want to persist it
    682     # across reconnects
    683     my %existing_channels = map { $_ => 1 } @{$conn->autoconnect_channels};
    684     delete $existing_channels{$chan};
    685     $conn->autoconnect_channels([keys %existing_channels]);
    686 
    687     if (!$is_temporary) {
    688         # remove the line from the subs file
    689         remove_autoconnect_channel($conn, $chan);
    690     }
    691 
    692476    return;
    693477}
     
    789573        my $alias;
    790574        my $channel;
    791         my $is_temporary;
    792575        my $getopt = Getopt::Long::Parser->new;
    793576        my $m = BarnOwl::getcurmsg();
     
    795578        local @ARGV = @_;
    796579        $getopt->configure(qw(pass_through permute no_getopt_compat prefix_pattern=-|--));
    797         $getopt->getoptions("alias=s" => \$alias,
    798                             "temporary" => \$is_temporary);
     580        $getopt->getoptions("alias=s" => \$alias);
    799581
    800582        if(defined($alias)) {
     
    809591                    $conn ||= $c;
    810592                }
    811             } elsif (defined($channel) && ($flags & CHANNEL_OR_USER)) {
    812                 shift @ARGV;
    813593            } elsif ($m && $m->type eq 'IRC' && !$m->is_private) {
    814594                $channel = $m->channel;
     
    818598        }
    819599
    820         if(!defined($channel) &&
     600        if(!$channel &&
    821601           ($flags & CHANNEL_ARG) &&
    822602           !($flags & CHANNEL_OPTIONAL)) {
     
    835615            die("You must specify an IRC network using -a.\n");
    836616        }
    837         push @ARGV, "-t" if $is_temporary;
    838617        if($flags & CHANNEL_ARG) {
    839618            $sub->($cmd, $conn, $channel, @ARGV);
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Completion.pm

    r76e80de rdace02a  
    5757}
    5858
    59 sub complete_irc_join_part {
    60     my $ctx = shift;
    61     return complete_flags($ctx,
    62         [qw(-t)],
    63         {
    64             "-a" => \&complete_networks,
    65         },
    66         \&complete_channels
    67        );
    68 }
    69 
    7059sub complete_irc_channel {
    7160    my $ctx = shift;
     
    10695BarnOwl::Completion::register_completer('irc-msg'        => \&complete_irc_dest);
    10796BarnOwl::Completion::register_completer('irc-mode'       => \&complete_irc_dest);
    108 BarnOwl::Completion::register_completer('irc-join'       => \&complete_irc_join_part);
    109 BarnOwl::Completion::register_completer('irc-part'       => \&complete_irc_join_part);
     97BarnOwl::Completion::register_completer('irc-join'       => \&complete_irc_channel);
     98BarnOwl::Completion::register_completer('irc-part'       => \&complete_irc_channel);
    11099BarnOwl::Completion::register_completer('irc-names'      => \&complete_irc_channel);
    111100BarnOwl::Completion::register_completer('irc-whois'      => \&complete_irc_nick);
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    rbe43554 r13ee8f2  
    3939    my $self = bless({}, $class);
    4040    $self->conn($conn);
    41     # TODO(jgross): use // when we move to requiring perl 5.10
    42     $self->autoconnect_channels(defined $args->{autoconnect_channels} ? $args->{autoconnect_channels} : []);
     41    $self->autoconnect_channels([]);
    4342    $self->alias($alias);
    4443    $self->server($host);
     
    413412        $self->{reconnect_timer}->stop;
    414413    }
    415     $self->{reconnect_timer} =
     414    $self->{reconnect_timer} = 
    416415        BarnOwl::Timer->new( {
    417416            name  => 'IRC (' . $self->alias . ') reconnect_timer',
     
    446445            $self->conn->send_msg(join => $c);
    447446        }
     447        $self->autoconnect_channels([]);
    448448    }
    449449    $self->conn->enable_ping(60, sub {
     
    458458    my $backoff = $self->backoff;
    459459
     460    $self->autoconnect_channels([keys(%{$self->{channel_list}})]);
    460461    $self->conn->connect(@{$self->connect_args});
    461462}
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    r41064be rb8a3e00  
    320320              . "configure [<muc>]\n"
    321321              . "            Configures a MUC.\n"
    322               . "            Necessary to initialize a new MUC.\n"
     322              . "            Necessary to initalize a new MUC.\n"
    323323              . "            At present, only the default configuration is supported.\n"
    324324              . "            The MUC is taken from the current message if not supplied.\n\n"
     
    13131313    {
    13141314        my @answer = $packet->answer;
    1315         return $answer[0]->target, $answer[0]->port if @answer;
     1315        return $answer[0]{target}, $answer[0]{port};
    13161316    }
    13171317
     
    14821482}
    14831483
    1484 sub complete_jabberlogout {
    1485     my $ctx = shift;
    1486     if($ctx->word == 1) {
    1487         return ("-A", complete_account() );
    1488     } else {
    1489         return ();
    1490     }
    1491 }
    1492 
    14931484BarnOwl::Completion::register_completer(jwrite => sub { BarnOwl::Module::Jabber::complete_jwrite(@_) });
    1494 BarnOwl::Completion::register_completer(jabberlogout => sub { BarnOwl::Module::Jabber::complete_jabberlogout(@_) });
    14951485
    149614861;
  • perl/modules/Jabber/lib/Net/Jabber/Component.pm

    ra8c55b5 rc2bed55  
    220220    $self->{STREAM}->SetCallBacks(node=>undef);
    221221
    222     $self->Send("<handshake>".Digest::SHA::sha1_hex($self->{SESSION}->{id}.$args{secret})."</handshake>");
     222    $self->Send("<handshake>".Digest::SHA1::sha1_hex($self->{SESSION}->{id}.$args{secret})."</handshake>");
    223223    my $handshake = $self->Process();
    224224
  • perl/modules/Jabber/lib/Net/Jabber/Key.pm

    ra8c55b5 rc2bed55  
    104104    $self->{CACHE} = {};
    105105
    106     if (eval "require Digest::SHA")
     106    if (eval "require Digest::SHA1")
    107107    {
    108108        $self->{DIGEST} = 1;
    109         Digest::SHA->import(qw(sha1 sha1_hex sha1_base64));
     109        Digest::SHA1->import(qw(sha1 sha1_hex sha1_base64));
    110110    }
    111111    else
    112112    {
    113         print "ERROR:  You cannot use Key.pm unless you have Digest::SHA installed.\n";
     113        print "ERROR:  You cannot use Key.pm unless you have Digest::SHA1 installed.\n";
    114114        exit(0);
    115115    }
     
    132132
    133133    my $string = $$.time.rand(1000000);
    134     $string = Digest::SHA::sha1_hex($string);
     134    $string = Digest::SHA1::sha1_hex($string);
    135135    $self->{DEBUG}->Log1("Generate: key($string)");
    136136    return $string;
  • perl/modules/Jabber/lib/Net/XMPP.pm

    ra8c55b5 rc2bed55  
    213213use Time::Local;
    214214use Carp;
    215 use Digest::SHA;
     215use Digest::SHA1;
    216216use Authen::SASL;
    217217use MIME::Base64;
  • perl/modules/Jabber/lib/Net/XMPP/Protocol.pm

    ra8c55b5 r7f33c18  
    18491849    if ($authType eq "zerok")
    18501850    {
    1851         my $hashA = Digest::SHA::sha1_hex($password);
    1852         $args{hash} = Digest::SHA::sha1_hex($hashA.$token);
     1851        my $hashA = Digest::SHA1::sha1_hex($password);
     1852        $args{hash} = Digest::SHA1::sha1_hex($hashA.$token);
    18531853
    18541854        for (1..$sequence)
    18551855        {
    1856             $args{hash} = Digest::SHA::sha1_hex($args{hash});
     1856            $args{hash} = Digest::SHA1::sha1_hex($args{hash});
    18571857        }
    18581858    }
     
    18681868    if ($authType eq "digest")
    18691869    {
    1870         $args{digest} = Digest::SHA::sha1_hex($self->GetStreamID().$password);
     1870        $args{digest} = Digest::SHA1::sha1_hex($self->GetStreamID().$password);
    18711871    }
    18721872
  • perl/modules/Makefile.am

    re4b8f93 r1fd469d4  
    1 MODULES = Jabber IRC WordWrap Twitter Facebook
     1MODULES = Jabber IRC WordWrap Twitter
    22
    3 EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/lib)
    4 EXTRA_DIST += \
    5     Facebook/README \
    6     Twitter/README \
    7     Twitter/twitter.example
     3EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/inc) $(MODULES:=/lib)
    84
    95all-local: $(MODULES)
     
    117        (cd $* && $(MAKE) $*.par)
    128
    13 BARNOWL_PERL := $(shell which perl) -I$(abs_srcdir)/../lib
    14 
    159MODULES_MAKEFILE = $(MODULES:=/Makefile)
    16 $(MODULES_MAKEFILE): %/Makefile: %/Makefile.PL ../lib/Module/Install/BarnOwl.pm
    17         $(AM_V_GEN)test -d $* || mkdir $*
    18         $(AM_V_at)test $(srcdir) = . || $(LN_S) $(abs_srcdir)/$*/Makefile.PL $*/Makefile.PL
    19         $(AM_V_at)(cd $* && BARNOWL_SRCDIR='$(abs_srcdir)/$*' && export BARNOWL_SRCDIR && $(BARNOWL_PERL) Makefile.PL 'PERL=$(BARNOWL_PERL)')
     10$(MODULES_MAKEFILE): %/Makefile: %/Makefile.PL
     11        $(AM_V_GEN)(cd $* && perl -I../../lib Makefile.PL)
    2012
    2113MODULES_CLEAN = $(MODULES:%=clean_%)
    2214clean-local: $(MODULES_CLEAN)
    2315$(MODULES_CLEAN): clean_%:
    24         (cd $* && { test ! -f Makefile || $(MAKE) realclean; })
    25         rm -f $*/$*.par
    26         rm -rf $*/inc
    27         test $(srcdir) = . || rm -f $*/Makefile.PL
     16        (cd $* && (test ! -f Makefile || $(MAKE) clean))
    2817
    2918MODULES_INSTALL = $(MODULES:%=module_install_%)
     
    3423        ${INSTALL_DATA} $*/$*.par ${DESTDIR}${pkgdatadir}/modules/$*.par
    3524
    36 uninstall-local:
    37         rm -f $(MODULES:%=${DESTDIR}${pkgdatadir}/modules/%.par)
    38 
    3925.PHONY: $(MODULES) $(MODULES_CLEAN) $(MODULES_INSTALL)
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm

    r140429f rb8a3e00  
    137137        my $twitter_args = { username   => $cfg->{user},
    138138                             password   => $cfg->{password},
    139                              source     => 'barnowl',
    140                              ssl        => 1,
    141                              legacy_lists_api => 0,
     139                             source     => 'barnowl',
    142140                         };
    143141        if (defined $cfg->{service}) {
     
    276274);
    277275
    278 BarnOwl::new_command( 'twitter-favorite' => sub { cmd_twitter_favorite(@_) },
    279     {
    280     summary     => 'Favorite the current Twitter message',
    281     usage       => 'twitter-favorite [ACCOUNT]',
    282     description => <<END_DESCRIPTION
    283 Favorite the current Twitter message using ACCOUNT (defaults to the
    284 account that received the tweet).
    285 END_DESCRIPTION
    286     }
    287 );
    288 
    289276BarnOwl::new_command( 'twitter-follow' => sub { cmd_twitter_follow(@_); },
    290277    {
     
    368355    $account = $m->account unless defined($account);
    369356    find_account($account)->twitter_retweet($m);
    370     return;
    371 }
    372 
    373 sub cmd_twitter_favorite {
    374     my $cmd = shift;
    375     my $account = shift;
    376     my $m = BarnOwl::getcurmsg();
    377     if(!$m || $m->type ne 'Twitter') {
    378         die("$cmd must be used with a Twitter message selected.\n");
    379     }
    380 
    381     $account = $m->account unless defined($account);
    382     find_account($account)->twitter_favorite($m);
    383357    return;
    384358}
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm

    r140429f r4ebbfbc  
    371371        $self->twitter_direct($1, $2);
    372372    } elsif(defined $self->{twitter}) {
     373        if(length($msg) > 140) {
     374            die("Twitter: Message over 140 characters long.\n");
     375        }
    373376        $self->twitter_command('update', {
    374377            status => $msg,
     
    429432}
    430433
    431 sub twitter_favorite {
    432     my $self = shift;
    433     my $msg = shift;
    434 
    435     if($msg->service ne $self->{cfg}->{service}) {
    436         die("Cannot favorite a message from a different service.\n");
    437     }
    438     $self->twitter_command(create_favorite => $msg->{status_id});
    439 }
    440 
    441 
    442434sub twitter_follow {
    443435    my $self = shift;
  • perlconfig.c

    r7dcef03 rb9517cf  
    7575  const char *type;
    7676  char *ptr, *utype, *blessas;
    77   const char *f;
    78   int i;
     77  int i, j;
    7978  const owl_pair *pair;
    8079  const owl_filter *wrap;
     
    9291                                      owl_new_sv(owl_message_get_##field(m)), 0)
    9392
    94   if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
     93  if (owl_message_get_notice(m)) {
    9594    /* Handle zephyr-specific fields... */
    96     AV *av_zfields = newAV();
    97     if (owl_message_get_notice(m)) {
    98       for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
    99            f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
    100         ptr = owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
    101         av_push(av_zfields, owl_new_sv(ptr));
    102         g_free(ptr);
    103       }
    104       (void)hv_store(h, "auth", strlen("auth"),
    105                      owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))), 0);
    106     } else {
    107       /* Incoming zephyrs without a ZNotice_t are pseudo-logins. To appease
    108        * existing styles, put in bogus 'auth' and 'fields' keys. */
    109       (void)hv_store(h, "auth", strlen("auth"), owl_new_sv("NO"), 0);
     95    AV *av_zfields;
     96
     97    av_zfields = newAV();
     98    j=owl_zephyr_get_num_fields(owl_message_get_notice(m));
     99    for (i=0; i<j; i++) {
     100      ptr=owl_zephyr_get_field_as_utf8(owl_message_get_notice(m), i+1);
     101      av_push(av_zfields, owl_new_sv(ptr));
     102      g_free(ptr);
    110103    }
    111104    (void)hv_store(h, "fields", strlen("fields"), newRV_noinc((SV*)av_zfields), 0);
     105
     106    (void)hv_store(h, "auth", strlen("auth"),
     107                   owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))),0);
    112108  }
    113109
     
    188184  hash = (HV*)SvRV(msg);
    189185
    190   m = g_slice_new(owl_message);
     186  m = g_new(owl_message, 1);
    191187  owl_message_init(m);
    192188
     
    228224CALLER_OWN char *owl_perlconfig_call_with_message(const char *subname, const owl_message *m)
    229225{
    230   SV *msgref, *rv;
    231   char *out = NULL;
    232 
     226  dSP ;
     227  int count;
     228  SV *msgref, *srv;
     229  char *out;
     230 
     231  ENTER ;
     232  SAVETMPS;
     233 
     234  PUSHMARK(SP) ;
    233235  msgref = owl_perlconfig_message2hashref(m);
    234 
    235   OWL_PERL_CALL((call_pv(subname, G_SCALAR|G_EVAL))
    236                 ,
    237                 XPUSHs(sv_2mortal(msgref));
    238                 ,
    239                 "Perl Error: '%s'"
    240                 ,
    241                 false
    242                 ,
    243                 false
    244                 ,
    245                 rv = POPs;
    246                 if (rv && SvPOK(rv))
    247                   out = g_strdup(SvPV_nolen(rv));
    248                 );
     236  XPUSHs(sv_2mortal(msgref));
     237  PUTBACK ;
     238 
     239  count = call_pv(subname, G_SCALAR|G_EVAL);
     240 
     241  SPAGAIN ;
     242
     243  if (SvTRUE(ERRSV)) {
     244    owl_function_error("Perl Error: '%s'", SvPV_nolen(ERRSV));
     245    /* and clear the error */
     246    sv_setsv (ERRSV, &PL_sv_undef);
     247  }
     248
     249  if (count != 1) {
     250    fprintf(stderr, "bad perl!  no biscuit!  returned wrong count!\n");
     251    abort();
     252  }
     253
     254  srv = POPs;
     255
     256  if (srv) {
     257    out = g_strdup(SvPV_nolen(srv));
     258  } else {
     259    out = NULL;
     260  }
     261 
     262  PUTBACK ;
     263  FREETMPS ;
     264  LEAVE ;
     265
    249266  return out;
    250267}
     
    256273CALLER_OWN char *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv)
    257274{
    258   SV *msgref, *rv;
    259   char *out = NULL;
    260   int i;
     275  dSP;
     276  unsigned int count, i;
     277  SV *msgref, *srv;
     278  char *out;
    261279
    262280  msgref = owl_perlconfig_message2hashref(m);
    263281
    264   OWL_PERL_CALL(call_method(method, G_SCALAR|G_EVAL)
    265                 ,
    266                 XPUSHs(sv_2mortal(msgref));
    267                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    268                 ,
    269                 "Perl Error: '%s'"
    270                 ,
    271                 false
    272                 ,
    273                 false
    274                 ,
    275                 rv = POPs;
    276                 if (rv && SvPOK(rv))
    277                   out = g_strdup(SvPV_nolen(rv));
    278                 );
     282  ENTER;
     283  SAVETMPS;
     284
     285  PUSHMARK(SP);
     286  XPUSHs(sv_2mortal(msgref));
     287  for(i=0;i<argc;i++) {
     288    XPUSHs(sv_2mortal(owl_new_sv(argv[i])));
     289  }
     290  PUTBACK;
     291
     292  count = call_method(method, G_SCALAR|G_EVAL);
     293
     294  SPAGAIN;
     295
     296  if(count != 1) {
     297    fprintf(stderr, "perl returned wrong count %u\n", count);
     298    abort();
     299  }
     300
     301  if (SvTRUE(ERRSV)) {
     302    owl_function_error("Error: '%s'", SvPV_nolen(ERRSV));
     303    /* and clear the error */
     304    sv_setsv (ERRSV, &PL_sv_undef);
     305  }
     306
     307  srv = POPs;
     308
     309  if (srv) {
     310    out = g_strdup(SvPV_nolen(srv));
     311  } else {
     312    out = NULL;
     313  }
     314
     315  PUTBACK;
     316  FREETMPS;
     317  LEAVE;
     318
    279319  return out;
    280320}
     
    287327  char *err;
    288328  const char *args[4] = {"", "-e", "0;", NULL};
    289   const char *dlerr;
    290329  AV *inc;
    291330  char *path;
     
    336375  }
    337376
    338   sv_setpv(get_sv("BarnOwl::VERSION", TRUE), version);
     377  sv_setpv(get_sv("BarnOwl::VERSION", TRUE), OWL_VERSION_STRING);
    339378
    340379  /* Add the system lib path to @INC */
     
    345384  g_free(path);
    346385
    347   /* Load up perl-Glib. */
    348   eval_pv("use Glib;", FALSE);
    349 
    350   /* Now, before BarnOwl tries to use them, get the relevant function pointers out. */
    351   dlerr = owl_closure_init();
    352   if (dlerr) {
    353     return g_strdup(dlerr);
    354   }
    355 
    356   /* And now it's safe to import BarnOwl. */
    357386  eval_pv("use BarnOwl;", FALSE);
    358387
     
    426455void owl_perlconfig_new_command(const char *name)
    427456{
    428   OWL_PERL_CALL(call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL);
    429                 ,
    430                 XPUSHs(sv_2mortal(owl_new_sv(name)));
    431                 ,
    432                 "Perl Error: '%s'"
    433                 ,
    434                 false
    435                 ,
    436                 true
    437                 ,
    438                 );
    439 }
    440 
    441 CALLER_OWN char *owl_perlconfig_perl_call(const char *method, int argc, const char *const *argv)
    442 {
    443   SV *rv;
    444   char *out = NULL;
    445   int i;
    446   OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL)
    447                 ,
    448                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    449                 ,
    450                 "Perl Error: '%s'"
    451                 ,
    452                 false
    453                 ,
    454                 false
    455                 ,
    456                 rv = POPs;
    457                 if (rv && SvPOK(rv))
    458                   out = g_strdup(SvPV_nolen(rv));
    459                 );
    460   return out;
    461 }
    462 
    463 int owl_perlconfig_perl_call_int(const char *method, int argc, const char *const *argv)
    464 {
    465   SV *rv;
    466   int ret = -1;
    467   int i;
    468   OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL)
    469                 ,
    470                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    471                 ,
    472                 "Perl Error: '%s'"
    473                 ,
    474                 false
    475                 ,
    476                 false
    477                 ,
    478                 rv = POPs;
    479                 if (rv && SvIOK(rv))
    480                   ret = SvIV(rv);
    481                 );
    482   return ret;
    483 }
    484 
    485 bool owl_perlconfig_perl_call_bool(const char *method, int argc, const char *const *argv)
    486 {
    487   SV *rv;
    488   bool ret = false;
    489   int i;
    490   OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL)
    491                 ,
    492                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    493                 ,
    494                 "Perl Error: '%s'"
    495                 ,
    496                 false
    497                 ,
    498                 false
    499                 ,
    500                 rv = POPs;
    501                 if (rv)
    502                   ret = SvTRUE(rv);
    503                 );
    504   return ret;
    505 }
    506 
    507 void owl_perlconfig_perl_call_norv(const char *method, int argc, const char *const *argv)
    508 {
    509   int i;
    510   OWL_PERL_CALL(call_pv(method, G_DISCARD|G_EVAL)
    511                 ,
    512                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    513                 ,
    514                 "Perl Error: '%s'"
    515                 ,
    516                 false
    517                 ,
    518                 true
    519                 ,
    520                 );
     457  dSP;
     458
     459  ENTER;
     460  SAVETMPS;
     461
     462  PUSHMARK(SP);
     463  XPUSHs(sv_2mortal(owl_new_sv(name)));
     464  PUTBACK;
     465
     466  call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL);
     467
     468  SPAGAIN;
     469
     470  if(SvTRUE(ERRSV)) {
     471    owl_function_error("%s", SvPV_nolen(ERRSV));
     472  }
     473
     474  FREETMPS;
     475  LEAVE;
    521476}
    522477
     
    524479CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv)
    525480{
    526   int i;
    527   SV* rv;
    528   char *out = NULL;
    529 
    530   OWL_PERL_CALL(call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL)
    531                 ,
    532                 OWL_PERL_PUSH_ARGS(i, argc, argv);
    533                 ,
    534                 "Perl Error: '%s'"
    535                 ,
    536                 false
    537                 ,
    538                 false
    539                 ,
    540                 rv = POPs;
    541                 if (rv && SvPOK(rv))
    542                   out = g_strdup(SvPV_nolen(rv));
    543                 );
    544   return out;
     481  int i, count;
     482  char * ret = NULL;
     483  SV *rv;
     484  dSP;
     485
     486  ENTER;
     487  SAVETMPS;
     488
     489  PUSHMARK(SP);
     490  for(i=0;i<argc;i++) {
     491    XPUSHs(sv_2mortal(owl_new_sv(argv[i])));
     492  }
     493  PUTBACK;
     494
     495  count = call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL);
     496
     497  SPAGAIN;
     498
     499  if(SvTRUE(ERRSV)) {
     500    owl_function_error("%s", SvPV_nolen(ERRSV));
     501    (void)POPs;
     502  } else {
     503    if(count != 1)
     504      croak("Perl command %s returned more than one value!", cmd->name);
     505    rv = POPs;
     506    if(SvTRUE(rv)) {
     507      ret = g_strdup(SvPV_nolen(rv));
     508    }
     509  }
     510
     511  FREETMPS;
     512  LEAVE;
     513
     514  return ret;
    545515}
    546516
     
    550520}
    551521
    552 void owl_perlconfig_edit_callback(owl_editwin *e, bool success)
     522void owl_perlconfig_edit_callback(owl_editwin *e)
    553523{
    554524  SV *cb = owl_editwin_get_cbdata(e);
    555   SV *text = owl_new_sv(owl_editwin_get_text(e));
    556 
    557   if (cb == NULL) {
     525  SV *text;
     526  dSP;
     527
     528  if(cb == NULL) {
    558529    owl_function_error("Perl callback is NULL!");
    559530    return;
    560531  }
    561 
    562   OWL_PERL_CALL(call_sv(cb, G_DISCARD|G_EVAL)
    563                 ,
    564                 XPUSHs(sv_2mortal(text));
    565                 XPUSHs(sv_2mortal(newSViv(success)));
    566                 ,
    567                 "Perl Error: '%s'"
    568                 ,
    569                 false
    570                 ,
    571                 true
    572                 ,
    573                 );
     532  text = owl_new_sv(owl_editwin_get_text(e));
     533
     534  ENTER;
     535  SAVETMPS;
     536
     537  PUSHMARK(SP);
     538  XPUSHs(sv_2mortal(text));
     539  PUTBACK;
     540 
     541  call_sv(cb, G_DISCARD|G_EVAL);
     542
     543  if(SvTRUE(ERRSV)) {
     544    owl_function_error("%s", SvPV_nolen(ERRSV));
     545  }
     546
     547  FREETMPS;
     548  LEAVE;
    574549}
    575550
  • perlglue.xs

    r7dcef03 rf271129  
    6767        OUTPUT:
    6868                RETVAL
    69 
    70 int
    71 getnumlines()
    72         CODE:
    73                 RETVAL = owl_global_get_lines(&g);
    74         OUTPUT:
    75                 RETVAL
    76 
     69               
    7770time_t
    7871getidletime()
     
    9588        OUTPUT:
    9689                RETVAL
     90
     91void
     92zephyr_zwrite(cmd,msg)
     93        const char *cmd
     94        const char *msg
     95        PREINIT:
     96                int i;
     97        CODE:
     98                i = owl_zwrite_create_and_send_from_line(cmd, msg);
    9799
    98100const utf8 *
     
    163165        {
    164166                owl_function_adminmsg(header, body);           
     167        }
     168
     169void
     170start_question(line, callback)
     171        const char *line
     172        SV *callback
     173        PREINIT:
     174                owl_editwin *e;
     175        CODE:
     176        {
     177                if(!SV_IS_CODEREF(callback))
     178                        croak("Callback must be a subref");
     179
     180                e = owl_function_start_question(line);
     181
     182                owl_editwin_set_cbdata(e,
     183                                       newSVsv(callback),
     184                                       owl_perlconfig_dec_refcnt);
     185                owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
     186        }
     187
     188void
     189start_password(line, callback)
     190        const char *line
     191        SV *callback
     192        PREINIT:
     193                owl_editwin *e;
     194        CODE:
     195        {
     196                if(!SV_IS_CODEREF(callback))
     197                        croak("Callback must be a subref");
     198
     199                e = owl_function_start_password(line);
     200
     201                owl_editwin_set_cbdata(e,
     202                                       newSVsv(callback),
     203                                       owl_perlconfig_dec_refcnt);
     204                owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
     205        }
     206
     207void
     208start_edit_win(line, callback)
     209        const char *line
     210        SV *callback
     211        CODE:
     212        {
     213                if(!SV_IS_CODEREF(callback))
     214                        croak("Callback must be a subref");
     215
     216                owl_function_start_edit_win(line,
     217                                            owl_perlconfig_edit_callback,
     218                                            newSVsv(callback),
     219                                            owl_perlconfig_dec_refcnt);
    165220        }
    166221
     
    232287     CODE:
    233288        {
    234                 s = g_slice_new(owl_style);
     289                s = g_new(owl_style, 1);
    235290                owl_style_create_perl(s, name, newSVsv(object));
    236291                owl_global_add_style(&g, s);
     
    256311        }
    257312
    258 bool
    259 message_matches_filter(message, filter_name, quiet = false)
    260         SV *message
    261         const char *filter_name
    262         bool quiet
    263         PREINIT:
    264                 owl_message *m;
    265                 const owl_filter *f;
    266         CODE:
    267         {
    268                 if (!SvROK(message) || SvTYPE(SvRV(message)) != SVt_PVHV) {
    269                         croak("Usage: BarnOwl::message_matches_filter($message, $filter_name[, $quiet])");
    270                 }
    271 
    272                 m = owl_perlconfig_hashref2message(message);
    273                 f = owl_global_get_filter(&g, filter_name);
    274                 if (!f && !quiet) {
    275                         owl_function_error("%s filter is not defined", filter_name);
    276                 }
    277                 RETVAL = f && owl_filter_message_match(f, m);
    278         }
    279         OUTPUT:
    280                 RETVAL
    281         CLEANUP:
    282                 owl_message_delete(m);
    283 
    284313const utf8 *
    285314wordwrap(in, cols)
     
    397426MODULE = BarnOwl                PACKAGE = BarnOwl::Internal
    398427
    399 
    400 int
    401 file_deleteline(filename, line, backup)
    402         const char *filename
    403         const char *line
    404         int backup
    405         CODE:
    406                 RETVAL = owl_util_file_deleteline(filename, line, backup);
    407         OUTPUT:
    408                 RETVAL
    409428
    410429void
     
    438457           }
    439458
    440 
    441 MODULE = BarnOwl                PACKAGE = BarnOwl::Internal
    442 
    443 void
    444 new_variable(name, summary, description, validsettings, takes_on_off, get_tostring_fn, set_fromstring_fn, data)
    445     const char *name
    446     const char *summary
    447     const char *description
    448     const char *validsettings
    449     int takes_on_off
    450     SV *get_tostring_fn
    451     SV *set_fromstring_fn
    452     SV *data
    453     CODE:
    454 {
    455         /* data is somewhat redundant given we can create closures, but oh
    456          * well. Might be convenient sometimes. */
    457         if(!SV_IS_CODEREF(get_tostring_fn)) {
    458                 croak("To-string function must be a coderef!");
    459         }
    460         if(!SV_IS_CODEREF(set_fromstring_fn)) {
    461                 croak("From-string function must be a coderef!");
    462         }
    463 
    464         owl_variable_dict_newvar_other(owl_global_get_vardict(&g),
    465                                        name, summary, description, validsettings, takes_on_off,
    466                                        perl_closure_new(get_tostring_fn, data, false),
    467                                        perl_closure_new(set_fromstring_fn, data, false));
    468 }
    469 
    470 void
    471 start_edit(edit_type, line, callback)
    472         const char *edit_type
    473         const char *line
    474         SV *callback
    475         PREINIT:
    476                 owl_editwin *e;
    477         CODE:
    478         {
    479                 if (!SV_IS_CODEREF(callback))
    480                         croak("Callback must be a subref");
    481 
    482                 if (!strcmp(edit_type, "question"))
    483                         e = owl_function_start_question(line);
    484                 else if (!strcmp(edit_type, "password"))
    485                         e = owl_function_start_password(line);
    486                 else if (!strcmp(edit_type, "edit_win"))
    487                         e = owl_function_start_edit_win(line);
    488                 else
    489                         croak("edit_type must be one of 'password', 'question', 'edit_win', not '%s'", edit_type);
    490 
    491                 owl_editwin_set_cbdata(e, newSVsv(callback), owl_perlconfig_dec_refcnt);
    492                 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
    493         }
    494 
    495 int
    496 zephyr_zwrite(cmd,msg)
    497         const char *cmd
    498         const char *msg
    499         CODE:
    500                 RETVAL = owl_zwrite_create_and_send_from_line(cmd, msg);
    501         OUTPUT:
    502                 RETVAL
     459void
     460new_variable_string(name, ival, summ, desc)
     461        const char * name
     462        const char * ival
     463        const char * summ
     464        const char * desc
     465        CODE:
     466        owl_variable_dict_newvar_string(owl_global_get_vardict(&g),
     467                                        name,
     468                                        summ,
     469                                        desc,
     470                                        ival);
     471
     472void
     473new_variable_int(name, ival, summ, desc)
     474        const char * name
     475        int ival
     476        const char * summ
     477        const char * desc
     478        CODE:
     479        owl_variable_dict_newvar_int(owl_global_get_vardict(&g),
     480                                     name,
     481                                     summ,
     482                                     desc,
     483                                     ival);
     484
     485void
     486new_variable_bool(name, ival, summ, desc)
     487        const char * name
     488        int ival
     489        const char * summ
     490        const char * desc
     491        CODE:
     492        owl_variable_dict_newvar_bool(owl_global_get_vardict(&g),
     493                                      name,
     494                                      summ,
     495                                      desc,
     496                                      ival);
    503497
    504498MODULE = BarnOwl                PACKAGE = BarnOwl::Editwin
  • popexec.c

    r7dcef03 re146cd7  
    2323  }
    2424
    25   pe = g_slice_new(owl_popexec);
     25  pe = g_new(owl_popexec, 1);
    2626  pe->winactive=0;
    2727  pe->pid=0;
     
    179179  if (pe->refcount<=0) {
    180180    owl_function_debugmsg("doing free of %p", pe);
    181     g_slice_free(owl_popexec, pe);
     181    g_free(pe);
    182182  }
    183183}
  • popwin.c

    r7dcef03 r6829afc  
    33CALLER_OWN owl_popwin *owl_popwin_new(void)
    44{
    5   owl_popwin *pw = g_slice_new0(owl_popwin);
     5  owl_popwin *pw = g_new0(owl_popwin, 1);
    66
    77  pw->border = owl_window_new(NULL);
     
    9292  g_object_unref(pw->content);
    9393
    94   g_slice_free(owl_popwin, pw);
     94  g_free(pw);
    9595}
    9696
  • runtests.sh

    r7dcef03 rf6ab6ee  
    11#!/bin/sh
    2 export G_SLICE=debug-blocks
    3 exec env HARNESS_PERL=./tester prove --failures "${srcdir:=$(dirname "$0")}/t/"
     2exec env HARNESS_PERL=./tester prove --failures t/
  • select.c

    r7dcef03 r84a071f  
    4141  if (t->destroy_cbdata)
    4242    t->destroy_cbdata(t->cbdata);
    43   g_slice_free(owl_task, t);
     43  g_free(t);
    4444}
    4545
     
    4747{
    4848  GSource *source = g_idle_source_new();
    49   owl_task *t = g_slice_new0(owl_task);
     49  owl_task *t = g_new0(owl_task, 1);
    5050  t->cb = cb;
    5151  t->cbdata = cbdata;
  • sepbar.c

    ra38becd r6eb3ed9  
    6767  }
    6868
    69   if (owl_function_is_away()) {
     69  if (owl_global_is_zaway(&g) || owl_global_is_aaway(&g)) {
    7070    getyx(sepwin, y, x);
    7171    wmove(sepwin, y, x+2);
    7272    wattron(sepwin, A_BOLD);
    7373    wattroff(sepwin, A_REVERSE);
    74     waddstr(sepwin, " AWAY ");
     74    if (owl_global_is_zaway(&g) && owl_global_is_aaway(&g)) {
     75      waddstr(sepwin, " AWAY ");
     76    } else if (owl_global_is_zaway(&g)) {
     77      waddstr(sepwin, " Z-AWAY ");
     78    } else if (owl_global_is_aaway(&g)) {
     79      waddstr(sepwin, " A-AWAY ");
     80    }
    7581    wattron(sepwin, A_REVERSE);
    7682    wattroff(sepwin, A_BOLD);
  • style.c

    r7dcef03 r14be3a5  
    2323{
    2424  SV *sv = NULL;
    25   OWL_PERL_CALL(call_method("description", G_SCALAR|G_EVAL),
    26                 XPUSHs(s->perlobj);,
    27                 "Error in style_get_description: %s",
    28                 0,
    29                 false,
    30                 sv = SvREFCNT_inc(POPs);
    31                 );
    32   if (sv) {
     25  OWL_PERL_CALL_METHOD(s->perlobj,
     26                       "description",
     27                       ;,
     28                       "Error in style_get_description: %s",
     29                       0,
     30                       sv = SvREFCNT_inc(POPs);
     31                       );
     32  if(sv) {
    3333    return SvPV_nolen(sv_2mortal(sv));
    3434  } else {
     
    5050 
    5151  /* Call the perl object */
    52   OWL_PERL_CALL(call_method("format_message", G_SCALAR|G_EVAL),
    53                 XPUSHs(s->perlobj);
    54                 XPUSHs(sv_2mortal(owl_perlconfig_message2hashref(m)));,
    55                 "Error in format_message: %s",
    56                 0,
    57                 false,
    58                 sv = SvREFCNT_inc(POPs);
    59                 );
     52  OWL_PERL_CALL_METHOD(s->perlobj,
     53                       "format_message",
     54                       XPUSHs(sv_2mortal(owl_perlconfig_message2hashref(m)));,
     55                       "Error in format_message: %s",
     56                       0,
     57                       sv = SvREFCNT_inc(POPs);
     58                       );
    6059
    61   if (sv) {
     60  if(sv) {
    6261    body = SvPV_nolen(sv);
    6362  } else {
     
    103102{
    104103  owl_style_cleanup(s);
    105   g_slice_free(owl_style, s);
     104  g_free(s);
    106105}
  • t/00-core-tests.t

    r5db8835 r95414bf  
    11#!/usr/bin/env perl
    2 system("./tester", "--builtin");
     2use File::Basename;
     3system(dirname($0) . "/../tester", "--builtin");
  • tester.c

    r21dc927 ra74a044  
    33#include "owl.h"
    44#undef WINDOW
    5 #include "filterproc.h"
    65
    76#include <stdio.h>
     
    2423int owl_smartfilter_regtest(void);
    2524int owl_history_regtest(void);
    26 int call_filter_regtest(void);
    27 int owl_smartstrip_regtest(void);
    2825
    2926extern void owl_perl_xs_init(pTHX);
     
    116113  numfailures += owl_smartfilter_regtest();
    117114  numfailures += owl_history_regtest();
    118   numfailures += call_filter_regtest();
    119   numfailures += owl_smartstrip_regtest();
    120115  if (numfailures) {
    121116      fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures);
     
    135130{
    136131  int numfailed=0;
    137   char *path, *home;
     132  char *s, *path, *home;
    138133
    139134  printf("# BEGIN testing owl_util\n");
     
    231226
    232227
    233   CHECK_STR_AND_FREE("baseclass barnowl",
    234                      "barnowl", owl_util_baseclass("barnowl"));
    235   CHECK_STR_AND_FREE("baseclass unbarnowl",
    236                      "barnowl", owl_util_baseclass("unbarnowl"));
    237   CHECK_STR_AND_FREE("baseclass unununbarnowl.d.d",
    238                      "barnowl", owl_util_baseclass("unununbarnowl.d.d"));
    239   CHECK_STR_AND_FREE("baseclass ununun.d.d",
    240                      "", owl_util_baseclass("ununun.d.d"));
    241   CHECK_STR_AND_FREE("baseclass d.d.d.d",
    242                      "d", owl_util_baseclass("d.d.d.d"));
    243   CHECK_STR_AND_FREE("baseclass n.d.d.d",
    244                      "n", owl_util_baseclass("n.d.d.d"));
    245   CHECK_STR_AND_FREE("baseclass ununun.",
    246                      ".", owl_util_baseclass("ununun."));
    247   CHECK_STR_AND_FREE("baseclass unununu",
    248                      "u", owl_util_baseclass("unununu"));
    249 
    250 
    251   CHECK_STR_AND_FREE("makepath foo/bar",
    252                      "foo/bar", owl_util_makepath("foo/bar"));
    253   CHECK_STR_AND_FREE("makepath //foo///bar",
    254                      "/foo/bar", owl_util_makepath("//foo///bar"));
    255   CHECK_STR_AND_FREE("makepath foo/~//bar/",
    256                      "foo/~/bar/", owl_util_makepath("foo/~//bar/"));
    257   CHECK_STR_AND_FREE("makepath ~thisuserhadreallybetternotexist/foobar/",
    258                      "~thisuserhadreallybetternotexist/foobar/",
    259                      owl_util_makepath("~thisuserhadreallybetternotexist/foobar/"));
     228  s = owl_util_baseclass("barnowl");
     229  FAIL_UNLESS("baseclass barnowl", !strcmp("barnowl", s));
     230  g_free(s);
     231  s = owl_util_baseclass("unbarnowl");
     232  FAIL_UNLESS("baseclass unbarnowl", !strcmp("barnowl", s));
     233  g_free(s);
     234  s = owl_util_baseclass("unununbarnowl.d.d");
     235  FAIL_UNLESS("baseclass unununbarnowl.d.d", !strcmp("barnowl", s));
     236  g_free(s);
     237  s = owl_util_baseclass("ununun.d.d");
     238  FAIL_UNLESS("baseclass ununun.d.d", !strcmp("", s));
     239  g_free(s);
     240  s = owl_util_baseclass("d.d.d.d");
     241  FAIL_UNLESS("baseclass d.d.d.d", !strcmp("d", s));
     242  g_free(s);
     243  s = owl_util_baseclass("n.d.d.d");
     244  FAIL_UNLESS("baseclass n.d.d.d", !strcmp("n", s));
     245  g_free(s);
     246  s = owl_util_baseclass("ununun.");
     247  FAIL_UNLESS("baseclass ununun.", !strcmp(".", s));
     248  g_free(s);
     249  s = owl_util_baseclass("unununu");
     250  FAIL_UNLESS("baseclass unununu", !strcmp("u", s));
     251  g_free(s);
     252
     253
     254  s = owl_util_makepath("foo/bar");
     255  FAIL_UNLESS("makepath foo/bar", !strcmp("foo/bar", s));
     256  g_free(s);
     257  s = owl_util_makepath("//foo///bar");
     258  FAIL_UNLESS("makepath //foo///bar", !strcmp("/foo/bar", s));
     259  g_free(s);
     260  s = owl_util_makepath("foo/~//bar/");
     261  FAIL_UNLESS("makepath foo/~//bar/", !strcmp("foo/~/bar/", s));
     262  g_free(s);
     263  s = owl_util_makepath("~thisuserhadreallybetternotexist/foobar/");
     264  FAIL_UNLESS("makepath ~thisuserhadreallybetternotexist/foobar/",
     265              !strcmp("~thisuserhadreallybetternotexist/foobar/", s));
     266  g_free(s);
    260267
    261268  home = g_strdup(owl_global_get_homedir(&g));
    262   CHECK_STR_AND_FREE("makepath ~",
    263                      home, owl_util_makepath("~"));
     269  s = owl_util_makepath("~");
     270  FAIL_UNLESS("makepath ~", !strcmp(home, s));
     271  g_free(s);
    264272
    265273  path = g_build_filename(home, "foo/bar/baz", NULL);
    266   CHECK_STR_AND_FREE("makepath ~///foo/bar//baz",
    267                      path, owl_util_makepath("~///foo/bar//baz"));
     274  s = owl_util_makepath("~///foo/bar//baz");
     275  FAIL_UNLESS("makepath ~///foo/bar//baz", !strcmp(path, s));
     276  g_free(s);
    268277  g_free(path);