# Rdoc with c extensions

**URL:** <https://www.ruby-forum.com/t/rdoc-with-c-extensions/69675>\
**Category:** Ruby\
**Created:** [September 22, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/rdoc-with-c-extensions/69675 "2006-09-22T21:34:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [September 22, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/rdoc-with-c-extensions/69675/1 "2006-09-22T21:34:23Z")

</div>

I’m trying to figure out the best way to have docs for a c extension  
generated when a gem is installed. Ideally I’d like to document the  
methods in modname.rb, but I can’t because if I define the methods in  
modname.rb they will override the c functions. If I document the c  
source, which is what I’m doing now, I’m not sure how to make my gem  
automatically generate the rdoc from the c source. Also, rdoc doesn’t  
doesn’t pick up the parameter names in a c function, it just calls  
them p1,p2,p3,etc…

Chris

---

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [October 15, 2006, 7:07am UTC](https://www.ruby-forum.com/t/rdoc-with-c-extensions/69675/2 "2006-10-15T07:07:39Z")

</div>

On Sep 22, 2006, at 12:32 PM, snacktime wrote:

> If I document the c source, which is what I’m doing now, I’m not  
> sure how to make my gem  
> automatically generate the rdoc from the c source.

Include the .c file in the RDoc file list and it will get scanned for  
RDoc.

> Also, rdoc doesn’t doesn’t pick up the parameter names in a c  
> function, it just calls  
> them p1,p2,p3,etc…

Use :call-seq:, see array.c in ruby for an example.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
