Changeset 2404c3a


Ignore:
Timestamp:
Oct 3, 2003, 7:34:01 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
f933403
Parents:
87c6ef1
Message:
Added the "source" command
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r87c6ef1 r2404c3a  
    11$Id$
    22
     32.0.8-pre-4
     4        Added the 'source' command.
     5       
    362.0.8-pre-3   
    47        Make sure that a newline is always at the end of messages
  • buddylist.c

    ra352335c r2404c3a  
    77  owl_list_create(&(b->buddies));
    88  owl_list_create(&(b->idletimes));
     9  /* owl_list_create(&(g->buddymsg_queue)); */
    910}
    1011
     
    9293{
    9394  if (!owl_buddylist_is_buddy_loggedin(b, screenname)) return;
     95 
    9496  owl_aim_get_idle(screenname);
    9597}
     
    142144}
    143145
    144 /* set the idle time for user 'screenname'.  If the given
    145  * screenname is not on the buddy list do nothing
     146/* Set the idle time for user 'screenname'.  If the given screenname
     147 * is not on the buddy list do nothing.  If there is a queued request
     148 * for this screename, remove it from the queue.
    146149 */
    147150void owl_buddylist_set_idletime(owl_buddylist *b, char *screenname, int minutes)
  • commands.c

    rf1e629d r2404c3a  
    226226              "dump <filename>",
    227227              "Dump messages in current view to the named file."),
     228
     229  OWLCMD_ARGS("source", owl_command_source, OWL_CTX_ANY,
     230              "execute owl commands from a file",
     231              "source <filename>",
     232              "Execute the owl commands in <filename>.\n"),
    228233
    229234  OWLCMD_ARGS("addbuddy", owl_command_addbuddy, OWL_CTX_INTERACTIVE,
     
    10491054
    10501055  owl_function_dump(argv[1]);
     1056  return(NULL);
     1057}
     1058
     1059char *owl_command_source(int argc, char **argv, char *buff)
     1060{
     1061  if (argc!=2) {
     1062    owl_function_makemsg("usage: source <filename>");
     1063    return(NULL);
     1064  }
     1065
     1066  owl_function_source(argv[1]);
    10511067  return(NULL);
    10521068}
  • functions.c

    rf1e629d r2404c3a  
    31593159}
    31603160
    3161 void owl_function_execstartup(void)
     3161/* Execute owl commands from the given filename.  If the filename
     3162 * is NULL, use the default owl startup commands file.
     3163 */
     3164void owl_function_source(char *filename)
    31623165{
    31633166  FILE *file;
    3164   char *filename;
    31653167  char buff[LINE];
    31663168
    3167   filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE);
    3168   file=fopen(filename, "r");
    3169   owl_free(filename);
     3169  if (!filename) {
     3170    filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE);
     3171    file=fopen(filename, "r");
     3172    owl_free(filename);
     3173  } else {
     3174    file=fopen(filename, "r");
     3175  }
    31703176  if (!file) {
    31713177    /* just fail silently if it doesn't exist */
  • global.c

    rf1e629d r2404c3a  
    9797  owl_timer_create_countdown(&(g->aim_buddyinfo_timer), 60);
    9898  owl_buddylist_init(&(g->buddylist));
     99   
    99100  g->response=NULL;
    100101  g->havezephyr=0;
  • owl.c

    rf1e629d r2404c3a  
    128128  }
    129129
    130    
    131130  /* owl global init */
    132131  owl_global_init(&g);
     
    223222
    224223  /* process the startup file */
    225   owl_function_execstartup();
     224  owl_function_source(NULL);
    226225
    227226  /* read the config file */
  • owl.h

    r282ec9b r2404c3a  
    2121static const char owl_h_fileIdent[] = "$Id$";
    2222
    23 #define OWL_VERSION         2.0.8-pre-3
    24 #define OWL_VERSION_STRING "2.0.8-pre-3"
     23#define OWL_VERSION         2.0.8-pre-4
     24#define OWL_VERSION_STRING "2.0.8-pre-4"
    2525
    2626#define OWL_DEBUG 0
Note: See TracChangeset for help on using the changeset viewer.