Changeset 6922edd for perlglue.xs


Ignore:
Timestamp:
Oct 26, 2006, 11:14:41 AM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4c46dfd
Parents:
bc220b2
Message:
Adding the ability to install real commands from perl.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r1152d45 r6922edd  
    55#endif
    66#include <EXTERN.h>
    7 #include <perl.h>
    8 #include <XSUB.h>
    97
    108#define OWL_PERL
     
    7573                if (rv) owl_free(rv);
    7674
     75void
     76new_command_internal(name, func, summary, usage, description)
     77        char *name
     78        SV *func
     79        char *summary
     80        char *usage
     81        char *description
     82        PREINIT:
     83                owl_cmd cmd;
     84        CODE:
     85                SvREFCNT_inc(func);
     86                cmd.name = name;
     87                cmd.cmd_perl = func;
     88                cmd.summary = summary;
     89                cmd.usage = usage;
     90                cmd.description = description;
     91                cmd.validctx = OWL_CTX_ANY;
     92
     93                cmd.cmd_aliased_to = NULL;
     94                cmd.cmd_args_fn = NULL;
     95                cmd.cmd_v_fn = NULL;
     96                cmd.cmd_i_fn = NULL;
     97                cmd.cmd_ctxargs_fn = NULL;
     98                cmd.cmd_ctxv_fn = NULL;
     99                cmd.cmd_ctxi_fn = NULL;
     100
     101                owl_cmddict_add_cmd(owl_global_get_cmddict(&g), &cmd);
Note: See TracChangeset for help on using the changeset viewer.