httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Lewis" <>
Subject Re: DSO question
Date Tue, 09 Mar 2010 17:16:14 GMT
On Tue, March 9, 2010 6:43 am, Graf, László wrote:

> I have a shared library containing a function to calculate a multiple
> of 10. The header file (apr_dso_f.h):
>     int f10(int p1);
> I use this library with an APR console application and it woks fine. OK.
> My module loads also this SO library at start-up. What I would like to
> have is when I access the URL
>     /gl/f10?p1=2
> to call the function f10 with 2 as parameter..., calculate the result and
> generate the HTML content containig 20. This means that, when I have
> the function's name (f10) and the parameter's value (2) from the
> request string I need to evaluate a statement like
>     int n;
>     "n = f10(2);"
> like EVAL in Perl or JavaScript and use then the n like a C variable.
> Is that possible? Can somebody help me?

Yes.  Programming 101.  If using C, I'd reading up on the following things :

  Understand how to parse the request_rec->args (QUERY_STRING) to get the
  Read up on "atoi" to convert the text param value into an integer
  call directly the n = f10(variable);


View raw message