Ort

From C

Jump to: navigation, search

Links

C Channel Stats

Ort

Ort is one of the IRC Bots in #c, created by orbitz. It is written in Python using Twisted (not built off of any preexisting bot framework).

Commands

Man pages

Sections 2 and 3 of FreeBSD 5.3 manpages are accessable via ort. To access them simply type:

   man fn

Where fn is the name of the function you wish to find information on. By default ort will private message you the header files required in using that function, it's prototype, and a URL to get more information on the function. If you need to query a specific section:

   man section fn

Where section is a numeric value of, in this case, either 2 or 3.

To make the result appear in the channel prepend ~ to your query. Please only do this if you are helping someone. Ort will respond to this query over private message aswell.


Cdecl

An interface to the cdecl program is available. This program is fairly complete and somewhat complex. The version ort interfaces to is:

Version:

       @(#)cdecl.c     2.5 1/15/96
       @(#)cdgram.y    2.2 3/30/88
       @(#)cdlex.l     2.2 3/30/88


Help screen:

 [] means optional; {} means 1 or more; <> means defined elsewhere
   commands are separated by ';' and newlines
 command:
   declare <name> as <english>
   cast <name> into <english>
   explain <gibberish>
   set or set options
   help, ?
   quit or exit
 english:
   function [( <decl-list> )] returning <english>
   array [<number>] of <english>
   [{ const | volatile | noalias }] pointer to <english>
   <type>
 type:
   {[<storage-class>] [{<modifier>}] [<C-type>]}
   { struct | union | enum } <name>
 decllist: a comma separated list of <name>, <english> or <name> as <english>
 name: a C identifier
 gibberish: a C declaration, like 'int *x', or cast, like '(int *)x'
 storage-class: extern, static, auto, register
 C-type: int, char, float, double, or void
 modifier: short, long, signed, unsigned, const, volatile, or noalias


Example usage:

 22:17 <orbitz> cdecl explain int x[5];
 22:18 <ort_> declare x as array 5 of int
 22:18 <orbitz> cdecl declare foo as array 5 of int;
 22:18 <ort_> int foo[5]
 22:19 <orbitz> cdecl explain (void (*)(void))foo;
 22:19 <ort_> cast foo into pointer to function (void) returning void
 22:20 <orbitz> cdecl cast foo into pointer to function (int, int) returning double;
 22:20 <ort_> (double (*)(int , int ))foo


Like man, this responds by default over private message and can be made to respond in the channel with ~.

Any questions, suggestions, comments feel free to leave a memo via MemoServ for orbitz on freenode.

Personal tools