Changes in / [4626016:4485285]


Ignore:
Files:
146 edited

Legend:

Unmodified
Added
Removed
  • COPYING

    rccc182c r7869e48  
    113113the original authors' reputations.
    114114
    115 
    116115  Finally, any free program is threatened constantly by software
    117116patents.  We wish to avoid the danger that companies distributing free
     
    161160General Public License rather than by this special one.
    162161
    163 
    164162                  GNU LIBRARY GENERAL PUBLIC LICENSE
    165163   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
     
    196194writing it).  Whether that is true depends on what the Library does
    197195and what the program that uses the Library does.
    198  
     196
    199197  1. You may copy and distribute verbatim copies of the Library's
    200198complete source code as you receive it, in any medium, provided that
     
    208206and you may at your option offer warranty protection in exchange for a
    209207fee.
    210 
    211208
    212209  2. You may modify your copy or copies of the Library or any portion
     
    268265these notices.
    269266
    270 
    271267  Once this change is made in a given copy, it is irreversible for
    272268that copy, so the ordinary GNU General Public License applies to all
     
    319315Any executables containing that work also fall under Section 6,
    320316whether or not they are linked directly with the Library itself.
    321 
    322317
    323318  6. As an exception to the Sections above, you may also compile or
     
    375370distribute.
    376371
    377 
    378372  7. You may place library facilities that are a work based on the
    379373Library side-by-side in a single library together with other library
     
    416410You are not responsible for enforcing compliance by third parties to
    417411this License.
    418 
    419412
    420413  11. If, as a consequence of a court judgment or allegation of patent
     
    470463the Free Software Foundation.
    471464
    472 
    473465  14. If you wish to incorporate parts of the Library into other free
    474466programs whose distribution conditions are incompatible with these,
     
    505497                     END OF TERMS AND CONDITIONS
    506498
    507 
    508499           How to Apply These Terms to Your New Libraries
    509500
     
    849840  - "Package" refers to the collection of files distributed by the Copyright
    850841    Holder, and derivatives of that collection of files created through
    851     textual modification. 
     842    textual modification.
    852843  - "Standard Version" refers to such a Package if it has not been modified,
    853844    or has been modified in accordance with the wishes of the Copyright
    854     Holder. 
     845    Holder.
    855846  - "Copyright Holder" is whoever is named in the copyright or copyrights for
    856     the package. 
     847    the package.
    857848  - "You" is you, if you're thinking about copying or distributing this Package.
    858849  - "Reasonable copying fee" is whatever you can justify on the basis of media
    859850    cost, duplication charges, time of people involved, and so on. (You will
    860851    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.) 
     852    computing community at large as a market that must bear the fee.)
    862853  - "Freely Available" means that no fee is charged for the item itself, though
    863854    there may be fees involved in handling the item. It also means that
    864855    recipients of the item may redistribute it under the same conditions they
    865     received it. 
     856    received it.
    866857
    8678581. You may make and give away verbatim copies of the source form of the
  • ChangeLog

    r65ff3f4 r7869e48  
    456456     libncursesw. - asedeno
    457457   * text entry:
    458     first pass at utf-8 text entry. 
     458    first pass at utf-8 text entry.
    459459   * Change wcwidth() calls to mk_wcwidth() - asedeno
    460460   * First pass at outbound zephyr -> iso-8859-1 sanitizing.
     
    730730
    7317312.1.12pre
    732         Don't crash when sending/logging outgoing 
     732        Don't crash when sending/logging outgoing
    733733           AIM message and not logged in [BZ 90]
    734734        Don't crash when senging to someone not on AIM buddy list [BZ 94]
    735735           (patch from Alex Vandiver)
    736        
     736
    7377372.1.11
    738738        Don't crash doing zlocate with bad tickets. [BZ 12]
     
    762762        A fix for certain resize crashes (partly from alexmv) [BZ 55]
    763763        Turn off ISTRIP (gildea)
    764        
     764
    7657652.1.9
    766766        Include /usr/include/kerberosIV if it's found
    767        
     767
    7687682.1.8
    769769        Do OLC formatting for anything coming from olc.matisse
    770770        Improvements to popup size algorithm (from gildea)
    771771        Improved 'show colors' with non-colored labels
    772        
     772
    7737732.1.7
    774774        The colorclass command is added, to make colorization easy
     
    777777        Do ntohs() when printing zephyr port in zephyr info
    778778        Updated man page
    779        
     779
    7807802.1.6
    781781        Fixed three bugs found by Valgrind.
     
    792792        Dropped first brace in muxevents functions for consistency
    793793        Catch SIGHUP and SIGTERM and do a proper logout
    794        
     794
    7957952.1.5
    796796        Added a licence
     
    802802          will also be logged if this is set to 'on'
    803803        Added 'show license'
    804        
     804
    8058052.1.4
    806806        Normalize and downcase AIM names for logging
     
    818818        Do the initial zephyr_buddy_check when pseduologin set to true.
    819819        Updated man page
    820        
     820
    8218212.1.2
    822822        removed unused filter_depth variable
    823823        Fixed memory bug on receiving pings
    824        
     824
    8258252.1.1
    826826        Filters of filters now work.
     
    865865        Don't print extra new lines in popless_file
    866866        New zephyr_get_field function
    867        
     867
    8688682.0.14
    869869        Fixed missing word in startup message
     
    876876        Current directory added to 'status' command
    877877        Massive changes to libfaim and aim
    878        
     878
    8798792.0.13
    880880        Changed startup message for new mailing list
    881881        blist now prints AIM info even if .anyone is unreadable
    882882        Catch SIGPIPE and print an error rather than crashing.
    883                 [It's possible that this may have some portability 
    884                 issues under Solaris and we may need to add some 
     883                [It's possible that this may have some portability
     884                issues under Solaris and we may need to add some
    885885                configure stuff around SA_SIGINFO...]
    886886        Handle the case in aim_bstream_send where aim_send returns -1,
     
    891891        Un-word-wrap text when sending AIM messages.
    892892        Replace the main loop continue in the keyboard handler with an else.
    893        
     893
    8948942.0.12
    895895        Command history now doesn't allow the last entry
     
    909909        Print an error message if trying an invalid color for a filter
    910910        Fixed bug causing > not to go to end of editwin every time
    911        
     911
    9129122.0.11
    913913        Updated basic help
     
    920920        Zpunt now works with weird regex characters
    921921        Smart filters now work with weird regex characters
    922        
     922
    9239232.0.10
    924924        Allow 'hostname' in filters.
     
    927927        An admin message is displayed when you are logged out of AIM
    928928        Print an error message and admin message if an AIM send fails
    929        
     929
    9309302.0.9
    931931        Added the 'fancylines' variable.
     
    941941        Added command "show errors"
    942942        Fixed bug removing newlines in backup files
    943        
     943
    9449442.0.8
    945945        Increased size of screen name field in buddy listing
     
    951951        Add owl::login and owl::auth to legacy variables populated for format_msg.
    952952        Additions to intro.txt and advanced.txt documents.  (Still in progress.)
    953         Add base methods for login_host and login_tty 
     953        Add base methods for login_host and login_tty
    954954                and others that return undef.
    955         New API for perl message formatting functions. 
     955        New API for perl message formatting functions.
    956956                Legacy variables are still supported for owl::format_msg
    957                 and owl::receive_msg, but these functions are now also 
     957                and owl::receive_msg, but these functions are now also
    958958                passed an owl::Message object which contains methods
    959                 for accessing the contents of the message.  See perlwrap.pm 
     959                for accessing the contents of the message.  See perlwrap.pm
    960960                (and docs TBD) for the available methods.
    961961                *** WARNING:  The exact API for owl::Message has
     
    970970        When perl throws an error, the message is put in the msgwin
    971971                if possible.
    972         Added perl functions for:       
     972        Added perl functions for:
    973973                owl::getcurmsg() -- returns an owl::Message object for
    974974                                    the active message
     
    977977                owl::zephyr_getrealm() -- returns the zephyr realm
    978978                owl::zephyr_getsender() -- returns the zephyr sender
    979         Made owl::COMMAND("foo"); be syntactic sugar for 
     979        Made owl::COMMAND("foo"); be syntactic sugar for
    980980                owl::command("COMMAND foo");
    981         Added perlwrap.pm to contain perl code to be compiled into 
     981        Added perlwrap.pm to contain perl code to be compiled into
    982982                the binary.  This is transformed into perlwrap.c by
    983983                encapsulate.pl.
     
    998998        Improved status command
    999999        Fixed bug in buddy stuff
    1000        
     1000
    100110012.0.6
    10021002        aimlogin will now accept the screenname without a password and ask
     
    10091009        Reformatted editwin.c and added capability of doing password-style
    10101010           echoing
    1011        
     1011
    101210122.0.5
    10131013        Fix in finding des for building zcrypt
     
    10211021        Added hostname and tty name to LOGIN/LOGOUT zephyrs on oneline
    10221022          style
    1023        
     1023
    102410242.0.4
    10251025        Made command line option -n actually work
     
    10561056        Translate < > & "   &ensp, &emsp, &endash and
    10571057           &emdash
    1058        
     1058
    105910592.0.3
    10601060        Don't ring the terminal bell on mail messages.
     
    10631063        Fixed a bug in fmtext
    10641064        Expanded the size of the hostname buffer
    1065        
     1065
    106610662.0.2
    10671067        Fixed bug in 'startup' command.
     
    11591159        Disabled 'addbuddy' and 'delbuddy' for aim since it doesn't work yet
    11601160        Hacked the Perl build stuff not to link with iconv
    1161        
     1161
    116211621.2.8
    11631163        Class pings are displayed differently now
    11641164        Updated owlconf.simple example to format outgoing messages.
    1165        
     1165
    116611661.2.7
    11671167        Outgoing messages now go through the config for formatting
     
    11791179        Started implementing zcrypt command
    11801180        More updates to the intro doc
    1181        
     1181
    118211821.2.6
    11831183        Started adding code for newmsgproc.  It doesn't fully work yet!
     
    11931193        Implemented the dump command
    11941194        New startup message
    1195        
     1195
    119611961.2.5
    11971197        Patch to fix memory bug in replying to CC messages
     
    12011201        Cast to an int for isspace, to make gcc -Wall quiet
    12021202        Added 'zlist' and 'l' to basic help.
    1203        
     1203
    120412041.2.4
    12051205        'zlog in' will now take an optional thrid argument to set the
     
    12281228        Made daemon.webzephyr a special case for smartstrip
    12291229        Added 'out' as a default filter for outgoing messages
    1230        
     1230
    123112311.2.3
    12321232        Added filters "ping", "auto" and "login" by default.
     
    12471247        Print the zsig used for outgoing messages
    12481248        The tty variable now controls the zephyr location tty name
    1249        
     1249
    125012501.2.2
    12511251        Added the 'search' command.
     
    12581258             When switching from an empty view to one we've previously
    12591259             been in, the new current message position will attempt
    1260              to be close to the current position from the last 
     1260             to be close to the current position from the last
    12611261             time we visited that view.
    12621262        Fixed bug in readconfig.c that prevented building under perl 5.005.
     
    12761276        New framework for command handling.
    12771277        New framework for keymap handling.
    1278         Added commands for everything that is bound 
     1278        Added commands for everything that is bound
    12791279             to a key (do 'show commands' to get the full list).
    12801280        Added 'multi' and '(' commands to allow multiple commands
    1281              to be specified on a line.             
     1281             to be specified on a line.
    12821282        Added user keybindings with bindkey command.
    12831283        Added command aliases (eg, "alias foo bar").
     
    12981298        C-t will transpose characters
    12991299        Fix the scrolling bug where we would sometimes fail to scroll
    1300              the screen down, leaving the current message off 
     1300             the screen down, leaving the current message off
    13011301             the bottom of the screen.
    13021302        Refixed 'login or login' typo in help
     
    13421342        Added owl_sprintf which returns the formatted string, or NULL.
    13431343                The caller must free this string.
    1344                 This will allocate enough memory and thus 
     1344                This will allocate enough memory and thus
    13451345                avoid potential some buffer overrun situations.
    13461346        Simple implementation of 'zwrite -m' (doesn't yet log an outgoing
    13471347                message as having been sent.)
    1348         The "Not logged in or subscribing to messages" error 
     1348        The "Not logged in or subscribing to messages" error
    13491349                now includes the name of the recipient.
    13501350        The "disable-ctrl-d" variable may also be set to "middle"
    1351                 which will result in ctrl-d only sending at the 
     1351                which will result in ctrl-d only sending at the
    13521352                end of the message.  This is now the default.
    13531353                This also added a command "editmulti:done-or-delete".
     
    13591359                The M-n and M-p keys will cycle through the history ring.
    13601360                In particular, it is now possible to edit the command line
    1361                 of a zephyr being composed:  C-c it and restart it 
     1361                of a zephyr being composed:  C-c it and restart it
    13621362                and then M-p to get the aborted composition back.
    13631363        Added owl::send_zwrite(command, message) to the perl glue
    13641364                to allow for the direct sending of multi-line messages.
    1365                 For example:  owl::send_zwrite("-c foo -i bar", "hello"); 
    1366         Changed owl_fmtext_print_plain to return an alloc'd string to 
     1365                For example:  owl::send_zwrite("-c foo -i bar", "hello");
     1366        Changed owl_fmtext_print_plain to return an alloc'd string to
    13671367                avoid buffer overrun risks.
    1368         Added owl::ztext_stylestrip("...") function to perlglue 
     1368        Added owl::ztext_stylestrip("...") function to perlglue
    13691369                 which returns the ztext with formatting stripped out.
    13701370        Added colorztext variable which can be used to disable @color()
     
    13801380        Added opera to the allowed options to the webbrowser variable.
    13811381        Fixed some buffer overruns in the "reply" command.
    1382         When repying to "all" on a message that begins with "CC:" (eg, sent 
     1382        When repying to "all" on a message that begins with "CC:" (eg, sent
    13831383                 with "zwrite -C", the reply line will be constructed
    13841384                 from the sender and the usernames on the CC: line
     
    13911391        Added --no-move option to delete command.
    13921392                In particular, delete-and-always-move-down may now
    1393                 be implemented with 
     1393                be implemented with
    13941394                '( delete --no-move ; next --skip-deleted )'.
    1395         Folded the nextmsg and prevmsg commands and functions together into 
     1395        Folded the nextmsg and prevmsg commands and functions together into
    13961396                one command which takes arguments.
    13971397                Added '--filter <name>' option (eg, for next_personal),
    13981398                '--skip-deleted' option, and
    13991399                '--last-if-none'/'--first-if-none' options.
    1400                 Help updated accordingly. 
    1401                 In particular, the 'personal' filter is now used 
    1402                 for 'next personal'. 
    1403                 Added --smart-filter and --smart-filter-instance options 
     1400                Help updated accordingly.
     1401                In particular, the 'personal' filter is now used
     1402                for 'next personal'.
     1403                Added --smart-filter and --smart-filter-instance options
    14041404                to the next and prev commands.
    14051405        Updated examples/owlconf.erik with the above.
    1406         Made owl_function_fast*filt return a string and not do the 
     1406        Made owl_function_fast*filt return a string and not do the
    14071407                narrowing, to make it more general.
    14081408        Added a smartfilter command that creates a filter
    14091409                based on the current message and returns the name
    14101410                of the filter.
    1411         Added M-C-n and M-C-p keybindings to "move to next message 
    1412                 matching current" and "move to previous message 
     1411        Added M-C-n and M-C-p keybindings to "move to next message
     1412                matching current" and "move to previous message
    14131413                matching current"
    1414         Added variables edit:maxfillcols and edit:maxwrapcols which 
     1414        Added variables edit:maxfillcols and edit:maxwrapcols which
    14151415                will limit how wide editing paragraphs may get before
    14161416                they get wrapped.  This is a max and may be narrower
     
    14191419                edit:maxfillcols and unlimited for edit:maxwrapcols.
    14201420        Added smartzpunt command with key binding of "C-x k".
    1421                 This starts a zpunt command filled in with 
     1421                This starts a zpunt command filled in with
    14221422                the proposed zpunt.
    14231423        Fixed a memory reference bug in delete and undelete commands.
     
    14261426                call back into owl.  This allows perl to get the return
    14271427                value of strings returned by owl commands.
    1428         Added the getview command which returns the name of the current 
    1429                 view's filter. 
     1428        Added the getview command which returns the name of the current
     1429                view's filter.
    14301430        Added the getvar command which returns the value of a variable.
    1431         Added an example to examples/owlconf.erik which uses TAB to 
    1432                 narrow and restore the view. 
    1433         Added an example to examples/owlconf.erik which uses M-c to 
     1431        Added an example to examples/owlconf.erik which uses TAB to
     1432                narrow and restore the view.
     1433        Added an example to examples/owlconf.erik which uses M-c to
    14341434                color messages matching the current one green.
    14351435        Integrated change to fix problem with popup blinking on new zephyrs.
     
    14431443                and new show commands.
    14441444        Show with arguments produces help on show.
    1445         Fix a bug in readconfig caught by efence (where we'd try to read before 
     1445        Fix a bug in readconfig caught by efence (where we'd try to read before
    14461446                the beginning of a string if it was empty).
    14471447        The perl command doesn't do makemsg directly, but instead
    1448              returns the string and it will get printed if it 
     1448             returns the string and it will get printed if it
    14491449             was run interactively.
    1450        
     1450
    145114511.1.3
    14521452        'show subs' and 'show subscriptions' are now the same as 'getsubs'
     
    14941494        Include login/logout messages in auto user filters
    14951495        'V' changes to the home view ('all' by default)
    1496        
     1496
    149714971.1.1
    1498         Fixed perl, aperl, and pperl commands to deal with quoting 
     1498        Fixed perl, aperl, and pperl commands to deal with quoting
    14991499              and spaces in a saner manner.
    15001500        Removed all owl_get_* methods for booleans and switched
    1501               cases where they were used to owl_is_* 
     1501              cases where they were used to owl_is_*
    15021502        Changes to owlconf.erik to use some new features.
    1503         Increased the size of the help buffer (as it 
     1503        Increased the size of the help buffer (as it
    15041504              was overflowing and truncating the help message).
    15051505        Variables prefixed with a _ are not shown in help
    1506               or by printallvars (and prefixed Not Yet Implemented 
     1506              or by printallvars (and prefixed Not Yet Implemented
    15071507              variables with this).
    15081508        Fix typo in help
     
    15171517        display admin message time in 'info' command
    15181518        fixed an editwin M-> last character bug
    1519                
     1519
    152015201.1
    15211521        reply is a normal function now
     
    15671567        Fixed an arg checking bug in delete command
    15681568        Added owl::id to perl namespace with message id
    1569         Fixed a memory corruption bug in readconfig.c (where right 
     1569        Fixed a memory corruption bug in readconfig.c (where right
    15701570              after the strdup to "out", we'd strcat a \n onto the end.
    15711571              This would be triggered whenever owl::format_msg returned
    15721572              a string not ending in a newline
    1573         Added 'X' keybinding which expunges and then switches to 
    1574               a view defined by the variable "view_home" which defaults 
     1573        Added 'X' keybinding which expunges and then switches to
     1574              a view defined by the variable "view_home" which defaults
    15751575              to "all"
    15761576        Consolidated readconfig.c somewhat to remove duplication.
     
    16011601              are generated from variable.c by stubgen.pl.
    16021602              The help.c messages for variables now calls into variable.c
    1603               so all information about most variables is in one place.   
     1603              so all information about most variables is in one place.
    16041604        Cleaned out code from global.c and command.c that was made obselete
    16051605              by variable overhaul.
    16061606        The set command now takes a -q option to not log a message.
    16071607        Fixed a bug where set and print with no arguments would
    1608               print "Undefined variable" in addition 
     1608              print "Undefined variable" in addition
    16091609              to running owl_function_printallvars.
    16101610        debug is now a variable that can be turned on and off.
    16111611        Fixed mail,inbox message parsing in examples/owlconf.erik
    1612         Made zaway_msg and zaway_msg_default into variables 
    1613         Changed owl_function_makemsg and owl_function_debugmsg 
     1612        Made zaway_msg and zaway_msg_default into variables
     1613        Changed owl_function_makemsg and owl_function_debugmsg
    16141614               to use varargs (ie, so they can now take a format
    16151615               string with args).
     
    16311631        Added doc/code.txt which gives a brief overview of the code.
    16321632        Added tags makefile rule and added TAGS to distclean rule.
    1633        
     1633
    163416341.0.1
    16351635        fix frees in loadsubs and loadloginsubs
    16361636        don't return in owl_free
    1637        
     1637
    163816381.0
    16391639        'print' and 'set' with no arguments prints all variables
     
    16651665        you can now reply to an admin message
    16661666        don't display an error about keypress on window resize
    1667        
     1667
    166816680.11
    16691669        fixed bug in viewing messages longer than the screen
     
    16811681        change malloc, realloc, strdup and free to use owl hooks so that
    16821682           debugging can be added
    1683                
     1683
    168416840.10.1
    16851685        fixed a trailing space bug in the parser
     
    16881688        fixed bug in reporting which M- key was pressed
    16891689        C-g will now cancel commands like C-c
    1690        
     1690
    169116910.10
    16921692        implemented owl_function_full_redisplay().
     
    17131713        some build cleanup
    17141714
    1715        
     1715
    171617160.9
    17171717        added owl_message_is_personal and have things use it
     
    17281728        added smart bolding and userclue
    17291729        fixed a bug causing pings to beep even if rxping is off
    1730        
     1730
    173117310.8.1
    17321732        fixed bug in logging code
    1733        
     1733
    173417340.8
    17351735        implemented personal logging
     
    17381738        fixed the backspace problem
    17391739        -v command line option prints the version number
    1740        
     1740
    174117410.7
    17421742        load-subs will report error opening file
     
    17521752        added displayoutgoing variable
    17531753        temporarily removed error printing for zlog in / out
    1754        
     1754
    175517550.61
    17561756        fixed bug in "message sent to <foo>" for zwrite
    1757        
     1757
    175817580.6
    17591759        help updated
     
    17661766        personal bell variable
    17671767        beta message now an admin message
    1768        
     1768
    176917690.5
    17701770        Added the debug command and flag
  • aim.c

    rf271129 r7869e48  
    107107   * future.  It's still called by Owl.
    108108   */
    109      
     109
    110110}
    111111
     
    131131  aim_setdebuggingcb(sess, faimtest_debugcb);
    132132  aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
    133  
     133
    134134  /* this will leak, I know and just don't care right now */
    135135  priv=g_new0(struct owlfaim_priv, 1);
     
    165165  */
    166166
    167    
     167
    168168  aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, faimtest_flapversion, 0);
    169169  aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0);
     
    174174  /* aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); */
    175175  /* aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); */
    176    
     176
    177177  /* start processing AIM events */
    178178  owl_global_set_doaimevents(&g);
     
    338338
    339339  owl_function_debugmsg("owl_aim_search: doing search for %s", email);
    340   ret=aim_search_address(owl_global_get_aimsess(&g), 
     340  ret=aim_search_address(owl_global_get_aimsess(&g),
    341341                         aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_BOS),
    342342                         email);
     
    358358    len=499;
    359359  }
    360    
     360
    361361  aim_locate_setprofile(owl_global_get_aimsess(&g),
    362362                        NULL, NULL, 0,
     
    367367  aim_bos_setprofile(owl_global_get_aimsess(&g),
    368368                     owl_global_get_bosconn(&g),
    369                      NULL, NULL, 0, "us-ascii", msg, 
     369                     NULL, NULL, 0, "us-ascii", msg,
    370370                     strlen(msg), 0);
    371371  */
     
    421421                               aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), name, exchange);
    422422   ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000);
    423  
     423
    424424}
    425425
     
    468468  if (selstat == -1) {
    469469    owl_aim_logged_out();
    470   } else if (selstat == 0) { 
     470  } else if (selstat == 0) {
    471471    /* no events pending */
    472472  } else if (selstat == 1) { /* outgoing data pending */
     
    474474  } else if (selstat == 2) { /* incoming data pending */
    475475    /* printf("selstat == 2\n"); */
    476    
     476
    477477    if (aim_get_command(aimsess, waitingconn) >= 0) {
    478478      aim_rxdispatch(aimsess);
     
    510510  struct owlfaim_priv *priv = sess->aux_data;
    511511  struct client_info_s info = CLIENTINFO_AIM_KNOWNGOOD;
    512    
     512
    513513  const char *key;
    514514  va_list ap;
     
    519519
    520520  aim_send_login(sess, fr->conn, priv->screenname, priv->password, &info, key);
    521  
     521
    522522  return(1);
    523523}
     
    649649  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOK, 0x0003, faimtest_parse_searchreply, 0);
    650650  */
    651  
     651
    652652  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR,              faimtest_parse_msgerr, 0);
    653653  aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO,           faimtest_parse_userinfo, 0);
     
    733733  fu16_t code;
    734734  const char *msg;
    735  
     735
    736736  va_start(ap, fr);
    737737  code = va_arg(ap, int);
    738738  msg = va_arg(ap, const char *);
    739739  va_end(ap);
    740  
     740
    741741  owl_function_error("faimtest_parse_connerr: Code 0x%04x: %s\n", code, msg);
    742742  aim_conn_kill(sess, &fr->conn); /* this will break the main loop */
    743  
     743
    744744  priv->connected = 0;
    745  
     745
    746746  return 1;
    747747}
     
    751751  int status;
    752752  va_list ap;
    753  
     753
    754754  va_start(ap, fr);
    755755  status = va_arg(ap, int); /* status code of confirmation request */
     
    758758  /* owl_function_debugmsg("faimtest_accountconfirm: Code 0x%04x: %s\n", code, msg); */
    759759  owl_function_debugmsg("faimtest_accountconfirm: account confirmation returned status 0x%04x (%s)\n", status, (status==0x0000)?"email sent":"unknown");
    760  
     760
    761761  return 1;
    762762}
     
    768768  const char *val;
    769769  va_list ap;
    770  
     770
    771771  va_start(ap, fr);
    772772  change = va_arg(ap, int);
     
    777777  str = va_arg(ap, int);
    778778  va_end(ap);
    779  
     779
    780780  owl_function_debugmsg("faimtest_infochange: info%s: perms = %d, type = %x, length = %d, val = %s", change?" change":"", perms, type, length, str?val:"(not string)");
    781  
     781
    782782  return(1);
    783783}
     
    790790
    791791  owl_function_debugmsg("faimtest_handledirect:");
    792  
     792
    793793  va_start(ap, fr);
    794794  redir = va_arg(ap, struct aim_redirect_data *);
    795  
     795
    796796  if (redir->group == 0x0005) {  /* Adverts */
    797    
     797
    798798  } else if (redir->group == 0x0007) {  /* Authorizer */
    799799    aim_conn_t *tstconn;
    800800
    801801    owl_function_debugmsg("faimtest_handledirect: autorizer");
    802    
     802
    803803    tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, redir->ip);
    804804    if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) {
     
    832832  struct aim_icbmparameters *params;
    833833  va_list ap;
    834  
     834
    835835  va_start(ap, fr);
    836836  params = va_arg(ap, struct aim_icbmparameters *);
    837837  va_end(ap);
    838  
     838
    839839  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);
    841      
     841
    842842  /*
    843843  * Set these to your taste, or client medium.  Setting minmsginterval
     
    850850  /* aim_seticbmparam(sess, params); */
    851851  aim_im_setparams(sess, params);
    852  
     852
    853853  return 1;
    854854}
     
    858858  va_list ap;
    859859  fu16_t maxbuddies, maxwatchers;
    860  
     860
    861861  va_start(ap, fr);
    862862  maxbuddies = va_arg(ap, int);
    863863  maxwatchers = va_arg(ap, int);
    864864  va_end(ap);
    865  
     865
    866866  owl_function_debugmsg("faimtest_parse_buddyrights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers);
    867  
     867
    868868  /* aim_ssi_reqrights(sess, fr->conn); */
    869869  aim_ssi_reqrights(sess);
    870  
     870
    871871  return 1;
    872872}
     
    876876  va_list ap;
    877877  fu16_t maxpermits, maxdenies;
    878  
     878
    879879  va_start(ap, fr);
    880880  maxpermits = va_arg(ap, int);
    881881  maxdenies = va_arg(ap, int);
    882882  va_end(ap);
    883  
     883
    884884  owl_function_debugmsg("faimtest_bosrights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies);
    885885  aim_clientready(sess, fr->conn);
     
    893893  va_list ap;
    894894  fu16_t maxsiglen;
    895  
     895
    896896  va_start(ap, fr);
    897897  maxsiglen = va_arg(ap, int);
     
    899899
    900900  owl_function_debugmsg("faimtest_locrights: rights: max signature length = %d\n", maxsiglen);
    901  
     901
    902902  return(1);
    903903}
     
    944944
    945945  owl_function_debugmsg("faimtest_parse_motd: %s (%d / %s)\n", msg?msg:"nomsg", id, (id < codeslen)?codes[id]:"unknown");
    946  
     946
    947947  return 1;
    948948}
     
    960960  if (flags & AIM_FLAG_WIRELESS) printf("WIRELESS ");
    961961  if (flags & AIM_FLAG_ACTIVEBUDDY) printf("ACTIVEBUDDY ");
    962  
     962
    963963  return;
    964964}
     
    10731073static int faimtest_parse_incoming_im_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args)
    10741074{
    1075   /* 
     1075  /*
    10761076  printf("rendezvous: source sn = %s\n", userinfo->sn);
    10771077  printf("rendezvous: \twarnlevel = %f\n", aim_userinfo_warnlevel(userinfo));
     
    10791079  printuserflags(userinfo->flags);
    10801080  printf("\n");
    1081  
     1081
    10821082  printf("rendezvous: \tonlinesince = %lu\n", userinfo->onlinesince);
    10831083  printf("rendezvous: \tidletime = 0x%04x\n", userinfo->idletime);
    1084  
     1084
    10851085  printf("rendezvous: message/description = %s\n", args->msg);
    10861086  printf("rendezvous: encoding = %s\n", args->encoding);
    10871087  printf("rendezvous: language = %s\n", args->language);
    10881088  */
    1089  
     1089
    10901090  if (args->reqclass == AIM_CAPS_SENDFILE) {
    10911091    owl_function_debugmsg("faimtest_parse_incoming_im_chan2: send file!");
     
    11191119  va_list ap;
    11201120  int ret = 0;
    1121  
     1121
    11221122  va_start(ap, fr);
    11231123  channel = (fu16_t)va_arg(ap, unsigned int);
    11241124  userinfo = va_arg(ap, aim_userinfo_t *);
    1125  
     1125
    11261126  if (channel == 1) {
    11271127    struct aim_incomingim_ch1_args *args;
     
    11511151
    11521152  nz_screenname=owl_aim_normalize_screenname(userinfo->sn);
    1153  
     1153
    11541154  owl_buddylist_oncoming(owl_global_get_buddylist(&g), nz_screenname);
    11551155
     
    11731173    owl_function_debugmsg("parse_oncoming sn: %s away flag!", userinfo->sn);
    11741174  }
    1175  
     1175
    11761176  owl_function_debugmsg("parse_oncoming sn: %s idle: %i", userinfo->sn, userinfo->idletime);
    1177    
     1177
    11781178  g_free(nz_screenname);
    1179  
     1179
    11801180  /*
    11811181    printf("%ld  %s is now online (flags: %04x = %s%s%s%s%s%s%s%s) (caps = %s = 0x%08lx)\n",
     
    12011201  char *nz_screenname;
    12021202  va_list ap;
    1203  
     1203
    12041204  va_start(ap, fr);
    12051205  userinfo = va_arg(ap, aim_userinfo_t *);
     
    12291229         userinfo->capabilities);
    12301230  */
    1231  
     1231
    12321232  return 1;
    12331233}
     
    12381238  va_list ap;
    12391239  fu16_t reason;
    1240  
     1240
    12411241  va_start(ap, fr);
    12421242  reason = (fu16_t)va_arg(ap, unsigned int);
    12431243  va_end(ap);
    1244  
     1244
    12451245  /* printf("snac threw error (reason 0x%04x: %s)\n", reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */
    12461246  if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]);
    1247  
     1247
    12481248  return 1;
    12491249}
     
    12541254  const char *destsn;
    12551255  fu16_t reason;
    1256  
     1256
    12571257  va_start(ap, fr);
    12581258  reason = (fu16_t)va_arg(ap, unsigned int);
    12591259  destsn = va_arg(ap, const char *);
    12601260  va_end(ap);
    1261  
     1261
    12621262  /* printf("message to %s bounced (reason 0x%04x: %s)\n", destsn, reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */
    12631263  if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]);
     
    12661266    owl_function_adminmsg("", "Could not send AIM message, user not logged on");
    12671267  }
    1268  
     1268
    12691269  return 1;
    12701270}
     
    12751275  const char *destsn;
    12761276  fu16_t reason;
    1277  
     1277
    12781278  va_start(ap, fr);
    12791279  reason = (fu16_t)va_arg(ap, unsigned int);
    12801280  destsn = va_arg(ap, const char *);
    12811281  va_end(ap);
    1282  
     1282
    12831283  /* printf("user information for %s unavailable (reason 0x%04x: %s)\n", destsn, reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */
    12841284  if (reason<msgerrreasonslen) owl_function_error("%s", msgerrreasons[reason]);
    1285  
     1285
    12861286  return 1;
    12871287}
     
    12971297  };
    12981298  static int missedreasonslen = 5;
    1299  
     1299
    13001300  va_list ap;
    13011301  fu16_t chan, nummissed, reason;
    13021302  aim_userinfo_t *userinfo;
    1303  
     1303
    13041304  va_start(ap, fr);
    13051305  chan = (fu16_t)va_arg(ap, unsigned int);
     
    13081308  reason = (fu16_t)va_arg(ap, unsigned int);
    13091309  va_end(ap);
    1310  
     1310
    13111311  owl_function_debugmsg("faimtest_parse_misses: missed %d messages from %s on channel %d (reason %d: %s)\n", nummissed, userinfo->sn, chan, reason, (reason<missedreasonslen)?missedreasons[reason]:"unknown");
    1312  
     1312
    13131313  return 1;
    13141314}
     
    13221322  fu16_t type;
    13231323  const char *sn = NULL;
    1324  
     1324
    13251325  va_start(ap, fr);
    13261326  type = (fu16_t)va_arg(ap, unsigned int);
    13271327  sn = va_arg(ap, const char *);
    13281328  va_end(ap);
    1329  
     1329
    13301330  owl_function_debugmsg("faimtest_parse_msgack: 0x%04x / %s\n", type, sn);
    1331  
     1331
    13321332  return 1;
    13331333}
     
    13461346  fu32_t windowsize, clear, alert, limit, disconnect;
    13471347  fu32_t currentavg, maxavg;
    1348  
    1349   va_start(ap, fr); 
    1350  
     1348
     1349  va_start(ap, fr);
     1350
    13511351  /* See code explanations below */
    13521352  code = (fu16_t)va_arg(ap, unsigned int);
    1353  
     1353
    13541354  /*
    13551355   * See comments above aim_parse_ratechange_middle() in aim_rxhandlers.c.
    13561356   */
    13571357  rateclass = (fu16_t)va_arg(ap, unsigned int);
    1358  
    1359   /*
    1360    * Not sure what this is exactly.  I think its the temporal 
     1358
     1359  /*
     1360   * Not sure what this is exactly.  I think its the temporal
    13611361   * relation factor (ie, how to make the rest of the numbers
    1362    * make sense in the real world). 
     1362   * make sense in the real world).
    13631363   */
    13641364  windowsize = va_arg(ap, fu32_t);
    1365  
     1365
    13661366  /* Explained below */
    13671367  clear = va_arg(ap, fu32_t);
     
    13711371  currentavg = va_arg(ap, fu32_t);
    13721372  maxavg = va_arg(ap, fu32_t);
    1373  
    1374   va_end(ap);
    1375  
     1373
     1374  va_end(ap);
     1375
    13761376  owl_function_debugmsg("faimtest_parse_ratechange: rate %s (rate class 0x%04x): curavg = %u, maxavg = %u, alert at %u, clear warning at %u, limit at %u, disconnect at %u (window size = %u)",
    13771377                        (code < 5)?codes[code]:"invalid",
     
    13891389  fu16_t newevil;
    13901390  aim_userinfo_t *userinfo;
    1391  
     1391
    13921392  va_start(ap, fr);
    13931393  newevil = (fu16_t)va_arg(ap, unsigned int);
    13941394  userinfo = va_arg(ap, aim_userinfo_t *);
    13951395  va_end(ap);
    1396  
     1396
    13971397  /*
    13981398   * Evil Notifications that are lacking userinfo->sn are anon-warns
     
    14041404   */
    14051405  owl_function_debugmsg("faimtest_parse_evilnotify: new value = %2.1f%% (caused by %s)\n", ((float)newevil)/10, (userinfo && strlen(userinfo->sn))?userinfo->sn:"anonymous");
    1406  
     1406
    14071407  return 1;
    14081408}
     
    14141414  int num, i;
    14151415  GPtrArray *list;
    1416  
     1416
    14171417  va_start(ap, fr);
    14181418  address = va_arg(ap, const char *);
     
    14221422
    14231423  list = g_ptr_array_new();
    1424  
     1424
    14251425  owl_function_debugmsg("faimtest_parse_searchreply: E-Mail Search Results for %s: ", address);
    14261426  for (i=0; i<num; i++) {
     
    14371437  va_list ap;
    14381438  const char *address;
    1439  
     1439
    14401440  va_start(ap, fr);
    14411441  address = va_arg(ap, const char *);
     
    14441444  owl_function_error("No results searching for %s", address);
    14451445  owl_function_debugmsg("faimtest_parse_searcherror: E-Mail Search Results for %s: No Results or Invalid Email\n", address);
    1446  
     1446
    14471447  return(1);
    14481448}
     
    14531453  const char *msg, *url;
    14541454  fu16_t width, height, delay;
    1455  
     1455
    14561456  va_start(ap, fr);
    14571457  msg = va_arg(ap, const char *);
     
    14611461  delay = va_arg(ap, unsigned int);
    14621462  va_end(ap);
    1463  
     1463
    14641464  owl_function_debugmsg("handlepopup: (%dx%x:%d) %s (%s)\n", width, height, delay, msg, url);
    1465  
     1465
    14661466  return 1;
    14671467}
     
    14791479  const char *bosip;
    14801480  fu8_t *cookie;
    1481  
     1481
    14821482  va_start(ap, fr);
    14831483  bosip = va_arg(ap, const char *);
    14841484  cookie = va_arg(ap, fu8_t *);
    14851485  va_end(ap);
    1486  
     1486
    14871487  owl_function_debugmsg("migrate: migration in progress -- new BOS is %s -- disconnecting", bosip);
    14881488  aim_conn_kill(sess, &fr->conn);
    1489  
     1489
    14901490  if (!(bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, bosip))) {
    14911491    owl_function_debugmsg("migrate: could not connect to BOS: internal error");
    14921492    return 1;
    1493   } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) {       
     1493  } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) {
    14941494    owl_function_debugmsg("migrate: could not connect to BOS");
    14951495    aim_conn_kill(sess, &bosconn);
    14961496    return 1;
    14971497  }
    1498  
     1498
    14991499  /* Login will happen all over again. */
    15001500  addcb_bos(sess, bosconn);
     
    15081508  /* aim_ssi_reqdata(sess, fr->conn, 0, 0x0000); */
    15091509  aim_ssi_reqdata(sess);
    1510  
     1510
    15111511  return(1);
    15121512}
     
    15231523  struct aim_ssi_item *l;
    15241524  */
    1525  
     1525
    15261526  va_start(ap, fr);
    15271527  fmtver = va_arg(ap, unsigned int);
     
    15301530  list = va_arg(ap, struct aim_ssi_item *);
    15311531  va_end(ap);
    1532  
     1532
    15331533  owl_function_debugmsg("ssiddata: got SSI data (0x%02x, %d items, %u)", fmtver, itemcount, stamp);
    15341534  /*
     
    15401540  */
    15411541  aim_ssi_enable(sess);
    1542  
     1542
    15431543  return 1;
    15441544}
     
    15561556  va_list ap;
    15571557  struct aim_icq_offlinemsg *msg;
    1558  
     1558
    15591559  va_start(ap, fr);
    15601560  msg = va_arg(ap, struct aim_icq_offlinemsg *);
    15611561  va_end(ap);
    1562  
     1562
    15631563  if (msg->type == 0x0001) {
    15641564    owl_function_debugmsg("offlinemsg: from %u at %d/%d/%d %02d:%02d : %s", msg->sender, msg->year, msg->month, msg->day, msg->hour, msg->minute, msg->msg);
     
    15861586  int count;
    15871587  /* int i; */
    1588  
     1588
    15891589  va_start(ap, fr);
    15901590  count = va_arg(ap, int);
     
    16081608  /* int i; */
    16091609
    1610  
     1610
    16111611  va_start(ap, fr);
    16121612  count = va_arg(ap, int);
    16131613  userinfo = va_arg(ap, aim_userinfo_t *);
    16141614  va_end(ap);
    1615  
     1615
    16161616  /*
    16171617    printf("chat: %s:  Some occupants have left:\n", aim_chat_getname(fr->conn));
    1618    
     1618
    16191619    for (i = 0; i < count; i++)
    16201620    printf("chat: %s: \t%s\n", aim_chat_getname(fr->conn), userinfo[i].sn);
     
    16351635  const char *croomname;
    16361636  /* int i; */
    1637  
     1637
    16381638  croomname = aim_chat_getname(fr->conn);
    1639  
     1639
    16401640  va_start(ap, fr);
    16411641  roominfo = va_arg(ap, struct aim_chat_roominfo *);
     
    16621662  for (i = 0; i < usercount; i++)
    16631663    printf("chat: %s:  \t\t%s\n", croomname, userinfo[i].sn);
    1664  
    1665   owl_function_debugmsg("chat: %s:  \tRoom flags: 0x%04x (%s%s%s%s)\n", 
     1664
     1665  owl_function_debugmsg("chat: %s:  \tRoom flags: 0x%04x (%s%s%s%s)\n",
    16661666         croomname, flags,
    16671667         (flags & AIM_CHATROOM_FLAG_EVILABLE) ? "Evilable, " : "",
     
    16751675  printf("chat: %s:  \tMax visible message length: %d bytes\n", croomname, maxvisiblemsglen);
    16761676  */
    1677  
     1677
    16781678  return(1);
    16791679}
     
    16851685  const char *msg;
    16861686  char tmpbuf[1152];
    1687  
    1688   va_start(ap, fr);
    1689   userinfo = va_arg(ap, aim_userinfo_t *);     
     1687
     1688  va_start(ap, fr);
     1689  userinfo = va_arg(ap, aim_userinfo_t *);
    16901690  msg = va_arg(ap, const char *);
    16911691  va_end(ap);
     
    16961696  printf("chat: %s: incoming msg from %s: %s\n", aim_chat_getname(fr->conn), userinfo->sn, msg);
    16971697  */
    1698  
     1698
    16991699  /*
    17001700   * Do an echo for testing purposes.  But not for ourselves ("oops!")
     
    17041704    aim_chat_send_im(sess, fr->conn, 0, tmpbuf, strlen(tmpbuf));
    17051705  }
    1706  
     1706
    17071707  return 1;
    17081708}
     
    17171717  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0);
    17181718  aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0);
    1719  
     1719
    17201720  aim_clientready(sess, fr->conn);
    1721  
     1721
    17221722  owl_function_debugmsg("Chat ready");
    17231723
     
    17351735
    17361736  owl_function_debugmsg("in faimtest_chatnav_redirect");
    1737  
     1737
    17381738  tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, redir->ip);
    17391739  if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) {
     
    17431743    return;
    17441744  }
    1745  
     1745
    17461746  aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0);
    17471747  aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chat, 0);
     
    17571757
    17581758  owl_function_debugmsg("in chat_redirect");
    1759  
     1759
    17601760  tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, redir->ip);
    17611761  if (!tstconn || (tstconn->status & AIM_CONN_STATUS_RESOLVERR)) {
    17621762    /* printf("unable to connect to chat server\n"); */
    17631763    if (tstconn) aim_conn_kill(sess, &tstconn);
    1764     return; 
    1765   }             
     1764    return;
     1765  }
    17661766  /* printf("chat: connected to %s instance %d on exchange %d\n", redir->chat.room, redir->chat.instance, redir->chat.exchange); */
    1767  
     1767
    17681768  /*
    17691769   * We must do this to attach the stored name to the connection!
     
    17731773  aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chat, 0);
    17741774  aim_sendcookie(sess, tstconn, redir->cookielen, redir->cookie);
    1775   return;       
     1775  return;
    17761776}
    17771777
  • buddylist.c

    r3cdd6d2 r7869e48  
    1212  owl_buddy *b;
    1313  b=g_new(owl_buddy, 1);
    14  
     14
    1515  owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname);
    1616  g_ptr_array_add(bl->buddies, b);
  • cmd.c

    rf271129 r7869e48  
    7979    owl_function_makemsg("Unbalanced quotes");
    8080    return NULL;
    81   } 
    82  
     81  }
     82
    8383  if (argc < 1) {
    8484    g_strfreev(argv);
     
    144144}
    145145
    146 int owl_cmd_is_context_valid(const owl_cmd *cmd, const owl_context *ctx) { 
     146int owl_cmd_is_context_valid(const owl_cmd *cmd, const owl_context *ctx) {
    147147  if (owl_context_matches(ctx, cmd->validctx)) return 1;
    148148  else return 0;
     
    168168      rv = owl_function_command(newcmd);
    169169      g_free(newcmd);
    170     } 
     170    }
    171171    alias_recurse_depth--;
    172172    return rv;
     
    201201  if (cmd->cmd_args_fn) {
    202202    return cmd->cmd_args_fn(argc, argv, cmdbuff);
    203   } else if (cmd->cmd_v_fn) {   
     203  } else if (cmd->cmd_v_fn) {
    204204    cmd->cmd_v_fn();
    205205  } else if (cmd->cmd_i_fn) {
     
    207207  } else if (cmd->cmd_ctxargs_fn) {
    208208    return cmd->cmd_ctxargs_fn(owl_context_get_data(ctx), argc, argv, cmdbuff);
    209   } else if (cmd->cmd_ctxv_fn) {   
     209  } else if (cmd->cmd_ctxv_fn) {
    210210    cmd->cmd_ctxv_fn(owl_context_get_data(ctx));
    211211  } else if (cmd->cmd_ctxi_fn) {
     
    277277  }
    278278
    279   owl_fmtext_append_normal(fm, "\n\n"); 
    280 }
     279  owl_fmtext_append_normal(fm, "\n\n");
     280}
  • codelist.pl

    r06adc25 r7869e48  
    2929            print;
    3030        }
    31            
     31
    3232    }
    3333    close(FILE);
  • commands.c

    r39a531d r7869e48  
    6969              "",
    7070              ""),
    71  
     71
    7272  OWLCMD_ARGS("start-command", owl_command_start_command, OWL_CTX_INTERACTIVE,
    7373              "prompts the user to enter a command",
     
    125125              "send an AIM message",
    126126              "aimwrite <user> [-m <message...>]",
    127               "Send an aim message to a user.\n\n" 
     127              "Send an aim message to a user.\n\n"
    128128              "The following options are available:\n\n"
    129129              "-m    Specifies a message to send without prompting.\n"),
     
    139139              "Behaves like zwrite but uses encryption.  Not for use with\n"
    140140              "personal messages\n"),
    141  
     141
    142142  OWLCMD_ARGS("reply", owl_command_reply,  OWL_CTX_INTERACTIVE,
    143143              "reply to the current message",
     
    217217  OWLCMD_VOID("unsuball", owl_command_unsuball, OWL_CTX_ANY,
    218218              "unsubscribe from all zephyrs", "", ""),
    219  
     219
    220220  OWLCMD_VOID("getsubs", owl_command_getsubs, OWL_CTX_ANY,
    221221              "print all current subscriptions",
     
    299299              "display detailed information about the current message",
    300300              "", ""),
    301  
     301
    302302  OWLCMD_ARGS("help", owl_command_help, OWL_CTX_INTERACTIVE,
    303303              "display help on using BarnOwl",
     
    330330              "scrolls receive window to specified position", "", ""),
    331331
    332   OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 
     332  OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown,
    333333              OWL_CTX_INTERACTIVE,
    334334              "scrolls down by a page", "", ""),
     
    346346
    347347  OWLCMD_INT ("recv:scroll", owl_function_page_curmsg, OWL_CTX_INTERACTIVE,
    348               "scrolls current message up or down", 
    349               "recv:scroll <numlines>", 
     348              "scrolls current message up or down",
     349              "recv:scroll <numlines>",
    350350              "Scrolls the current message up or down by <numlines>.\n"
    351351              "Scrolls up if <numlines> is negative, else scrolls down.\n"),
     
    396396
    397397  OWLCMD_VOID("last", owl_command_last, OWL_CTX_INTERACTIVE,
    398               "move the pointer to the last message", "", 
     398              "move the pointer to the last message", "",
    399399              "Moves the pointer to the last message in the view.\n"
    400400              "If we are already at the last message in the view,\n"
     
    509509  OWLCMD_VOID("status", owl_command_status, OWL_CTX_ANY,
    510510              "print status information about the running BarnOwl", "", ""),
    511  
     511
    512512  OWLCMD_ARGS("zlocate", owl_command_zlocate, OWL_CTX_INTERACTIVE,
    513513              "locate a user",
    514               "zlocate [-d] <user> ...", 
     514              "zlocate [-d] <user> ...",
    515515              "Performs a zlocate on one ore more users and puts the result\n"
    516516              "int a popwin.  If -d is specified, does not authenticate\n"
    517517              "the lookup request.\n"),
    518  
     518
    519519  OWLCMD_ARGS("filter", owl_command_filter, OWL_CTX_ANY,
    520520              "create a message filter",
     
    674674              "Show errors will show a list of errors encountered by BarnOwl.\n\n"
    675675              "SEE ALSO: filter, view, alias, bindkey, help\n"),
    676  
     676
    677677  OWLCMD_ARGS("delete", owl_command_delete, OWL_CTX_INTERACTIVE,
    678678              "mark a message for deletion",
     
    799799  /****************************************************************/
    800800
    801   OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 
     801  OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword,
    802802                  OWL_CTX_EDIT,
    803803                  "moves cursor forward a word",
    804804                  "", ""),
    805805
    806   OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 
     806  OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword,
    807807                  OWL_CTX_EDIT,
    808808                  "moves cursor backwards a word",
     
    814814                  "", ""),
    815815
    816   OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 
     816  OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end,
    817817                  OWL_CTX_EDIT,
    818818                  "moves cursor to the bottom right (end) of the buffer",
    819819                  "", ""),
    820820
    821   OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 
     821  OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end,
    822822                  OWL_CTX_EDIT,
    823823                  "moves cursor to the end of the line",
    824824                  "", ""),
    825825
    826   OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 
     826  OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start,
    827827                  OWL_CTX_EDIT,
    828828                  "moves cursor to the beginning of the line",
    829829                  "", ""),
    830830
    831   OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 
     831  OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left,
    832832                  OWL_CTX_EDIT,
    833833                  "moves the cursor left by a character",
     
    854854                  "", ""),
    855855
    856   OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 
     856  OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char,
    857857                  OWL_CTX_EDIT,
    858858                  "deletes the character to the right of the cursor",
     
    864864                  "", ""),
    865865
    866   OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 
     866  OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear,
    867867                  OWL_CTX_EDIT,
    868868                  "deletes all of the contents of the buffer",
     
    874874                  "", ""),
    875875
    876   OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 
     876  OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph,
    877877                  OWL_CTX_EDIT,
    878878                  "fills the current paragraph to line-wrap well",
    879879                  "", ""),
    880880
    881   OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 
     881  OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter,
    882882                  OWL_CTX_EDIT,
    883883                  "recenters the buffer",
    884884                  "", ""),
    885885
    886   OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 
     886  OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text,
    887887                  OWL_CTX_EDIT,
    888888                  "inserts text into the buffer",
    889889                  "edit:insert-text <text>", ""),
    890890
    891   OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 
     891  OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel,
    892892                  OWL_CTX_EDIT,
    893893                  "cancels the current command",
    894894                  "", ""),
    895895
    896   OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 
     896  OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next,
    897897                  OWL_CTX_EDIT,
    898898                  "replaces the text with the next history",
    899899                  "", ""),
    900900
    901   OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 
     901  OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev,
    902902                  OWL_CTX_EDIT,
    903903                  "replaces the text with the previous history",
     
    932932  OWLCMD_ALIAS   ("editresponse:done", "edit:done"),
    933933
    934   OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 
     934  OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up,
    935935                  OWL_CTX_EDITMULTI,
    936936                  "moves the cursor up one line",
    937937                  "", ""),
    938938
    939   OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 
     939  OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down,
    940940                  OWL_CTX_EDITMULTI,
    941941                  "moves the cursor down one line",
    942942                  "", ""),
    943943
    944   OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 
     944  OWLCMD_VOID_CTX("edit:done", owl_command_edit_done,
    945945                  OWL_CTX_EDIT,
    946946                  "Finishes entering text in the editwin.",
    947947                  "", ""),
    948948
    949   OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 
     949  OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete,
    950950                  OWL_CTX_EDITMULTI,
    951951                  "completes the command, but only if at end of message",
    952                   "", 
     952                  "",
    953953                  "If only whitespace is to the right of the cursor,\n"
    954954                  "runs 'edit:done'.\n"\
     
    971971  /****************************************************************/
    972972
    973   OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 
     973  OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown,
    974974                  OWL_CTX_POPLESS,
    975975                  "scrolls down one page",
    976976                  "", ""),
    977977
    978   OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 
     978  OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown,
    979979                  OWL_CTX_POPLESS,
    980980                  "scrolls down one line",
    981981                  "", ""),
    982982
    983   OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 
     983  OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup,
    984984                  OWL_CTX_POPLESS,
    985985                  "scrolls up one page",
    986986                  "", ""),
    987987
    988   OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 
     988  OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup,
    989989                  OWL_CTX_POPLESS,
    990990                  "scrolls up one line",
    991991                  "", ""),
    992992
    993   OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 
     993  OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top,
    994994                  OWL_CTX_POPLESS,
    995995                  "scrolls to the top of the buffer",
    996996                  "", ""),
    997997
    998   OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 
     998  OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom,
    999999                  OWL_CTX_POPLESS,
    10001000                  "scrolls to the bottom of the buffer",
    10011001                  "", ""),
    10021002
    1003   OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 
     1003  OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right,
    10041004                  OWL_CTX_POPLESS,
    10051005                  "scrolls right in the buffer",
    10061006                  "popless:scroll-right <num-chars>", ""),
    10071007
    1008   OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 
     1008  OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left,
    10091009                  OWL_CTX_POPLESS,
    10101010                  "scrolls left in the buffer",
    10111011                  "popless:scroll-left <num-chars>", ""),
    10121012
    1013   OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 
     1013  OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit,
    10141014                  OWL_CTX_POPLESS,
    10151015                  "exits the popless window",
     
    10661066    return NULL;
    10671067  }
    1068  
     1068
    10691069  owl_function_help_for_command(argv[1]);
    10701070  return NULL;
     
    12521252{
    12531253  char *filename;
    1254  
     1254
    12551255  if (argc!=2) {
    12561256    owl_function_makemsg("usage: dump <filename>");
     
    12811281    if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) {
    12821282      skip_deleted=1;
    1283       argc-=1; argv+=1; 
     1283      argc-=1; argv+=1;
    12841284    } else if (argc>=1 && !strcmp(argv[1], "--last-if-none")) {
    12851285      last_if_none=1;
    1286       argc-=1; argv+=1; 
     1286      argc-=1; argv+=1;
    12871287    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    12881288      filter = g_strdup(argv[2]);
    1289       argc-=2; argv+=2; 
     1289      argc-=2; argv+=2;
    12901290    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    12911291      filter = owl_function_smartfilter(0, 0);
    1292       argc-=2; argv+=2; 
     1292      argc-=2; argv+=2;
    12931293    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    12941294      filter = owl_function_smartfilter(1, 0);
    1295       argc-=2; argv+=2; 
     1295      argc-=2; argv+=2;
    12961296    } else {
    12971297      owl_function_makemsg("Invalid arguments to command 'next'.");
     
    13111311    if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) {
    13121312      skip_deleted=1;
    1313       argc-=1; argv+=1; 
     1313      argc-=1; argv+=1;
    13141314    } else if (argc>=1 && !strcmp(argv[1], "--first-if-none")) {
    13151315      first_if_none=1;
    1316       argc-=1; argv+=1; 
     1316      argc-=1; argv+=1;
    13171317    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    13181318      filter = g_strdup(argv[2]);
    1319       argc-=2; argv+=2; 
     1319      argc-=2; argv+=2;
    13201320    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    13211321      filter = owl_function_smartfilter(0, 0);
    1322       argc-=2; argv+=2; 
     1322      argc-=2; argv+=2;
    13231323    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    13241324      filter = owl_function_smartfilter(1, 0);
    1325       argc-=2; argv+=2; 
     1325      argc-=2; argv+=2;
    13261326   } else {
    13271327      owl_function_makemsg("Invalid arguments to command 'prev'.");
     
    13871387    filtname = owl_function_smartfilter(1, 0);
    13881388  } else {
    1389     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     1389    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
    13901390  }
    13911391  return filtname;
     
    15821582    owl_function_printallvars();
    15831583    return NULL;
    1584   } 
     1584  }
    15851585
    15861586  if (argc > 1 && !strcmp("-q",argv[1])) {
     
    16561656
    16571657  var=argv[1];
    1658    
     1658
    16591659  v = owl_variable_get_var(owl_global_get_vardict(&g), var);
    16601660  if (v) {
     
    17081708  int  i;
    17091709  if (argc < 2) {
    1710     owl_function_makemsg("Invalid arguments to 'multi' command.");   
     1710    owl_function_makemsg("Invalid arguments to 'multi' command.");
    17111711    return NULL;
    17121712  }
     
    17181718        break;
    17191719      } else if (newbuff[i] != ' ') {
    1720         owl_function_makemsg("Invalid arguments to 'multi' command.");   
     1720        owl_function_makemsg("Invalid arguments to 'multi' command.");
    17211721        g_free(newbuff);
    17221722        return NULL;
     
    20122012  const char *const *myargv;
    20132013  int myargc;
    2014  
     2014
    20152015  if (!owl_global_is_aimloggedin(&g)) {
    20162016    owl_function_error("You are not logged in to AIM.");
     
    20642064{
    20652065  int edit=0;
    2066  
     2066
    20672067  if (argc>=2 && !strcmp("-e", argv[1])) {
    20682068    edit=1;
     
    20712071  }
    20722072
    2073   if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) {   
     2073  if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) {
    20742074    owl_function_reply(0, !edit);
    20752075  } else if (argc==2 && !strcmp(argv[1], "sender")) {
     
    20782078    const owl_message *m;
    20792079    const owl_view    *v;
    2080     v = owl_global_get_current_view(&g);   
     2080    v = owl_global_get_current_view(&g);
    20812081    m = owl_view_get_element(v, owl_global_get_curmsg(&g));
    20822082    if (m) owl_zephyr_zaway(m);
     
    20962096{
    20972097  int auth;
    2098  
     2098
    20992099  if (argc<2) {
    21002100    owl_function_makemsg("Too few arguments for zlocate command");
     
    22122212      return(NULL);
    22132213    }
    2214    
     2214
    22152215  }
    22162216  return(NULL);
     
    22302230      owl_function_show_filter(argv[2]);
    22312231    }
    2232   } else if (argc==2 
     2232  } else if (argc==2
    22332233             && (!strcmp(argv[1], "zpunts") || !strcmp(argv[1], "zpunted"))) {
    22342234    owl_function_show_zpunts();
     
    22752275  } else if (!strcmp(argv[1], "startup")) {
    22762276    const char *filename;
    2277    
     2277
    22782278    filename=owl_global_get_startupfile(&g);
    22792279    owl_function_popless_file(filename);
     
    23322332  if (argc>1 && !strcmp(argv[1], "--no-move")) {
    23332333    move_after = 0;
    2334     argc--; 
     2334    argc--;
    23352335    argv++;
    23362336  }
     
    23932393  if (argc>1 && !strcmp(argv[1], "--no-move")) {
    23942394    move_after = 0;
    2395     argc--; 
     2395    argc--;
    23962396    argv++;
    23972397  }
     
    24342434{
    24352435  char *filtname;
    2436  
     2436
    24372437  if (argc < 3 || argc > 4) {
    24382438    owl_function_makemsg("Wrong number of arguments to colorclass command");
     
    25042504    owl_function_smartzpunt(1);
    25052505  } else {
    2506     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     2506    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
    25072507  }
    25082508  return NULL;
     
    25982598    buffstart=skiptokens(buff, 2);
    25992599  }
    2600    
     2600
    26012601  if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) {
    26022602    /* When continuing a search, don't consider the current message. */
     
    26062606    owl_function_search_helper(true, direction);
    26072607  }
    2608  
     2608
    26092609  return(NULL);
    26102610}
     
    26162616  buffstart=skiptokens(buff, 1);
    26172617  owl_function_set_search(*buffstart ? buffstart : NULL);
    2618  
     2618
    26192619  return(NULL);
    26202620}
  • context.c

    rf271129 r7869e48  
    2424  if ((((ctx->mode&OWL_CTX_MODE_BITS) & test)
    2525       || !(test&OWL_CTX_MODE_BITS))
    26       && 
    27       (((ctx->mode&OWL_CTX_ACTIVE_BITS) & test) 
     26      &&
     27      (((ctx->mode&OWL_CTX_ACTIVE_BITS) & test)
    2828       || !(test&OWL_CTX_ACTIVE_BITS))) {
    2929    return 1;
  • dict.c

    rf271129 r7869e48  
    1 /* Dictionary data abstraction. 
     1/* Dictionary data abstraction.
    22 * Maps from strings to pointers.
    33 * Stores as a sorted list of key/value pairs.
     
    6868}
    6969
    70 /* Returns 0 on success.  Will copy the key but make 
    71    a reference to the value.  Will clobber an existing 
     70/* Returns 0 on success.  Will copy the key but make
     71   a reference to the value.  Will clobber an existing
    7272   entry with the same key iff delete_on_replace!=NULL,
    7373   and will run delete_on_replace on the old element.
     
    9393    if (pos!=d->size) {
    9494      /* shift forward to leave us a slot */
    95       memmove(d->els+pos+1, d->els+pos, 
     95      memmove(d->els+pos+1, d->els+pos,
    9696              sizeof(owl_dict_el)*(d->size-pos));
    9797    }
    9898    d->size++;
    9999    d->els[pos].k = g_strdup(k);
    100     d->els[pos].v = v;   
     100    d->els[pos].v = v;
    101101    return(0);
    102102  }
  • doc/advanced.txt

    rc82b055 r7869e48  
    4444     type          message type ('zephyr', 'aim', 'admin')
    4545     direction     either 'in' 'out' or 'none'\n"
    46      login         either 'login' 'logout' or 'none'\n" 
     46     login         either 'login' 'logout' or 'none'\n"
    4747
    4848You can also use the operators 'and' 'or' and 'not' as well as the
     
    6464*** WARNING: This interface is still evolving and may change over time ***
    6565
    66 The ~/.owlconf file is interpreted by the perl interpreter. 
     66The ~/.owlconf file is interpreted by the perl interpreter.
    6767You may specify an alternate file by running owl with "owl -c <configfile>".
    6868
     
    7676    owl::format_msg()  run to format messages when using the perl style.
    7777                       The return value is used to display the message on the
    78                        screen. 
     78                       screen.
    7979    owl::receive_msg() run when a message is received, and after
    8080                       it has been added to the message list
     
    8787     owl::command('set zsigproc "/mit/kretch/bin/getzsig foo"');
    8888
    89 will set the owl variable zsigproc to 
     89will set the owl variable zsigproc to
    9090the value "/mit/kretch/bin/getzsig foo".
    9191Note that you will need to watch out for perl quoting issues.
     
    9393
    9494Both owl::format_msg and owl::receive_msg are passed perl owl::Message
    95 objects which have methods for accessing the attributes of the message. 
     95objects which have methods for accessing the attributes of the message.
    9696
    9797(Caveat: Note that these owl::Message objects are currently only
     
    154154    }
    155155
    156 In the above, $m is the owl::Message object and 
     156In the above, $m is the owl::Message object and
    157157its methods are called with $m->METHODNAME.
    158158
    159 An example receiver function that tags all zephyr pings for 
     159An example receiver function that tags all zephyr pings for
    160160deletion would be:
    161161
     
    187187If you use pperl instead of perl, the return value
    188188of the perl command will be displayed in a pop-up window.
    189 This is particularly useful within key bindings 
     189This is particularly useful within key bindings
    190190and aliases.  For example:
    191191
     
    193193
    194194Will cause the "finger" command to be used to finger at the host
    195 where the current message came from.  You can then bind this 
     195where the current message came from.  You can then bind this
    196196to the "f" key with:
    197197
  • doc/barnowl.1

    r8135737 r7869e48  
    3636\fB\-c\fP, \fB\-\-config\-file\fP=\fIFILE\fP
    3737Specify 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 
     38an arbitrary Perl script evaluated in the \fImain\fP package, and if it
     39overrides the \fIBarnOwl::startup\fP method that is run when \fBBarnOwl\fP
     40starts.  (Compare \fI~/.owl/startup\fP, which contains \fBBarnOwl\fP commands
    4141that are run at startup after the config file is loaded.)
    4242
    43 By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP, 
     43By default, \fBBarnOwl\fP uses the first of \fI~/.owl/init.pl\fP,
    4444\fI~/.barnowlconf\fP, or \fI~/.owlconf\fP that exists.
    4545
  • doc/code.txt

    rd40ad8b r7869e48  
    1616             is owl_function_command("foo");
    1717             Commands are only active within specific contexts,
    18              and attempts to call them from invalid contexts will fail.     
     18             and attempts to call them from invalid contexts will fail.
    1919
    20 context:     A context specifies the current state of owl, in terms 
     20context:     A context specifies the current state of owl, in terms
    2121             of which modal window is active and which point
    2222             in its life owl is in (eg, in startup, or running).
    23              This is implemented as a bitmask and there is 
     23             This is implemented as a bitmask and there is
    2424             some hierarchy.  Commands may restrict themselves
    2525             to only running in a limited number of contexts
     
    3434             Sometimes also referred to as typewin.
    3535
    36 filter:      Patterns which match messages.  These may 
    37              contain multiple filterelements which may be 
     36filter:      Patterns which match messages.  These may
     37             contain multiple filterelements which may be
    3838             combined together (eg, by "and" and "or").
    39              
    40 filterelement: An element of a filter which matches on some 
     39
     40filterelement: An element of a filter which matches on some
    4141               attribute of a message.
    4242
     
    4444             These are particularly useful for building up
    4545             text regions that are to be rendered on-screen,
    46              as they resize memory as needed, and they have 
     46             as they resize memory as needed, and they have
    4747             routines for cropping as needed.
    4848
     
    5555             owl.h defines "g" as a singleton instance of owl_global.
    5656             Where possible/appropriate, most accesses to global data should
    57              be from a limited number of files (eg, from owl.c and 
     57             be from a limited number of files (eg, from owl.c and
    5858             functions.c).  Consider whether you really need to before
    5959             adding in uses of global.
     
    103103             Also contains the main loop, which is roughly:
    104104             - handle scheduled resizes, and anything that might result
    105              - while zephyrs are pending, grab incoming zephyrs 
     105             - while zephyrs are pending, grab incoming zephyrs
    106106               and handle them (which includes formatting them
    107107               with either perl extension or default formatter
     
    109109             - updates mainwin display if there are new zephyrs
    110110             - displays and updates popwins and the terminal as necessary
    111              - sends characters to the popwin, recwin/mainwin, 
     111             - sends characters to the popwin, recwin/mainwin,
    112112               or typewin/editwin
    113113
     
    118118                   Created by codelist.pl.
    119119
    120 popwin:      Modal pop-up window container. 
     120popwin:      Modal pop-up window container.
    121121             Usually contains a viewwin for read-only scrolling text.
    122122
     
    126126
    127127util:        Misc utility functions that don't fit anywhere yet:
    128              - sepbar rendering 
     128             - sepbar rendering
    129129             - tokenizing and parsing utilities
    130130             - downstr
     
    186186        something, and this should be the exception to the rule.
    187187
    188         Owl should be generally useful out-of-the-box without 
    189         extensive configuration, for most people's needs. 
     188        Owl should be generally useful out-of-the-box without
     189        extensive configuration, for most people's needs.
    190190        People shouldn't have to spend days tweaking
    191191        with config files before being happy switching to it.
  • doc/intro.txt

    rd7cc50b r7869e48  
    188188variable.  For example:
    189189
    190      set personalbell on 
     190     set personalbell on
    191191
    192192will set the value of the variable 'personalbell' to 'on'.  The
     
    347347    owl::format_msg()  run to format messages when using the perl style.
    348348                       The return value is used to display the message on the
    349                        screen. 
     349                       screen.
    350350    owl::receive_msg() run when a message is received, and after
    351351                       it has been added to the message list
     
    424424For example:
    425425
    426    bindkey recv C-k command delete 
    427 
    428 will bind Control-k to the delete command, but only in the 
     426   bindkey recv C-k command delete
     427
     428will bind Control-k to the delete command, but only in the
    429429recv window context.
    430430
    431 Some keymaps inherit their bindings from more 
     431Some keymaps inherit their bindings from more
    432432general keymaps.  The valid keymaps are:
    433433
     
    438438    |  |-editresponse - single-line responses to questions
    439439    |-popless         - scrolling pop-up windows
    440     |-recv            - the main message list window 
     440    |-recv            - the main message list window
    441441                        where received messages are displayed
    442442
     
    445445Note that not all commands may be used in all contexts.
    446446
    447 Key sequences may be surrounded by quotes and include 
     447Key sequences may be surrounded by quotes and include
    448448a sequence of keys that must be pressed in order
    449449to execute the command.  For example:
  • editwin.c

    r7803326 r7869e48  
    12861286  const char *p;
    12871287  int width = offset;
    1288  
     1288
    12891289  for(p = e->buff + start;
    12901290      p < e->buff + end;
     
    13901390{
    13911391  char *p;
    1392  
     1392
    13931393  p = g_new(char, end - start + 1);
    13941394  memcpy(p, e->buff + start, end - start);
     
    14181418  if (e->win) owl_window_dirty(e->win);
    14191419}
    1420 
    14211420
    14221421
  • examples/owlconf.erik

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22###
    33### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!!
    4 ### This is an example file intended to demonstrate how to use 
     4### This is an example file intended to demonstrate how to use
    55### various features of owl.  Some of the key bindings, in particular,
    66### are more for examples than things you may actually want to use.
     
    3030### The message attributes may be dereferenced with $m->attribute
    3131###
    32 ###   
     32###
    3333
    3434# tokens for sepbar are:
     
    122122}
    123123
    124 # Load in things which don't belong in an owlconf 
     124# Load in things which don't belong in an owlconf
    125125# that people might use as an example...
    126126sub personal_startup {
     
    231231            sepbartokens_add("<$sender");
    232232            sepbartokens_trim(">$sender");
    233         } 
     233        }
    234234    } elsif ($m->is_mail) {
    235235        mail_add_message($m);
     
    249249    my ($b) = @_;
    250250    $b=~s/^/    /g;
    251     $b=~s/\n/\n    /g;   
     251    $b=~s/\n/\n    /g;
    252252    return $b;
    253253}
     
    282282    }
    283283
    284     if (!$m->is_zephyr && !$m->is_aim) { 
     284    if (!$m->is_zephyr && !$m->is_aim) {
    285285        return "Unknown message type: ".$m->type."\n";
    286286    }
     
    308308
    309309    if ($m->is_zephyr) {
    310         $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class), 
     310        $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class),
    311311        lc($m->instance), $m->time, lc($m->host);
    312312        if ($m->opcode ne "") {$out.=" op:".$m->opcode;}
     
    322322            }
    323323        }
    324         $out.="\n";             
     324        $out.="\n";
    325325    } else {
    326326        $out = sprintf "[%s] / %s\n", lc($m->type), $m->time;
    327327        $out.= "  \@bold($sender)> ";
    328         $out.="\n";             
     328        $out.="\n";
    329329    }
    330330
     
    380380    }
    381381
    382     if (!$m->is_zephyr && !$m->is_aim) { 
     382    if (!$m->is_zephyr && !$m->is_aim) {
    383383        return "Unknown message type: ".$m->type."\n";
    384384    }
     
    402402        }
    403403        return "$out\n";
    404                
     404
    405405    } elsif ($m->is_zephyr && $m->is_mail) {
    406406        my $body = $m->body;
     
    414414    my $channel = "";
    415415    my $body = $m->body;
    416    
     416
    417417    if ($m->is_zephyr) {
    418418        my $inst = $m->instance;
     
    459459    }
    460460    for my $w (@words) {
    461         if (($outline ne "") 
     461        if (($outline ne "")
    462462            && (length($outline)+length($w) > $width-$unindent)) {
    463463            $out .= $outline."\n";
     
    472472        $outline .= $w;
    473473    }
    474     $out .= $outline . "\n";   
    475 }
     474    $out .= $outline . "\n";
     475}
  • examples/owlconf.simple

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22
    33### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!!
    4 ### This is an example file intended to demonstrate how to use 
     4### This is an example file intended to demonstrate how to use
    55### various features of owl.  Some of the key bindings, in particular,
    66### are more for examples than things you may actually want to use.
     
    3636###     $owl::sender, $owl::opcode, $owl::zsig,
    3737###     $owl::msg, $owl::time, $owl::host, @owl::fields, $owl::id
    38 ###   
     38###
    3939
    4040# NOTE: Lines beginning with a "#" are perl comments.
     
    4949    ## Doing "help" will show you more about each variable.
    5050    ## These lines will set things to the default.
    51     ## You can uncomment them and then change the value to get 
     51    ## You can uncomment them and then change the value to get
    5252    ## a different behavior (remove the "#" to an alternate value).
    5353    ################################################################
     
    6060
    6161    ## Set this to on to enable logging of personal zephyrs
    62     # owl::command('set -q logging off'); 
     62    # owl::command('set -q logging off');
    6363
    6464    ## This directory must exist and is where personal zephyrs are logged.
     
    6767
    6868    ## Set this to on to enable logging of classes
    69     # owl::command('set -q classlogging off'); 
     69    # owl::command('set -q classlogging off');
    7070
    7171    ## This directory must exist and is where class zephyrs are logged.
     
    105105    ################################################################
    106106    ## The following create filters.  Filters can be used to select
    107     ## on multiple zephyrs for operations.  With 'views' you can 
     107    ## on multiple zephyrs for operations.  With 'views' you can
    108108    ## look at only the zephyrs matching a particular filter.
    109109    ## Use the 'view <filtername>' command or the 'v' key to switch views.
     
    114114    ## The filter command creates a filter with the specified name,
    115115    ## or if one already exists it is replaced.  Example filter
    116     ## syntax would be:                                       
     116    ## syntax would be:
    117117    ##
    118118    ##    filter myfilter -c red ( class ^foobar$ ) or ( class ^quux$ and instance ^bar$ )
     
    123123    ## is used it specifies the color that messages matching this filter
    124124    ## should be displayed in.  Do 'show colors' to see the available colors.
    125     ## 
     125    ##
    126126    ################################################################
    127127
     
    137137    ## The 'trash' filter is used when you press 'T' to mark things
    138138    ## for autodeletion.
    139     # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$');   
     139    # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$');
    140140
    141141}
     
    188188    ## Note that:
    189189    ##   $out .= "foo";  appends "foo" to the end of the variable $out.
    190     ##   lc(bar) will convert bar to lowercase.   
     190    ##   lc(bar) will convert bar to lowercase.
    191191    ##   "ne" does "not equal" for string comparison.
    192192    ##   sprintf fills in the %s's with the arguments later on the line.
     
    213213        # Incoming messages
    214214
    215         $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class), 
     215        $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class),
    216216                        lc($owl::instance), $owl::time, lc($owl::host);
    217217        if ($owl::opcode ne "") {$out.=" op:$owl::opcode";}
     
    228228        }
    229229    }
    230     $out.="\n";         
     230    $out.="\n";
    231231
    232232    # This indents the body of the message and then appends it on.
     
    251251## In most cases you won't need anything here.
    252252sub owl::receive_msg() {
    253    
     253
    254254    ## If this is uncommented, it would mark all messages
    255255    ## with opcode "PING" for immediate deletion:
  • examples/owlconf.vtformat

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22###
    33### This file is interpreted by the perl interpreter.
     
    2323###     $owl::sender, $owl::opcode, $owl::zsig,
    2424###     $owl::msg, $owl::time, $owl::host, @owl::fields
    25 ###   
     25###
    2626
    2727# classes will be appreviated this way
     
    124124    }
    125125    for my $w (@words) {
    126         if (($outline ne "") 
     126        if (($outline ne "")
    127127            && (length($outline)+length($w) > $width-$unindent)) {
    128128            $out .= $outline."\n";
     
    137137        $outline .= $w;
    138138    }
    139     $out .= $outline . "\n";   
     139    $out .= $outline . "\n";
    140140}
  • filterelement.c

    r7756dde r7869e48  
    7575     */
    7676    return 0;
    77   } 
     77  }
    7878  return owl_filter_message_match(subfilter, m);
    7979}
  • fmtext.c

    rf271129 r7869e48  
    2626{
    2727  int a = 0, fg = 0, bg = 0;
    28  
     28
    2929  if (attr != OWL_FMTEXT_ATTR_NONE) a=1;
    3030  if (fgcolor != OWL_COLOR_DEFAULT) fg=1;
     
    121121    p = strchr(p+1, OWL_FMTEXT_UC_STARTBYTE_UTF8);
    122122  }
    123 } 
     123}
    124124
    125125/* Internal function.  Append text from 'in' between index 'start'
     
    205205  char attr;
    206206  short fg, bg, pair = 0;
    207  
     207
    208208  if (w==NULL) {
    209209    owl_function_debugmsg("Hit a null window in owl_fmtext_curs_waddstr.");
     
    226226      /* Deal with all text from last insert to here. */
    227227      char tmp;
    228    
     228
    229229      tmp = p[0];
    230230      p[0] = '\0';
     
    243243          _owl_fmtext_wattrset(w, attr ^ OWL_FMTEXT_ATTR_REVERSE);
    244244          _owl_fmtext_wcolor_set(w, pair);
    245          
     245
    246246          waddnstr(w, s + start, end - start);
    247247
     
    332332  const char *ptr1, *ptr2;
    333333  int i, offset;
    334  
     334
    335335  /* find the starting line */
    336336  ptr1 = in->buff->str;
     
    340340    ptr1++;
    341341  }
    342  
     342
    343343  /* ptr1 now holds the starting point */
    344344
     
    375375      break;
    376376    }
    377    
     377
    378378    if (ptr_e == ptr_s) {
    379379      owl_fmtext_append_normal(out, "\n");
     
    392392        chwidth = mk_wcwidth(c);
    393393        if (col + chwidth > bcol) break;
    394        
     394
    395395        if (col >= acol) {
    396396          if (st == 0) {
     
    596596        continue;
    597597      }
    598        
     598
    599599      /* if there's no opener, print the @ and continue */
    600600      tmpptr=strpbrk(txtptr, "(<[{ ");
     
    657657        /* if it's a color read the color, set the current color and
    658658           continue */
    659       } else if (!strcasecmp(buff, "@color") 
     659      } else if (!strcasecmp(buff, "@color")
    660660                 && owl_global_is_colorztext(&g)) {
    661661        g_free(buff);
     
    756756
    757757/* requires that the list values are strings or NULL.
    758  * joins the elements together with join_with. 
     758 * joins the elements together with join_with.
    759759 * If format_fn is specified, passes it the list element value
    760760 * and it will return a string which this needs to free. */
     
    837837  if (fg > COLORS || fg < OWL_COLOR_DEFAULT) fg = OWL_COLOR_DEFAULT;
    838838  if (bg > COLORS || bg < OWL_COLOR_DEFAULT) bg = OWL_COLOR_DEFAULT;
    839            
     839
    840840#ifdef HAVE_USE_DEFAULT_COLORS
    841841  if (fg == OWL_COLOR_DEFAULT) fg = -1;
  • functions.c

    r06470d7 r7869e48  
    88{
    99  owl_function_debugmsg("executing command: %s", cmdbuff);
    10   return owl_cmddict_execute(owl_global_get_cmddict(&g), 
     10  return owl_cmddict_execute(owl_global_get_cmddict(&g),
    1111                             owl_global_get_context(&g), cmdbuff);
    1212}
     
    198198  m=g_new(owl_message, 1);
    199199  owl_message_create_admin(m, header, body);
    200  
     200
    201201  /* add it to the global list and current view */
    202202  owl_messagelist_append_element(owl_global_get_msglist(&g), m);
     
    250250  /* error if we're not logged into aim */
    251251  if (!owl_global_is_aimloggedin(&g)) return(NULL);
    252  
     252
    253253  m=g_new(owl_message, 1);
    254254  owl_message_create_aim(m,
     
    455455  if (unwrap)
    456456    owl_text_wordunwrap(format_msg);
    457  
     457
    458458  /* send the message */
    459459  ret=owl_aim_send_im(to, format_msg);
     
    485485  format_msg=g_strdup(msg);
    486486  owl_text_wordunwrap(format_msg);
    487  
     487
    488488  /* send the message */
    489489  ret=owl_aim_send_awaymsg(to, format_msg);
     
    534534
    535535/* If filter is non-null, looks for the next message matching
    536  * that filter.  If skip_deleted, skips any deleted messages. 
     536 * that filter.  If skip_deleted, skips any deleted messages.
    537537 * If last_if_none, will stop at the last message in the view
    538538 * if no matching messages are found.  */
     
    707707
    708708  if (move_after) {
    709     /* move the poiner in the appropriate direction 
     709    /* move the poiner in the appropriate direction
    710710     * to the next undeleted msg */
    711711    if (owl_global_get_direction(&g)==OWL_DIRECTION_UPWARDS) {
     
    723723
    724724  v=owl_global_get_current_view(&g);
    725  
     725
    726726  if (owl_view_get_size(v) < 1) {
    727727    owl_function_error("No current message to undelete");
     
    801801
    802802  owl_function_redisplay_to_nearest(lastmsgid, v);
    803  
     803
    804804  owl_function_makemsg("Messages expunged");
    805805}
     
    820820  v=owl_global_get_current_view(&g);
    821821  oldcurmsg=owl_global_get_curmsg(&g);
    822   curmsg=owl_view_get_size(v)-1; 
     822  curmsg=owl_view_get_size(v)-1;
    823823  if (curmsg<0) curmsg=0;
    824824  owl_global_set_curmsg(&g, curmsg);
     
    830830    owl_global_set_topmsg(&g, curmsg+1);
    831831    owl_global_set_curmsg(&g, curmsg+1);
    832   } 
     832  }
    833833  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    834834  owl_global_set_direction_downwards(&g);
     
    995995{
    996996  char *ret;
    997  
     997
    998998  /* zlog out if we need to */
    999999  if (owl_global_is_havezephyr(&g) &&
     
    10101010    kill(owl_global_get_newmsgproc_pid(&g), SIGHUP);
    10111011  }
    1012  
     1012
    10131013  /* Quit AIM */
    10141014  if (owl_global_is_aimloggedin(&g)) {
     
    10601060}
    10611061
    1062 /* Returns what the new topmsg should be. 
    1063  * Passed the last direction of movement, 
     1062/* Returns what the new topmsg should be.
     1063 * Passed the last direction of movement,
    10641064 * the current view,
    10651065 * the current message number in the view,
     
    10741074int owl_function_calculate_topmsg_neartop(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines)
    10751075{
    1076   if (curmsg>0 
     1076  if (curmsg>0
    10771077      && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1))
    10781078          <  recwinlines/2)) {
     
    10821082  }
    10831083}
    1084  
     1084
    10851085int owl_function_calculate_topmsg_center(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines)
    10861086{
     
    10961096  return(last);
    10971097}
    1098  
     1098
    10991099int owl_function_calculate_topmsg_paged(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page)
    11001100{
    11011101  int i, last, lines, savey;
    1102  
    1103   /* If we're off the top of the screen, scroll up such that the 
     1102
     1103  /* If we're off the top of the screen, scroll up such that the
    11041104   * curmsg is near the botton of the screen. */
    11051105  if (curmsg < topmsg) {
     
    11421142
    11431143  if (curmsg<0) return(topmsg);
    1144    
     1144
    11451145  /* If we're off the top of the screen then center */
    11461146  if (curmsg<topmsg) {
     
    11671167    direction=OWL_DIRECTION_UPWARDS;
    11681168  }
    1169  
     1169
    11701170  /* If our bottom line is less than 1/4 down the screen then scroll up */
    11711171  if (direction == OWL_DIRECTION_UPWARDS || direction == OWL_DIRECTION_NONE) {
     
    13861386
    13871387  owl_fmtext_init_null(&fm);
    1388  
     1388
    13891389  v=owl_global_get_current_view(&g);
    13901390  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     
    14221422  if (owl_message_is_type_zephyr(m)) {
    14231423    owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n");
    1424    
     1424
    14251425    owl_fmtext_appendf_normal(&fm, "  Class     : %s\n", owl_message_get_class(m));
    14261426    owl_fmtext_appendf_normal(&fm, "  Instance  : %s\n", owl_message_get_instance(m));
     
    14931493  owl_message_attributes_tofmtext(m, &attrfm);
    14941494  owl_fmtext_append_fmtext(&fm, &attrfm);
    1495  
     1495
    14961496  owl_function_popless_fmtext(&fm);
    14971497  owl_fmtext_cleanup(&fm);
     
    15481548      return;
    15491549    }
    1550    
     1550
    15511551    /* Bail if we're not truncated */
    15521552    if (!owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) {
     
    15551555    }
    15561556  }
    1557  
    1558  
     1557
     1558
    15591559  /* don't scroll past the last line */
    15601560  if (step>0) {
     
    15741574    }
    15751575  }
    1576  
     1576
    15771577  /* redisplay */
    15781578  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     
    16171617    owl_function_popless_text("Error getting subscriptions");
    16181618  }
    1619            
     1619
    16201620  g_free(buff);
    16211621}
     
    16581658  const owl_variable *v;
    16591659  GPtrArray *varnames;
    1660   owl_fmtext fm; 
     1660  owl_fmtext fm;
    16611661  int i;
    16621662  const char *varname;
    16631663
    16641664  owl_fmtext_init_null(&fm);
    1665   owl_fmtext_append_bold(&fm, 
     1665  owl_fmtext_append_bold(&fm,
    16661666      "Variables: (use 'show variable <name>' for details)\n");
    16671667  varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g));
     
    16811681{
    16821682  const owl_variable *v;
    1683   owl_fmtext fm; 
     1683  owl_fmtext fm;
    16841684
    16851685  owl_fmtext_init_null(&fm);
     
    18191819  owl_fmtext_append_normal(&fm, "no\n");
    18201820#endif
    1821  
     1821
    18221822
    18231823  owl_fmtext_append_normal(&fm, "\nAIM Status:\n");
     
    18721872  const owl_message *m;
    18731873  const owl_filter *f;
    1874  
     1874
    18751875  if (owl_view_get_size(owl_global_get_current_view(&g))==0) {
    18761876    owl_function_error("No message selected");
    18771877  } else {
    18781878    char *cmd;
    1879    
     1879
    18801880    m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g));
    18811881    if (!m) {
     
    20202020#if OWL_STDERR_REDIR
    20212021  redirect = " < /dev/null";
    2022 #endif 
     2022#endif
    20232023
    20242024  if (argc<2) {
     
    20362036    out = owl_slurp(p);
    20372037    pclose(p);
    2038    
     2038
    20392039    if (type == OWL_OUTPUT_RETURN) {
    20402040      g_free(newbuff);
     
    20672067
    20682068  perlout = owl_perlconfig_execute(buff);
    2069   if (perlout) { 
     2069  if (perlout) {
    20702070    if (type == OWL_OUTPUT_POPUP) {
    20712071      owl_function_popless_text(perlout);
     
    21142114  /* Figure out what to set the current message to.
    21152115   * - If the view we're leaving has messages in it, go to the closest message
    2116    *   to the last message pointed to in that view. 
     2116   *   to the last message pointed to in that view.
    21172117   * - If the view we're leaving is empty, try to restore the position
    21182118   *   from the last time we were in the new view.  */
     
    22272227
    22282228  owl_function_debugmsg("owl_function_create_negative_filter");
    2229  
     2229
    22302230  if (!strncmp(filtername, "not-", 4)) {
    22312231    newname=g_strdup(filtername+4);
     
    23162316 * If 'related' is nonzero, encompass unclasses and .d classes as well.
    23172317 */
    2318 CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 
     2318CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related)
    23192319{
    23202320  owl_filter *f;
     
    23502350    }
    23512351  }
    2352  
     2352
    23532353  /* if it already exists then go with it.  This lets users override */
    23542354  if (owl_global_get_filter(&g, filtname)) {
     
    25402540  owl_function_makemsg("%i messages marked for %sdeletion", j, flag?"":"un");
    25412541
    2542   owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
     2542  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    25432543}
    25442544
     
    25882588 * If the curmsg is a zephyr class message, instance foo, recip *,
    25892589 *    return a filter name to the class, inst.
    2590  * If the curmsg is a zephyr class message and type==0 then 
     2590 * If the curmsg is a zephyr class message and type==0 then
    25912591 *    return a filter name for just the class.
    2592  * If the curmsg is a zephyr class message and type==1 then 
     2592 * If the curmsg is a zephyr class message and type==1 then
    25932593 *    return a filter name for the class and instance.
    25942594 * If the curmsg is a personal AIM message returna  filter
    2595  *    name to the AIM conversation with that user 
     2595 *    name to the AIM conversation with that user
    25962596 */
    25972597CALLER_OWN char *owl_function_smartfilter(int type, int invert_related)
     
    26702670void owl_function_smartzpunt(int type)
    26712671{
    2672   /* Starts a zpunt command based on the current class,instance pair. 
     2672  /* Starts a zpunt command based on the current class,instance pair.
    26732673   * If type=0, uses just class.  If type=1, uses instance as well. */
    26742674  const owl_view *v;
     
    26762676  const char *mclass, *minst;
    26772677  GString *buf;
    2678  
     2678
    26792679  v=owl_global_get_current_view(&g);
    26802680  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     
    27592759  }
    27602760  owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor));
    2761  
     2761
    27622762  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    27632763  return(0);
     
    27672767{
    27682768  owl_fmtext fm;
    2769   int i; 
    2770  
     2769  int i;
     2770
    27712771  owl_fmtext_init_null(&fm);
    27722772  owl_fmtext_append_normal(&fm,"default:  ");
     
    28052805     g_free(str2);
    28062806  }
    2807  
     2807
    28082808  owl_function_popless_fmtext(&fm);
    28092809  owl_fmtext_cleanup(&fm);
     
    29232923  }
    29242924  owl_fmtext_append_normal(&fm, "\n");
    2925  
     2925
    29262926  owl_function_popless_fmtext(&fm);
    29272927  owl_ptr_array_free(l, g_free);
     
    29312931CALLER_OWN char *owl_function_keymap_summary(const char *name)
    29322932{
    2933   const owl_keymap *km 
     2933  const owl_keymap *km
    29342934    = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name);
    29352935  if (km) return owl_keymap_summary(km);
     
    29492949  } else {
    29502950    owl_fmtext_append_normal(&fm, "No such keymap...\n");
    2951   } 
     2951  }
    29522952  owl_function_popless_fmtext(&fm);
    29532953  owl_fmtext_cleanup(&fm);
     
    29602960  owl_fmtext_init_null(&fm);
    29612961  owl_cmd_get_help(owl_global_get_cmddict(&g), cmdname, &fm);
    2962   owl_function_popless_fmtext(&fm); 
     2962  owl_function_popless_fmtext(&fm);
    29632963  owl_fmtext_cleanup(&fm);
    29642964}
     
    29932993  viewsize=owl_view_get_size(v);
    29942994  curmsg=owl_global_get_curmsg(&g);
    2995  
     2995
    29962996  if (viewsize==0) {
    29972997    owl_function_makemsg("No messages present");
     
    30413041}
    30423042
    3043 /* strips formatting from ztext and returns the unformatted text. 
     3043/* strips formatting from ztext and returns the unformatted text.
    30443044 * caller is responsible for freeing. */
    30453045CALLER_OWN char *owl_function_ztext_stylestrip(const char *zt)
     
    31673167
    31683168/* Dump messages in the current view to the file 'filename'. */
    3169 void owl_function_dump(const char *filename) 
     3169void owl_function_dump(const char *filename)
    31703170{
    31713171  int i, j;
     
    32213221      }
    32223222    }
    3223    
     3223
    32243224    /* if it exited, spawn a new one */
    32253225    if (owl_global_get_newmsgproc_pid(&g)==0) {
  • global.c

    r0792d99 r7869e48  
    5555  g->lastinputtime=g->starttime;
    5656  g->newmsgproc_pid=0;
    57  
     57
    5858  owl_global_set_config_format(g, 0);
    5959  owl_global_set_no_have_config(g);
     
    596596int owl_global_should_followlast(owl_global *g) {
    597597  const owl_view *v;
    598  
     598
    599599  if (!owl_global_is__followlast(g)) return(0);
    600  
     600
    601601  v=owl_global_get_current_view(g);
    602  
     602
    603603  if (owl_global_get_curmsg(g)==owl_view_get_size(v)-1) return(1);
    604604  return(0);
     
    743743  return(&(g->buddylist));
    744744}
    745  
     745
    746746/* style */
    747747
  • help.c

    rd6b8b50 r7869e48  
    1111  owl_fmtext_init_null(&fm);
    1212  owl_fmtext_append_bold
    13     (&fm, 
     13    (&fm,
    1414     "OWL HELP\n\n");
    1515
    1616  owl_fmtext_append_normal
    17     (&fm, 
     17    (&fm,
    1818     "  If you're new to BarnOwl, the first thing you should type is\n\n"
    1919     "    :show quickstart\n\n"
     
    2424
    2525  owl_fmtext_append_bold
    26     (&fm, 
     26    (&fm,
    2727     "  Basic Keys:\n"
    2828     );
    2929  owl_fmtext_append_normal
    30     (&fm, 
     30    (&fm,
    3131     "    n             Move to next non-deleted message\n"
    3232     "    p             Move to previous non-deleted message\n"
     
    7878     );
    7979  owl_fmtext_append_bold
    80     (&fm, 
     80    (&fm,
    8181     "  Basic Commands:\n"
    8282     );
    8383  owl_fmtext_append_normal
    84     (&fm, 
     84    (&fm,
    8585     "    quit, exit    Exit BarnOwl\n"
    8686     "    help          Get help about commands\n"
     
    125125     "    version       Print the version number of BarnOwl\n"
    126126     "\n");
    127  
     127
    128128  /* help for variables */
    129   owl_fmtext_append_bold(&fm, 
     129  owl_fmtext_append_bold(&fm,
    130130                         "Variables:\n");
    131131  varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g));
  • keybinding.c

    rf271129 r7869e48  
    22
    33/*
    4  * TODO: Idea for allowing functions to be user-specified --- 
    5  *      Have function have a context bitmask that says where it 
     4 * TODO: Idea for allowing functions to be user-specified ---
     5 *      Have function have a context bitmask that says where it
    66 *      can be used, and have keymaps also have one, and compare
    77 *      the two when setting.
    8  *     
     8 *
    99 */
    1010
  • keymap.c

    rf271129 r7869e48  
    4141    return -1;
    4242  /* see if another matching binding, and if so remove it.
    43    * otherwise just add this one. 
     43   * otherwise just add this one.
    4444   */
    4545  for (i = km->bindings->len-1; i >= 0; i--) {
     
    9999    owl_fmtext_append_normal(fm, "\n");
    100100  if (km->default_fn) {
    101     owl_fmtext_append_normal(fm, OWL_TABSTR 
     101    owl_fmtext_append_normal(fm, OWL_TABSTR
    102102     "Has a default keypress handler (default_fn).\n");
    103103  }
     
    107107  }
    108108  if (km->postalways_fn) {
    109     owl_fmtext_append_normal(fm, OWL_TABSTR 
     109    owl_fmtext_append_normal(fm, OWL_TABSTR
    110110     "Executes a function (postalways_fn) after handling every keypress.\n");
    111111  }
    112112
    113   owl_fmtext_append_bold(fm, "\nKey bindings:\n\n"); 
     113  owl_fmtext_append_bold(fm, "\nKey bindings:\n\n");
    114114  if (recurse) {
    115115    _owl_keymap_format_with_parents(km, fm);
     
    136136  int i;
    137137  const owl_keybinding *kb;
    138  
     138
    139139  for (i = 0; i < km->bindings->len; i++) {
    140140    char *kbstr;
     
    160160      owl_fmtext_append_normal(fm, kb->command);
    161161      owl_fmtext_append_normal(fm, "]");
    162     } 
     162    }
    163163    owl_fmtext_append_normal(fm, "\n");
    164164  }
     
    249249    kh->in_esc = 0;
    250250  }
    251  
     251
    252252  kh->kpstack[++(kh->kpstackpos)] = j.ch;
    253253  if (kh->kpstackpos >= OWL_KEYMAP_MAXSTACK) {
     
    301301  owl_keyhandler_invalidkey(kh);
    302302  /* unable to handle */
    303   return(1); 
     303  return(1);
    304304}
    305305
  • keypress.c

    rf271129 r7869e48  
    66} specialmap[] = {
    77#ifdef KEY_CODE_YES
    8    { KEY_CODE_YES,      "CODE_YES" }, 
     8   { KEY_CODE_YES,      "CODE_YES" },
    99#endif
    10    { KEY_MIN,           "MIN" }, 
    11    { KEY_BREAK,         "BREAK" }, 
    12    { KEY_DOWN,          "DOWN" }, 
    13    { KEY_UP,            "UP" }, 
    14    { KEY_LEFT,          "LEFT" }, 
    15    { KEY_RIGHT,         "RIGHT" }, 
    16    { KEY_HOME,          "HOME" }, 
    17    { KEY_BACKSPACE,     "BACKSPACE" }, 
    18    { KEY_F0,            "F0" }, 
    19    { KEY_F(1),          "F1" }, 
    20    { KEY_F(2),          "F2" }, 
    21    { KEY_F(3),          "F3" }, 
    22    { KEY_F(4),          "F4" }, 
    23    { KEY_F(5),          "F5" }, 
    24    { KEY_F(6),          "F6" }, 
    25    { KEY_F(7),          "F7" }, 
    26    { KEY_F(8),          "F8" }, 
    27    { KEY_F(9),          "F9" }, 
    28    { KEY_F(10),         "F10" }, 
    29    { KEY_F(11),         "F11" }, 
    30    { KEY_F(12),         "F12" }, 
    31    { KEY_DL,            "DL" }, 
    32    { KEY_IL,            "IL" }, 
    33    { KEY_DC,            "DC" }, 
    34    { KEY_IC,            "IC" }, 
    35    { KEY_EIC,           "EIC" }, 
    36    { KEY_CLEAR,         "CLEAR" }, 
    37    { KEY_EOS,           "EOS" }, 
    38    { KEY_EOL,           "EOL" }, 
    39    { KEY_SF,            "SF" }, 
    40    { KEY_SR,            "SR" }, 
    41    { KEY_NPAGE,         "NPAGE" }, 
    42    { KEY_PPAGE,         "PPAGE" }, 
    43    { KEY_STAB,          "STAB" }, 
    44    { KEY_CTAB,          "CTAB" }, 
    45    { KEY_CATAB,         "CATAB" }, 
    46    { KEY_ENTER,         "ENTER" }, 
    47    { KEY_SRESET,        "SRESET" }, 
    48    { KEY_RESET,         "RESET" }, 
    49    { KEY_PRINT,         "PRINT" }, 
    50    { KEY_LL,            "LL" }, 
    51    { KEY_A1,            "A1" }, 
    52    { KEY_A3,            "A3" }, 
    53    { KEY_B2,            "B2" }, 
    54    { KEY_C1,            "C1" }, 
    55    { KEY_C3,            "C3" }, 
    56    { KEY_BTAB,          "BTAB" }, 
    57    { KEY_BEG,           "BEG" }, 
    58    { KEY_CANCEL,        "CANCEL" }, 
    59    { KEY_CLOSE,         "CLOSE" }, 
    60    { KEY_COMMAND,       "COMMAND" }, 
    61    { KEY_COPY,          "COPY" }, 
    62    { KEY_CREATE,        "CREATE" }, 
    63    { KEY_END,           "END" }, 
    64    { KEY_EXIT,          "EXIT" }, 
    65    { KEY_FIND,          "FIND" }, 
    66    { KEY_HELP,          "HELP" }, 
    67    { KEY_MARK,          "MARK" }, 
    68    { KEY_MESSAGE,       "MESSAGE" }, 
    69    { KEY_MOVE,          "MOVE" }, 
    70    { KEY_NEXT,          "NEXT" }, 
    71    { KEY_OPEN,          "OPEN" }, 
    72    { KEY_OPTIONS,       "OPTIONS" }, 
    73    { KEY_PREVIOUS,      "PREVIOUS" }, 
    74    { KEY_REDO,          "REDO" }, 
    75    { KEY_REFERENCE,     "REFERENCE" }, 
    76    { KEY_REFRESH,       "REFRESH" }, 
    77    { KEY_REPLACE,       "REPLACE" }, 
    78    { KEY_RESTART,       "RESTART" }, 
    79    { KEY_RESUME,        "RESUME" }, 
    80    { KEY_SAVE,          "SAVE" }, 
    81    { KEY_SBEG,          "SBEG" }, 
    82    { KEY_SCANCEL,       "SCANCEL" }, 
    83    { KEY_SCOMMAND,      "SCOMMAND" }, 
    84    { KEY_SCOPY,         "SCOPY" }, 
    85    { KEY_SCREATE,       "SCREATE" }, 
    86    { KEY_SDC,           "SDC" }, 
    87    { KEY_SDL,           "SDL" }, 
    88    { KEY_SELECT,        "SELECT" }, 
    89    { KEY_SEND,          "SEND" }, 
    90    { KEY_SEOL,          "SEOL" }, 
    91    { KEY_SEXIT,         "SEXIT" }, 
    92    { KEY_SFIND,         "SFIND" }, 
    93    { KEY_SHELP,         "SHELP" }, 
    94    { KEY_SHOME,         "SHOME" }, 
    95    { KEY_SIC,           "SIC" }, 
    96    { KEY_SLEFT,         "SLEFT" }, 
    97    { KEY_SMESSAGE,      "SMESSAGE" }, 
    98    { KEY_SMOVE,         "SMOVE" }, 
    99    { KEY_SNEXT,         "SNEXT" }, 
    100    { KEY_SOPTIONS,      "SOPTIONS" }, 
    101    { KEY_SPREVIOUS,     "SPREVIOUS" }, 
    102    { KEY_SPRINT,        "SPRINT" }, 
    103    { KEY_SREDO,         "SREDO" }, 
    104    { KEY_SREPLACE,      "SREPLACE" }, 
    105    { KEY_SRIGHT,        "SRIGHT" }, 
    106    { KEY_SRSUME,        "SRSUME" }, 
    107    { KEY_SSAVE,         "SSAVE" }, 
    108    { KEY_SSUSPEND,      "SSUSPEND" }, 
    109    { KEY_SUNDO,         "SUNDO" }, 
    110    { KEY_SUSPEND,       "SUSPEND" }, 
    111    { KEY_UNDO,          "UNDO" }, 
    112    { KEY_MOUSE,         "MOUSE" }, 
     10   { KEY_MIN,           "MIN" },
     11   { KEY_BREAK,         "BREAK" },
     12   { KEY_DOWN,          "DOWN" },
     13   { KEY_UP,            "UP" },
     14   { KEY_LEFT,          "LEFT" },
     15   { KEY_RIGHT,         "RIGHT" },
     16   { KEY_HOME,          "HOME" },
     17   { KEY_BACKSPACE,     "BACKSPACE" },
     18   { KEY_F0,            "F0" },
     19   { KEY_F(1),          "F1" },
     20   { KEY_F(2),          "F2" },
     21   { KEY_F(3),          "F3" },
     22   { KEY_F(4),          "F4" },
     23   { KEY_F(5),          "F5" },
     24   { KEY_F(6),          "F6" },
     25   { KEY_F(7),          "F7" },
     26   { KEY_F(8),          "F8" },
     27   { KEY_F(9),          "F9" },
     28   { KEY_F(10),         "F10" },
     29   { KEY_F(11),         "F11" },
     30   { KEY_F(12),         "F12" },
     31   { KEY_DL,            "DL" },
     32   { KEY_IL,            "IL" },
     33   { KEY_DC,            "DC" },
     34   { KEY_IC,            "IC" },
     35   { KEY_EIC,           "EIC" },
     36   { KEY_CLEAR,         "CLEAR" },
     37   { KEY_EOS,           "EOS" },
     38   { KEY_EOL,           "EOL" },
     39   { KEY_SF,            "SF" },
     40   { KEY_SR,            "SR" },
     41   { KEY_NPAGE,         "NPAGE" },
     42   { KEY_PPAGE,         "PPAGE" },
     43   { KEY_STAB,          "STAB" },
     44   { KEY_CTAB,          "CTAB" },
     45   { KEY_CATAB,         "CATAB" },
     46   { KEY_ENTER,         "ENTER" },
     47   { KEY_SRESET,        "SRESET" },
     48   { KEY_RESET,         "RESET" },
     49   { KEY_PRINT,         "PRINT" },
     50   { KEY_LL,            "LL" },
     51   { KEY_A1,            "A1" },
     52   { KEY_A3,            "A3" },
     53   { KEY_B2,            "B2" },
     54   { KEY_C1,            "C1" },
     55   { KEY_C3,            "C3" },
     56   { KEY_BTAB,          "BTAB" },
     57   { KEY_BEG,           "BEG" },
     58   { KEY_CANCEL,        "CANCEL" },
     59   { KEY_CLOSE,         "CLOSE" },
     60   { KEY_COMMAND,       "COMMAND" },
     61   { KEY_COPY,          "COPY" },
     62   { KEY_CREATE,        "CREATE" },
     63   { KEY_END,           "END" },
     64   { KEY_EXIT,          "EXIT" },
     65   { KEY_FIND,          "FIND" },
     66   { KEY_HELP,          "HELP" },
     67   { KEY_MARK,          "MARK" },
     68   { KEY_MESSAGE,       "MESSAGE" },
     69   { KEY_MOVE,          "MOVE" },
     70   { KEY_NEXT,          "NEXT" },
     71   { KEY_OPEN,          "OPEN" },
     72   { KEY_OPTIONS,       "OPTIONS" },
     73   { KEY_PREVIOUS,      "PREVIOUS" },
     74   { KEY_REDO,          "REDO" },
     75   { KEY_REFERENCE,     "REFERENCE" },
     76   { KEY_REFRESH,       "REFRESH" },
     77   { KEY_REPLACE,       "REPLACE" },
     78   { KEY_RESTART,       "RESTART" },
     79   { KEY_RESUME,        "RESUME" },
     80   { KEY_SAVE,          "SAVE" },
     81   { KEY_SBEG,          "SBEG" },
     82   { KEY_SCANCEL,       "SCANCEL" },
     83   { KEY_SCOMMAND,      "SCOMMAND" },
     84   { KEY_SCOPY,         "SCOPY" },
     85   { KEY_SCREATE,       "SCREATE" },
     86   { KEY_SDC,           "SDC" },
     87   { KEY_SDL,           "SDL" },
     88   { KEY_SELECT,        "SELECT" },
     89   { KEY_SEND,          "SEND" },
     90   { KEY_SEOL,          "SEOL" },
     91   { KEY_SEXIT,         "SEXIT" },
     92   { KEY_SFIND,         "SFIND" },
     93   { KEY_SHELP,         "SHELP" },
     94   { KEY_SHOME,         "SHOME" },
     95   { KEY_SIC,           "SIC" },
     96   { KEY_SLEFT,         "SLEFT" },
     97   { KEY_SMESSAGE,      "SMESSAGE" },
     98   { KEY_SMOVE,         "SMOVE" },
     99   { KEY_SNEXT,         "SNEXT" },
     100   { KEY_SOPTIONS,      "SOPTIONS" },
     101   { KEY_SPREVIOUS,     "SPREVIOUS" },
     102   { KEY_SPRINT,        "SPRINT" },
     103   { KEY_SREDO,         "SREDO" },
     104   { KEY_SREPLACE,      "SREPLACE" },
     105   { KEY_SRIGHT,        "SRIGHT" },
     106   { KEY_SRSUME,        "SRSUME" },
     107   { KEY_SSAVE,         "SSAVE" },
     108   { KEY_SSUSPEND,      "SSUSPEND" },
     109   { KEY_SUNDO,         "SUNDO" },
     110   { KEY_SUSPEND,       "SUSPEND" },
     111   { KEY_UNDO,          "UNDO" },
     112   { KEY_MOUSE,         "MOUSE" },
    113113#ifdef KEY_RESIZE
    114    { KEY_RESIZE,        "RESIZE" }, 
     114   { KEY_RESIZE,        "RESIZE" },
    115115#endif
    116    { KEY_MAX,           "MAX" }, 
    117    { ' ',               "SPACE" }, 
    118    { 27,                "ESCAPE" }, 
    119    { 127,               "DELETE" }, 
    120    { '\r',              "CR" }, 
     116   { KEY_MAX,           "MAX" },
     117   { ' ',               "SPACE" },
     118   { 27,                "ESCAPE" },
     119   { 127,               "DELETE" },
     120   { '\r',              "CR" },
    121121   { '\n',              "LF" },
    122    { '\t',              "TAB" }, 
     122   { '\t',              "TAB" },
    123123   { 0,                 NULL }
    124124};
     
    157157      g_string_append_c(kb, j);
    158158    }
    159    
    160   } 
     159
     160  }
    161161  if (!kb->str[0]) {
    162162    /* not a valid key */
  • keys.c

    rdcd48ad r7869e48  
    1313    *km_ew_multi, *km_ew_onel, *km_viewwin;
    1414
    15  
     15
    1616  /****************************************************************/
    1717  /*************************** GLOBAL *****************************/
     
    1919
    2020  km_global = km = owl_keyhandler_create_and_add_keymap(kh, "global",
    21        "System-wide default key bindings", 
     21       "System-wide default key bindings",
    2222       owl_keys_default_invalid, NULL, NULL);
    2323  BIND_CMD("C-z",      "message Use :suspend to suspend.", "");
     
    2828
    2929  km_editwin = km = owl_keyhandler_create_and_add_keymap(kh, "edit",
    30        "Text editing and command window", 
     30       "Text editing and command window",
    3131       owl_keys_editwin_default, NULL, owl_keys_editwin_postalways);
    3232  owl_keymap_set_parent(km_editwin, km_global);
     
    9797
    9898  km_ew_multi = km = owl_keyhandler_create_and_add_keymap(kh, "editmulti",
    99        "Multi-line text editing", 
     99       "Multi-line text editing",
    100100       owl_keys_editwin_default, NULL, owl_keys_editwin_postalways);
    101101  owl_keymap_set_parent(km_ew_multi, km_editwin);
     
    117117  BIND_CMD("M-n",         "edit:history-next", "");
    118118
    119   /* note that changing "disable-ctrl-d" to "on" will change this to 
     119  /* note that changing "disable-ctrl-d" to "on" will change this to
    120120   * edit:delete-next-char */
    121121  BIND_CMD("C-d",     "edit:done-or-delete", "sends the zephyr if at the end of the message");
     
    127127
    128128  km_ew_onel = km = owl_keyhandler_create_and_add_keymap(kh, "editline",
    129        "Single-line text editing", 
     129       "Single-line text editing",
    130130       owl_keys_editwin_default, NULL, owl_keys_editwin_postalways);
    131131  owl_keymap_set_parent(km_ew_onel, km_editwin);
     
    146146  BIND_CMD("CR",          "editline:done", "executes the command");
    147147
    148  
     148
    149149  /****************************************************************/
    150150  /**************************** EDITRESPONSE **********************/
     
    152152
    153153  km_ew_onel = km = owl_keyhandler_create_and_add_keymap(kh, "editresponse",
    154        "Single-line response to question", 
     154       "Single-line response to question",
    155155       owl_keys_editwin_default, NULL, owl_keys_editwin_postalways);
    156156  owl_keymap_set_parent(km_ew_onel, km_editwin);
     
    167167
    168168  km_viewwin = km = owl_keyhandler_create_and_add_keymap(kh, "popless",
    169        "Pop-up window (eg, help)", 
     169       "Pop-up window (eg, help)",
    170170       owl_keys_default_invalid, NULL, owl_keys_popless_postalways);
    171171  owl_keymap_set_parent(km_viewwin, km_global);
     
    261261  BIND_CMD("M-M", "smartnarrow -ri",  "like M-N but with 'narrow-related' temporarily flipped.");
    262262  BIND_CMD("M-p", "view personal", "");
    263  
     263
    264264  BIND_CMD("/",   "start-command search ", "start a search command");
    265265  BIND_CMD("?",   "start-command search -r ", "start a reverse search command");
     
    273273  BIND_CMD("C-n",    "recv:next",      "");
    274274  BIND_CMD("M-[ B",  "recv:next",      "");
    275   BIND_CMD("M-C-n",  "recv:next --smart-filter", "move to next message matching the current one"); 
     275  BIND_CMD("M-C-n",  "recv:next --smart-filter", "move to next message matching the current one");
    276276  BIND_CMD("UP",     "recv:prev",      "");
    277277  BIND_CMD("M-[ A",  "recv:prev",      "");
  • libfaim/admin.c

    rcf02dd6 r7869e48  
    22 * Family 0x0007 - Account Administration.
    33 *
    4  * Used for stuff like changing the formating of your screen name, changing your 
    5  * email address, requesting an account confirmation email, getting account info, 
     4 * Used for stuff like changing the formating of your screen name, changing your
     5 * email address, requesting an account confirmation email, getting account info,
    66 *
    77 */
     
    1818 * 0x0013 - Unknown
    1919 *
    20  */ 
     20 */
    2121faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info)
    2222{
     
    4141 * Subtypes 0x0003 and 0x0005 - Parse account info.
    4242 *
    43  * Called in reply to both an information request (subtype 0x0002) and 
     43 * Called in reply to both an information request (subtype 0x0002) and
    4444 * an information change (subtype 0x0004).
    4545 *
     
    112112
    113113        aim_tlvlist_add_raw(&tl, 0x0001, strlen(newnick), newnick);
    114        
     114
    115115        aim_tlvlist_write(&fr->data, &tl);
    116116        aim_tlvlist_free(&tl);
    117        
     117
    118118        aim_tx_enqueue(sess, fr);
    119119
     
    169169
    170170        aim_tlvlist_add_raw(&tl, 0x0011, strlen(newemail), newemail);
    171        
     171
    172172        aim_tlvlist_write(&fr->data, &tl);
    173173        aim_tlvlist_free(&tl);
    174        
     174
    175175        aim_tx_enqueue(sess, fr);
    176176
  • libfaim/aim.h

    rfe73d0c r7869e48  
    1 /* 
     1/*
    22 * Main libfaim header.  Must be included in client for prototypes/macros.
    33 *
     
    5151
    5252#if defined(mach) && defined(__APPLE__)
    53 #define gethostbyname(x) gethostbyname2(x, AF_INET) 
     53#define gethostbyname(x) gethostbyname2(x, AF_INET)
    5454#endif
    5555
     
    5757/*
    5858 * For a win32 DLL, we define WIN32_INDLL if this file
    59  * is included while compiling the DLL. If its not 
     59 * is included while compiling the DLL. If its not
    6060 * defined (its included in a client app), the symbols
    6161 * will be imported instead of exported.
     
    6363#ifdef WIN32_INDLL
    6464#define faim_export __declspec(dllexport)
    65 #else 
     65#else
    6666#define faim_export __declspec(dllimport)
    6767#endif /* WIN32_INDLL */
     
    8383#endif
    8484
    85 /* 
    86  * Current Maximum Length for Screen Names (not including NULL) 
     85/*
     86 * Current Maximum Length for Screen Names (not including NULL)
    8787 *
    8888 * Currently only names up to 16 characters can be registered
     
    104104 *
    105105 * XXX: the real limit is the total SNAC size at 8192. Fix this.
    106  * 
     106 *
    107107 */
    108108#define MAXMSGLEN 7987
     
    118118 *
    119119 * This is actually defined by the protocol to be
    120  * dynamic, but I have yet to see due cause to 
     120 * dynamic, but I have yet to see due cause to
    121121 * define it dynamically here.  Maybe later.
    122122 *
     
    132132
    133133/*
    134  * Client info.  Filled in by the client and passed in to 
     134 * Client info.  Filled in by the client and passed in to
    135135 * aim_send_login().  The information ends up getting passed to OSCAR
    136136 * through the initial login command.
     
    277277#define CLIENTINFO_ICQ_KNOWNGOOD CLIENTINFO_ICQ_5_45_3777
    278278
    279 /* 
    280  * These could be arbitrary, but its easier to use the actual AIM values 
     279/*
     280 * These could be arbitrary, but its easier to use the actual AIM values
    281281 */
    282282#define AIM_CONN_TYPE_BOS               0x0002
     
    323323        void *internal; /* internal conn-specific libfaim data */
    324324        time_t lastactivity; /* time of last transmit */
    325         int forcedlatency; 
     325        int forcedlatency;
    326326        void *handlerlist;
    327327        void *sessv; /* pointer to parent session */
     
    353353        fu8_t hdrtype; /* defines which piece of the union to use */
    354354        union {
    355                 struct { 
     355                struct {
    356356                        fu8_t type;
    357                         flap_seqnum_t seqnum;     
     357                        flap_seqnum_t seqnum;
    358358                } flap;
    359359                struct {
     
    379379
    380380/*
    381  * AIM Session: The main client-data interface. 
     381 * AIM Session: The main client-data interface.
    382382 *
    383383 */
     
    390390
    391391        /*
    392          * Pointer to anything the client wants to 
     392         * Pointer to anything the client wants to
    393393         * explicitly associate with this session.
    394394         *
     
    410410         * I/O.  I don't suggest that you use libfaim's internal I/O.
    411411         * Its really bad and the API/event model is quirky at best.
    412          * 
     412         *
    413413         */
    414         aim_frame_t *queue_outgoing;   
    415         aim_frame_t *queue_incoming; 
     414        aim_frame_t *queue_outgoing;
     415        aim_frame_t *queue_incoming;
    416416
    417417        /*
     
    439439
    440440        /*
    441          * Outstanding snac handling 
     441         * Outstanding snac handling
    442442         *
    443443         * XXX: Should these be per-connection? -mid
     
    764764/*
    765765 * This information is provided in the Incoming ICBM callback for
    766  * Channel 1 ICBM's. 
     766 * Channel 1 ICBM's.
    767767 *
    768768 * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they
     
    780780        aim_mpmsg_t mpmsg;
    781781        fu32_t icbmflags; /* some flags apply only to ->msg, not all mpmsg */
    782        
     782
    783783        /* Only provided if message has a human-readable section */
    784784        char *msg;
  • libfaim/aim_cbtypes.h

    rcf02dd6 r7869e48  
    3535/*
    3636 * SNAC Family: Ack.
    37  * 
     37 *
    3838 * Not really a family, but treating it as one really
    3939 * helps it fit into the libfaim callback structure better.
     
    4444/*
    4545 * SNAC Family: General.
    46  */ 
     46 */
    4747#define AIM_CB_GEN_ERROR 0x0001
    4848#define AIM_CB_GEN_CLIENTREADY 0x0002
     
    6969/*
    7070 * SNAC Family: Location Services.
    71  */ 
     71 */
    7272#define AIM_CB_LOC_ERROR 0x0001
    7373#define AIM_CB_LOC_REQRIGHTS 0x0002
     
    8282/*
    8383 * SNAC Family: Buddy List Management Services.
    84  */ 
     84 */
    8585#define AIM_CB_BUD_ERROR 0x0001
    8686#define AIM_CB_BUD_REQRIGHTS 0x0002
     
    9595/*
    9696 * SNAC Family: Messeging Services.
    97  */ 
     97 */
    9898#define AIM_CB_MSG_ERROR 0x0001
    9999#define AIM_CB_MSG_PARAMINFO 0x0005
     
    108108/*
    109109 * SNAC Family: Advertisement Services
    110  */ 
     110 */
    111111#define AIM_CB_ADS_ERROR 0x0001
    112112#define AIM_CB_ADS_DEFAULT 0xffff
     
    114114/*
    115115 * SNAC Family: Invitation Services.
    116  */ 
     116 */
    117117#define AIM_CB_INV_ERROR 0x0001
    118118#define AIM_CB_INV_DEFAULT 0xffff
     
    120120/*
    121121 * SNAC Family: Administrative Services.
    122  */ 
     122 */
    123123#define AIM_CB_ADM_ERROR 0x0001
    124124#define AIM_CB_ADM_INFOCHANGE_REPLY 0x0005
     
    127127/*
    128128 * SNAC Family: Popup Messages
    129  */ 
     129 */
    130130#define AIM_CB_POP_ERROR 0x0001
    131131#define AIM_CB_POP_DEFAULT 0xffff
     
    133133/*
    134134 * SNAC Family: Misc BOS Services.
    135  */ 
     135 */
    136136#define AIM_CB_BOS_ERROR 0x0001
    137137#define AIM_CB_BOS_RIGHTSQUERY 0x0002
     
    141141/*
    142142 * SNAC Family: User Lookup Services
    143  */ 
     143 */
    144144#define AIM_CB_LOK_ERROR 0x0001
    145145#define AIM_CB_LOK_DEFAULT 0xffff
     
    147147/*
    148148 * SNAC Family: User Status Services
    149  */ 
     149 */
    150150#define AIM_CB_STS_ERROR 0x0001
    151151#define AIM_CB_STS_SETREPORTINTERVAL 0x0002
     
    155155/*
    156156 * SNAC Family: Translation Services
    157  */ 
     157 */
    158158#define AIM_CB_TRN_ERROR 0x0001
    159159#define AIM_CB_TRN_DEFAULT 0xffff
     
    161161/*
    162162 * SNAC Family: Chat Navigation Services
    163  */ 
     163 */
    164164#define AIM_CB_CTN_ERROR 0x0001
    165165#define AIM_CB_CTN_CREATE 0x0008
     
    169169/*
    170170 * SNAC Family: Chat Services
    171  */ 
     171 */
    172172#define AIM_CB_CHT_ERROR 0x0001
    173173#define AIM_CB_CHT_ROOMINFOUPDATE 0x0002
     
    180180/*
    181181 * SNAC Family: "New" Search
    182  */ 
     182 */
    183183#define AIM_CB_SCH_ERROR 0x0001
    184184#define AIM_CB_SCH_SEARCH 0x0002
     
    187187/*
    188188 * SNAC Family: Buddy icons
    189  */ 
     189 */
    190190#define AIM_CB_ICO_ERROR 0x0001
    191191#define AIM_CB_ICO_REQUEST 0x0004
     
    196196 *
    197197 * Most of these are actually special.
    198  */ 
     198 */
    199199#define AIM_CB_ICQ_ERROR 0x0001
    200200#define AIM_CB_ICQ_OFFLINEMSG 0x00f0
     
    256256 * OFT Services
    257257 *
    258  * For all of the above #defines, the number is the subtype 
    259  * of the SNAC.  For OFT #defines, the number is the 
    260  * "hdrtype" which comes after the magic string and OFT 
     258 * For all of the above #defines, the number is the subtype
     259 * of the SNAC.  For OFT #defines, the number is the
     260 * "hdrtype" which comes after the magic string and OFT
    261261 * packet length.
    262262 *
    263  * I'm pretty sure the ODC ones are arbitrary right now, 
     263 * I'm pretty sure the ODC ones are arbitrary right now,
    264264 * that should be changed.
    265265 */
     
    292292 * the SNAC-centered libfaim callback structure.
    293293 *
    294  */ 
     294 */
    295295#define AIM_CB_SPECIAL_AUTHSUCCESS 0x0001
    296296#define AIM_CB_SPECIAL_AUTHOTHER 0x0002
  • libfaim/aim_internal.h

    rcf02dd6 r7869e48  
    144144};
    145145
    146 /* 
     146/*
    147147 * In SNACland, the terms 'family' and 'group' are synonymous -- the former
    148148 * is my term, the latter is AOL's.
     
    178178 * This is inside every connection.  But it is a void * to anything
    179179 * outside of libfaim.  It should remain that way.  It's called data
    180  * abstraction.  Maybe you've heard of it.  (Probably not if you're a 
     180 * abstraction.  Maybe you've heard of it.  (Probably not if you're a
    181181 * libfaim user.)
    182  * 
     182 *
    183183 */
    184184typedef struct aim_conn_inside_s {
  • libfaim/auth.c

    rcf02dd6 r7869e48  
    22 * Family 0x0017 - Authentication.
    33 *
    4  * Deals with the authorizer for SNAC-based login, and also old-style 
     4 * Deals with the authorizer for SNAC-based login, and also old-style
    55 * non-SNAC login.
    66 *
     
    2424 *
    2525 * The encoding_table seems to be a fixed set of values.  We'll
    26  * hope it doesn't change over time! 
     26 * hope it doesn't change over time!
    2727 *
    2828 * This is only used for the XOR method, not the better MD5 method.
     
    5959        md5_state_t state;
    6060
    61         md5_init(&state);       
     61        md5_init(&state);
    6262        md5_append(&state, (const md5_byte_t *)key, strlen(key));
    6363        md5_append(&state, (const md5_byte_t *)password, strlen(password));
     
    7777        md5_finish(&state, (md5_byte_t *)&passdigest);
    7878
    79         md5_init(&state);       
     79        md5_init(&state);
    8080        md5_append(&state, (const md5_byte_t *)key, strlen(key));
    8181        md5_append(&state, (const md5_byte_t *)&passdigest, 16);
     
    8888
    8989/*
    90  * The FLAP version is sent by itself at the beginning of authorization 
    91  * connections.  The FLAP version is also sent before the cookie when connecting 
     90 * The FLAP version is sent by itself at the beginning of authorization
     91 * connections.  The FLAP version is also sent before the cookie when connecting
    9292 * for other services (BOS, chatnav, chat, etc.).
    9393 */
     
    197197 *   build  = 0x0013
    198198 *   unknown= (not sent)
    199  *   
     199 *
    200200 * AIM for Linux 1.1.112:
    201201 *   clientstring = "AOL Instant Messenger (SM)"
     
    260260
    261261        aim_tlvlist_free(&tl);
    262        
     262
    263263        aim_tx_enqueue(sess, fr);
    264264
     
    269269 * This is sent back as a general response to the login command.
    270270 * It can be either an error or a success, depending on the
    271  * precense of certain TLVs. 
     271 * precense of certain TLVs.
    272272 *
    273273 * The client should check the value passed as errorcode. If
     
    303303         * have an error url.
    304304         */
    305         if (aim_tlv_gettlv(tlvlist, 0x0008, 1)) 
     305        if (aim_tlv_gettlv(tlvlist, 0x0008, 1))
    306306                info->errorcode = aim_tlv_get16(tlvlist, 0x0008, 1);
    307307        if (aim_tlv_gettlv(tlvlist, 0x0004, 1))
     
    329329         * The email address attached to this account
    330330         *   Not available for ICQ or @mac.com logins.
    331          *   If you receive this TLV, then you are allowed to use 
     331         *   If you receive this TLV, then you are allowed to use
    332332         *   family 0x0018 to check the status of your email.
    333333         * XXX - Not really true!
     
    436436        aim_frame_t fr;
    437437        aim_rxcallback_t userfunc;
    438        
     438
    439439        fr.conn = conn;
    440        
     440
    441441        if ((userfunc = aim_callhandler(sess, conn, 0x0017, 0x0007)))
    442442                userfunc(sess, &fr, "");
     
    448448 * Subtype 0x0006
    449449 *
    450  * In AIM 3.5 protocol, the first stage of login is to request login from the 
    451  * Authorizer, passing it the screen name for verification.  If the name is 
    452  * invalid, a 0017/0003 is spit back, with the standard error contents.  If 
    453  * valid, a 0017/0007 comes back, which is the signal to send it the main 
    454  * login command (0017/0002). 
     450 * In AIM 3.5 protocol, the first stage of login is to request login from the
     451 * Authorizer, passing it the screen name for verification.  If the name is
     452 * invalid, a 0017/0003 is spit back, with the standard error contents.  If
     453 * valid, a 0017/0007 comes back, which is the signal to send it the main
     454 * login command (0017/0002).
    455455 *
    456456 */
     
    460460        aim_snacid_t snacid;
    461461        aim_tlvlist_t *tl = NULL;
    462        
     462
    463463        if (!sess || !conn || !sn)
    464464                return -EINVAL;
     
    504504        keystr = aimbs_getstr(bs, keylen);
    505505
    506         /* XXX - When GiantGrayPanda signed on AIM I got a thing asking me to register 
    507          * for the netscape network.  This SNAC had a type 0x0058 TLV with length 10. 
     506        /* XXX - When GiantGrayPanda signed on AIM I got a thing asking me to register
     507         * for the netscape network.  This SNAC had a type 0x0058 TLV with length 10.
    508508         * Data is 0x0007 0004 3e19 ae1e 0006 0004 0000 0005 */
    509509
     
    511511                ret = userfunc(sess, rx, keystr);
    512512
    513         free(keystr); 
     513        free(keystr);
    514514
    515515        return ret;
  • libfaim/bart.c

    r07ab1cb r7869e48  
    22 * Family 0x0010 - Server stored buddy art
    33 *
    4  * Used for storing and retrieving your cute little buddy icon 
     4 * Used for storing and retrieving your cute little buddy icon
    55 * from the AIM servers.
    66 *
  • libfaim/bos.c

    rcf02dd6 r7869e48  
    2424        int ret = 0;
    2525
    26         /* 
    27          * TLVs follow 
     26        /*
     27         * TLVs follow
    2828         */
    2929        tlvlist = aim_tlvlist_read(bs);
     
    3838         * TLV type 0x0002: Maximum number of buddies on deny list.
    3939         */
    40         if (aim_tlv_gettlv(tlvlist, 0x0002, 1)) 
     40        if (aim_tlv_gettlv(tlvlist, 0x0002, 1))
    4141                maxdenies = aim_tlv_get16(tlvlist, 0x0002, 1);
    4242
     
    4646        aim_tlvlist_free(&tlvlist);
    4747
    48         return ret; 
     48        return ret;
    4949}
    5050
    51 /* 
     51/*
    5252 * Subtype 0x0004 - Set group permisson mask.
    5353 *
     
    7474 *  AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again
    7575 *
    76  * list should be a list of 
     76 * list should be a list of
    7777 * screen names in the form "Screen Name One&ScreenNameTwo&" etc.
    7878 *
     
    8080 *   - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD
    8181 *      with only your name on it.
    82  *   - Allow only users on my Buddy List: Send an 
     82 *   - Allow only users on my Buddy List: Send an
    8383 *      AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your
    8484 *      buddy list
    85  *   - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD 
     85 *   - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD
    8686 *      with everyone listed that you want to see you.
    87  *   - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only 
     87 *   - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only
    8888 *      yourself in the list
    8989 *   - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with
  • libfaim/bstream.c

    re374dee r7869e48  
    66
    77#define FAIM_INTERNAL
    8 #include <aim.h> 
     8#include <aim.h>
    99
    1010faim_internal int aim_bstream_init(aim_bstream_t *bs, fu8_t *data, int len)
    1111{
    12        
     12
    1313        if (!bs)
    1414                return -1;
     
    6363faim_internal fu8_t aimbs_get8(aim_bstream_t *bs)
    6464{
    65        
    66         if (aim_bstream_empty(bs) < 1)
    67                 return 0; /* XXX throw an exception */
    68        
     65
     66        if (aim_bstream_empty(bs) < 1)
     67                return 0; /* XXX throw an exception */
     68
    6969        bs->offset++;
    70        
     70
    7171        return aimutil_get8(bs->data + bs->offset - 1);
    7272}
     
    7474faim_internal fu16_t aimbs_get16(aim_bstream_t *bs)
    7575{
    76        
    77         if (aim_bstream_empty(bs) < 2)
    78                 return 0; /* XXX throw an exception */
    79        
     76
     77        if (aim_bstream_empty(bs) < 2)
     78                return 0; /* XXX throw an exception */
     79
    8080        bs->offset += 2;
    81        
     81
    8282        return aimutil_get16(bs->data + bs->offset - 2);
    8383}
     
    8585faim_internal fu32_t aimbs_get32(aim_bstream_t *bs)
    8686{
    87        
    88         if (aim_bstream_empty(bs) < 4)
    89                 return 0; /* XXX throw an exception */
    90        
     87
     88        if (aim_bstream_empty(bs) < 4)
     89                return 0; /* XXX throw an exception */
     90
    9191        bs->offset += 4;
    92        
     92
    9393        return aimutil_get32(bs->data + bs->offset - 4);
    9494}
     
    9696faim_internal fu8_t aimbs_getle8(aim_bstream_t *bs)
    9797{
    98        
    99         if (aim_bstream_empty(bs) < 1)
    100                 return 0; /* XXX throw an exception */
    101        
     98
     99        if (aim_bstream_empty(bs) < 1)
     100                return 0; /* XXX throw an exception */
     101
    102102        bs->offset++;
    103        
     103
    104104        return aimutil_getle8(bs->data + bs->offset - 1);
    105105}
     
    107107faim_internal fu16_t aimbs_getle16(aim_bstream_t *bs)
    108108{
    109        
    110         if (aim_bstream_empty(bs) < 2)
    111                 return 0; /* XXX throw an exception */
    112        
     109
     110        if (aim_bstream_empty(bs) < 2)
     111                return 0; /* XXX throw an exception */
     112
    113113        bs->offset += 2;
    114        
     114
    115115        return aimutil_getle16(bs->data + bs->offset - 2);
    116116}
     
    118118faim_internal fu32_t aimbs_getle32(aim_bstream_t *bs)
    119119{
    120        
    121         if (aim_bstream_empty(bs) < 4)
    122                 return 0; /* XXX throw an exception */
    123        
     120
     121        if (aim_bstream_empty(bs) < 4)
     122                return 0; /* XXX throw an exception */
     123
    124124        bs->offset += 4;
    125        
     125
    126126        return aimutil_getle32(bs->data + bs->offset - 4);
    127127}
  • libfaim/buddylist.c

    rcf02dd6 r7869e48  
    3131        int ret = 0;
    3232
    33         /* 
    34          * TLVs follow 
     33        /*
     34         * TLVs follow
    3535         */
    3636        tlvlist = aim_tlvlist_read(bs);
     
    4848         * list.  (This is called the "reverse list" by a certain
    4949         * other IM protocol.)
    50          * 
     50         *
    5151         */
    5252        if (aim_tlv_gettlv(tlvlist, 0x0002, 1))
     
    6464        aim_tlvlist_free(&tlvlist);
    6565
    66         return ret; 
     66        return ret;
    6767}
    6868
     
    103103 * buddy_list = "Screen Name One&ScreenNameTwo&";
    104104 *
    105  * XXX Clean this up. 
     105 * XXX Clean this up.
    106106 *
    107107 */
     
    114114        char *tmpptr = NULL;
    115115
    116         if (!buddy_list || !(localcpy = strdup(buddy_list))) 
     116        if (!buddy_list || !(localcpy = strdup(buddy_list)))
    117117                return -EINVAL;
    118118
     
    176176}
    177177
    178 /* 
     178/*
    179179 * Subtype 0x000b
    180180 *
     
    194194
    195195        snacid = aim_cachesnac(sess, 0x0003, 0x000b, 0x0000, NULL, 0);
    196        
     196
    197197        aim_putsnac(&fr->data, 0x0003, 0x000b, 0x0000, snacid);
    198198        aim_putuserinfo(&fr->data, info);
     
    203203}
    204204
    205 /* 
     205/*
    206206 * Subtype 0x000c
    207207 *
     
    221221
    222222        snacid = aim_cachesnac(sess, 0x0003, 0x000c, 0x0000, NULL, 0);
    223        
     223
    224224        aim_putsnac(&fr->data, 0x0003, 0x000c, 0x0000, snacid);
    225225        aimbs_put8(&fr->data, strlen(sn));
  • libfaim/chat.c

    rcf02dd6 r7869e48  
    55
    66#define FAIM_INTERNAL
    7 #include <aim.h> 
     7#include <aim.h>
    88
    99#include <string.h>
     
    9393
    9494        buflen = 2 + 1 + strlen(roomname) + 2;
    95        
     95
    9696        if (!(buf = malloc(buflen)))
    9797                return 0;
     
    112112
    113113/*
    114  * Join a room of name roomname.  This is the first step to joining an 
    115  * already created room.  It's basically a Service Request for 
    116  * family 0x000e, with a little added on to specify the exchange and room 
     114 * Join a room of name roomname.  This is the first step to joining an
     115 * already created room.  It's basically a Service Request for
     116 * family 0x000e, with a little added on to specify the exchange and room
    117117 * name.
    118118 */
     
    123123        aim_tlvlist_t *tl = NULL;
    124124        struct chatsnacinfo csi;
    125        
     125
    126126        if (!sess || !conn || !roomname || !strlen(roomname))
    127127                return -EINVAL;
     
    149149        aim_tx_enqueue(sess, fr);
    150150
    151         return 0; 
     151        return 0;
    152152}
    153153
     
    194194        int hdrlen;
    195195        aim_bstream_t hdrbs;
    196        
     196
    197197        if (!sess || !conn || !sn || !msg || !roomname)
    198198                return -EINVAL;
     
    239239         * Sigh.  AOL was rather inconsistent right here.  So we have
    240240         * to play some minor tricks.  Right inside the type 5 is some
    241          * raw data, followed by a series of TLVs. 
     241         * raw data, followed by a series of TLVs.
    242242         *
    243243         */
     
    245245        hdr = malloc(hdrlen);
    246246        aim_bstream_init(&hdrbs, hdr, hdrlen);
    247        
     247
    248248        aimbs_put16(&hdrbs, 0x0000); /* Unknown! */
    249249        aimbs_putraw(&hdrbs, ckstr, sizeof(ckstr)); /* I think... */
     
    255255        aim_addtlvtochain_chatroom(&itl, 0x2711, exchange, roomname, instance);
    256256        aim_tlvlist_write(&hdrbs, &itl);
    257        
     257
    258258        aim_tlvlist_add_raw(&otl, 0x0005, aim_bstream_curpos(&hdrbs), hdr);
    259259
     
    263263        aim_tlvlist_free(&itl);
    264264        aim_tlvlist_free(&otl);
    265        
     265
    266266        aim_tx_enqueue(sess, fr);
    267267
     
    307307        /*
    308308         * Everything else are TLVs.
    309          */ 
     309         */
    310310        tlvlist = aim_tlvlist_read(bs);
    311311
     
    325325         * Type 0x0073:  Occupant list.
    326326         */
    327         if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) {       
     327        if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) {
    328328                int curoccupant = 0;
    329329                aim_tlv_t *tmptlv;
     
    341341        }
    342342
    343         /* 
     343        /*
    344344         * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG)
    345345         */
     
    347347                flags = aim_tlv_get16(tlvlist, 0x00c9, 1);
    348348
    349         /* 
     349        /*
    350350         * Type 0x00ca: Creation time (4 bytes)
    351351         */
     
    353353                creationtime = aim_tlv_get32(tlvlist, 0x00ca, 1);
    354354
    355         /* 
     355        /*
    356356         * Type 0x00d1: Maximum Message Length
    357357         */
     
    359359                maxmsglen = aim_tlv_get16(tlvlist, 0x00d1, 1);
    360360
    361         /* 
     361        /*
    362362         * Type 0x00d2: Unknown. (2 bytes)
    363363         */
     
    365365                unknown_d2 = aim_tlv_get16(tlvlist, 0x00d2, 1);
    366366
    367         /* 
     367        /*
    368368         * Type 0x00d3: Room Description
    369369         */
     
    377377                ;
    378378
    379         /* 
     379        /*
    380380         * Type 0x00d5: Unknown. (1 byte)
    381381         */
     
    389389        if (aim_tlv_gettlv(tlvlist, 0x000d6, 1))
    390390                ;
    391        
     391
    392392        /*
    393393         * Type 0x00d7: Language 1 ("en")
     
    401401        if (aim_tlv_gettlv(tlvlist, 0x000d8, 1))
    402402                ;
    403        
     403
    404404        /*
    405405         * Type 0x00d9: Language 2 ("en")
     
    475475 *                                 and displays the message as normal.)
    476476 *
    477  * XXX convert this to use tlvchains 
     477 * XXX convert this to use tlvchains
    478478 */
    479479faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const char *msg, int msglen)
    480 {   
     480{
    481481        int i;
    482482        aim_frame_t *fr;
     
    539539         *
    540540         * This could include other information... We just
    541          * put in a message TLV however. 
    542          * 
     541         * put in a message TLV however.
     542         *
    543543         */
    544544        aim_tlvlist_add_frozentlvlist(&otl, 0x0005, &itl);
    545545
    546546        aim_tlvlist_write(&fr->data, &otl);
    547        
     547
    548548        aim_tlvlist_free(&itl);
    549549        aim_tlvlist_free(&otl);
    550        
     550
    551551        aim_tx_enqueue(sess, fr);
    552552
     
    557557 * Subtype 0x0006
    558558 *
    559  * We could probably include this in the normal ICBM parsing 
     559 * We could probably include this in the normal ICBM parsing
    560560 * code as channel 0x0003, however, since only the start
    561561 * would be the same, we might as well do it here.
     
    577577 *         message string
    578578 *       possibly others
    579  * 
     579 *
    580580 */
    581581static int incomingmsg(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    582582{
    583583        aim_userinfo_t userinfo;
    584         aim_rxcallback_t userfunc;     
     584        aim_rxcallback_t userfunc;
    585585        int ret = 0;
    586586        fu8_t *cookie;
     
    619619
    620620        /*
    621          * Start parsing TLVs right away. 
     621         * Start parsing TLVs right away.
    622622         */
    623623        otl = aim_tlvlist_read(bs);
     
    637637
    638638        /*
    639          * Type 0x0001: If present, it means it was a message to the 
     639         * Type 0x0001: If present, it means it was a message to the
    640640         * room (as opposed to a whisper).
    641641         */
     
    655655                itl = aim_tlvlist_read(&tbs);
    656656
    657                 /* 
     657                /*
    658658                 * Type 0x0001: Message.
    659                  */     
     659                 */
    660660                if (aim_tlv_gettlv(itl, 0x0001, 1))
    661661                        msg = aim_tlv_getstr(itl, 0x0001, 1);
    662662
    663                 aim_tlvlist_free(&itl); 
     663                aim_tlvlist_free(&itl);
    664664        }
    665665
  • libfaim/chatnav.c

    rcf02dd6 r7869e48  
    4646         * This looks to be a big hack.  You'll note that this entire
    4747         * SNAC is just a room info structure, but the hard room name,
    48          * here, is set to "create". 
     48         * here, is set to "create".
    4949         *
    5050         * Either this goes on the "list of questions concerning
     
    5757        aimbs_putraw(&fr->data, ck, strlen(ck));
    5858
    59         /* 
     59        /*
    6060         * instance
    61          * 
     61         *
    6262         * Setting this to 0xffff apparently assigns the last instance.
    6363         *
     
    9595        tlvlist = aim_tlvlist_read(bs);
    9696
    97         /* 
     97        /*
    9898         * Type 0x0002: Maximum concurrent rooms.
    99          */ 
     99         */
    100100        if (aim_tlv_gettlv(tlvlist, 0x0002, 1))
    101101                maxrooms = aim_tlv_get8(tlvlist, 0x0002, 1);
    102102
    103         /* 
     103        /*
    104104         * Type 0x0003: Exchange information
    105105         *
    106106         * There can be any number of these, each one
    107          * representing another exchange. 
    108          * 
     107         * representing another exchange.
     108         *
    109109         */
    110110        for (curexchange = 0; ((exchangetlv = aim_tlv_gettlv(tlvlist, 0x0003, curexchange+1))); ) {
     
    121121                innerlist = aim_tlvlist_read(&tbs);
    122122
    123                 /* 
     123                /*
    124124                 * Type 0x000a: Unknown.
    125125                 *
     
    130130                        ;
    131131
    132                 /* 
     132                /*
    133133                 * Type 0x000d: Unknown.
    134134                 */
     
    136136                        ;
    137137
    138                 /* 
     138                /*
    139139                 * Type 0x0004: Unknown
    140140                 */
     
    142142                        ;
    143143
    144                 /* 
     144                /*
    145145                 * Type 0x0002: Unknown
    146146                 */
     
    149149
    150150                        classperms = aim_tlv_get16(innerlist, 0x0002, 1);
    151                        
     151
    152152                        faimdprintf(sess, 1, "faim: class permissions %x\n", classperms);
    153153                }
     
    161161                 * 8 Occupant Peek Allowed
    162162                 *
    163                  */ 
     163                 */
    164164                if (aim_tlv_gettlv(innerlist, 0x00c9, 1))
    165165                        exchanges[curexchange-1].flags = aim_tlv_get16(innerlist, 0x00c9, 1);
    166                      
    167                 /*
    168                  * Type 0x00ca: Creation Date 
     166
     167                /*
     168                 * Type 0x00ca: Creation Date
    169169                 */
    170170                if (aim_tlv_gettlv(innerlist, 0x00ca, 1))
    171171                        ;
    172                      
     172
    173173                /*
    174174                 * Type 0x00d0: Mandatory Channels?
     
    186186                 * Type 0x00d2: Maximum Occupancy?
    187187                 */
    188                 if (aim_tlv_gettlv(innerlist, 0x00d2, 1))       
     188                if (aim_tlv_gettlv(innerlist, 0x00d2, 1))
    189189                        ;
    190190
     
    192192                 * Type 0x00d3: Exchange Description
    193193                 */
    194                 if (aim_tlv_gettlv(innerlist, 0x00d3, 1))       
     194                if (aim_tlv_gettlv(innerlist, 0x00d3, 1))
    195195                        exchanges[curexchange-1].name = aim_tlv_getstr(innerlist, 0x00d3, 1);
    196196                else
     
    200200                 * Type 0x00d4: Exchange Description URL
    201201                 */
    202                 if (aim_tlv_gettlv(innerlist, 0x00d4, 1))       
     202                if (aim_tlv_gettlv(innerlist, 0x00d4, 1))
    203203                        ;
    204204
     
    209209                 * 1  Room creation allowed
    210210                 * 2  Exchange creation allowed
    211                  * 
     211                 *
    212212                 */
    213213                if (aim_tlv_gettlv(innerlist, 0x00d5, 1)) {
     
    219219                /*
    220220                 * Type 0x00d6: Character Set (First Time)
    221                  */           
    222                 if (aim_tlv_gettlv(innerlist, 0x00d6, 1))       
     221                 */
     222                if (aim_tlv_gettlv(innerlist, 0x00d6, 1))
    223223                        exchanges[curexchange-1].charset1 = aim_tlv_getstr(innerlist, 0x00d6, 1);
    224224                else
    225225                        exchanges[curexchange-1].charset1 = NULL;
    226                      
     226
    227227                /*
    228228                 * Type 0x00d7: Language (First Time)
    229                  */           
    230                 if (aim_tlv_gettlv(innerlist, 0x00d7, 1))       
     229                 */
     230                if (aim_tlv_gettlv(innerlist, 0x00d7, 1))
    231231                        exchanges[curexchange-1].lang1 = aim_tlv_getstr(innerlist, 0x00d7, 1);
    232232                else
     
    235235                /*
    236236                 * Type 0x00d8: Character Set (Second Time)
    237                  */           
    238                 if (aim_tlv_gettlv(innerlist, 0x00d8, 1))       
     237                 */
     238                if (aim_tlv_gettlv(innerlist, 0x00d8, 1))
    239239                        exchanges[curexchange-1].charset2 = aim_tlv_getstr(innerlist, 0x00d8, 1);
    240240                else
     
    243243                /*
    244244                 * Type 0x00d9: Language (Second Time)
    245                  */           
    246                 if (aim_tlv_gettlv(innerlist, 0x00d9, 1))       
     245                 */
     246                if (aim_tlv_gettlv(innerlist, 0x00d9, 1))
    247247                        exchanges[curexchange-1].lang2 = aim_tlv_getstr(innerlist, 0x00d9, 1);
    248248                else
    249249                        exchanges[curexchange-1].lang2 = NULL;
    250                      
     250
    251251                /*
    252252                 * Type 0x00da: Unknown
    253253                 */
    254                 if (aim_tlv_gettlv(innerlist, 0x00da, 1))       
     254                if (aim_tlv_gettlv(innerlist, 0x00da, 1))
    255255                        ;
    256256
     
    354354 * Subtype 0x0009
    355355 *
    356  * Since multiple things can trigger this callback, we must lookup the 
     356 * Since multiple things can trigger this callback, we must lookup the
    357357 * snacid to determine the original snac subtype that was called.
    358358 *
     
    364364 *    Nav Short Desc = 8
    365365 *    Nav Instance Info = 16
    366  * And then everything is really asynchronous.  There is no specific 
     366 * And then everything is really asynchronous.  There is no specific
    367367 * attachment of a response to a create room request, for example.  Creating
    368368 * the room yields no different a response than requesting the room's info.
  • libfaim/conn.c

    rcf02dd6 r7869e48  
    88#define FAIM_INTERNAL
    99#define FAIM_NEED_CONN_INTERNAL
    10 #include <aim.h> 
     10#include <aim.h>
    1111
    1212#ifndef _WIN32
     
    2323 * In OSCAR, every connection has a set of SNAC groups associated
    2424 * with it.  These are the groups that you can send over this connection
    25  * without being guarenteed a "Not supported" SNAC error. 
    26  *
    27  * The grand theory of things says that these associations transcend 
     25 * without being guarenteed a "Not supported" SNAC error.
     26 *
     27 * The grand theory of things says that these associations transcend
    2828 * what libfaim calls "connection types" (conn->type).  You can probably
    29  * see the elegance here, but since I want to revel in it for a bit, you 
     29 * see the elegance here, but since I want to revel in it for a bit, you
    3030 * get to hear it all spelled out.
    3131 *
     
    3333 * of your modules has just given you a SNAC of the group 0x0004 to send
    3434 * you.  Maybe an IM destined for some twit in Greenland.  So you start
    35  * at the top of your connection list, looking for a connection that 
     35 * at the top of your connection list, looking for a connection that
    3636 * claims to support group 0x0004.  You find one.  Why, that neat BOS
    3737 * connection of yours can do that.  So you send it on its way.
     
    5151 * that connection.  One of the first things you get from this new server
    5252 * is a message saying that indeed it does support the group you were looking
    53  * for.  So you continue and send rate confirmation and all that. 
    54  * 
     53 * for.  So you continue and send rate confirmation and all that.
     54 *
    5555 * Then you remember you had that SNAC to send, and now you have a means to
    5656 * do it, and you do, and everyone is happy.  Except the Greenlander, who is
     
    6565 * to make libfaim work that way.  It would take a fair amount of effort,
    6666 * and probably some client API changes as well.  (Whenever I don't want
    67  * to do something, I just say it would change the client API.  Then I 
     67 * to do something, I just say it would change the client API.  Then I
    6868 * instantly have a couple of supporters of not doing it.)
    6969 *
     
    159159        aim_tx_cleanqueue(sess, *deadconn);
    160160
    161         if ((*deadconn)->fd != -1) 
     161        if ((*deadconn)->fd != -1)
    162162                aim_conn_close(*deadconn);
    163163
     
    251251        aim_conn_t *newconn;
    252252
    253         if (!(newconn = malloc(sizeof(aim_conn_t))))   
     253        if (!(newconn = malloc(sizeof(aim_conn_t))))
    254254                return NULL;
    255255        memset(newconn, 0, sizeof(aim_conn_t));
     
    282282        aim_conn_t *cur, **prev;
    283283
    284         if (!deadconn || !*deadconn)   
     284        if (!deadconn || !*deadconn)
    285285                return;
    286286
     
    307307 * Close (but not free) a connection.
    308308 *
    309  * This leaves everything untouched except for clearing the 
     309 * This leaves everything untouched except for clearing the
    310310 * handler list and setting the fd to -1 (used to recognize
    311311 * dead connections).  It will also remove cookies if necessary.
     
    335335 * @type: Type of connection to look for
    336336 *