httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graf, László" <gr...@datatrans.hu>
Subject DSO question
Date Tue, 09 Mar 2010 13:43:31 GMT
Hi all,

I have an APACHE 2 module, a content generator, named mod_gl and it is  
configured to handle the following location:

    LoadModule gl_module modules/mod_gl.so
    <Location /gl>
      SetHandler gl_module
    </Location>

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);

and the source of the library (apr_dso_f.c)

    #include <apr_dso_f.h>
    int f10(int p1)
    {
         return p1*10;
    }

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?

Thank you,
grafl


Mime
View raw message