You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Manish Chakravarty <ma...@gmail.com> on 2006/10/30 14:12:12 UTC

How to increase the size of the apache array manually?

Hi all,

I am developing a module on Apache 1.3. Can someone please tell me how
to increase the size of an Apache array manually?

Do i manually increment the nelts field?

According to the book "Writing perl modules with apache and C", array
modules are accessed as follows:

((char **)arr->elts[index] = "whatever"

Does this mean, that to append an element at the end of the array, we use:

arr->nelts++

((char **)arr->elts[index +1] = " some text';

Help will be great appreciated.


-- 
Warm Regards,
Manish Chakravarty
----
Consultant Software Developer
PH: +919886702500
http://manishchaks.net
---

Re: How to increase the size of the apache array manually?

Posted by Joachim Zobel <jz...@heute-morgen.de>.
Am Montag, den 30.10.2006, 18:42 +0530 schrieb Manish Chakravarty:
> Hi all,
> 
> I am developing a module on Apache 1.3. Can someone please tell me how
> to increase the size of an Apache array manually?
> 
> Do i manually increment the nelts field?

If this works as on 2 you simply have to call apr_array_push. It returns
a pointer to the arry memory that you can use to write the entry. The
array memory is allocated automatically as needed.

Sincerely,
Joachim