The problem is not the macro, because the mysql.h is part of the configure.ac. Specifically, I added the AC_CHECK_HEADER(mysql.h).
It correctly reports that mysql.h is missing, but ./configure...
Type: Posts; User: tpe
The problem is not the macro, because the mysql.h is part of the configure.ac. Specifically, I added the AC_CHECK_HEADER(mysql.h).
It correctly reports that mysql.h is missing, but ./configure...
OK, I found it. I added the AX_LIB_MYSQL() statement just before the libs.
Now, since I want to test the functionality:
I have installed on my pc the mysqlclient lib but not the mysql.h file.
So,...
First of all, I really thank you for your answer.
Now, I tried to just use the macro and not modifying the configure.ac script.
So, I deleted all config* files from the project home directory,...
Hallo,
I need you help with auitoconf. I have a project with existing source. I need to convert that program and include support for mysql.
Since I want to do it with the "right" way, I...
open_stream (const char *host, unsigned int port)
{
struct addrinfo *res, *addr, hints;
static char service[6];
int sock, ret;
sprintf (service, "%hu", port);
memset...
Hi,
I need to open a non standard TCP (high) port though a proxy server in order to connect via company's proxy server to another server. The proxy is Squid, but allows traffic to the specific port...
OK, clear. But why is it working? I mean, when I use "=" I have no segmentation faults. With everything else (malloc, strdup, etc), I get some nice segmentation faults that are not very helpful......
Why?
getenv returns char*, as my variable is. So, effectively, when I write:
char *a, *b;
a=b;
all I am instructing the program to do is:
copy everything from the pointer a to pointer b....
Yes, I got your point. The correct code would be:
sscanf(srv, "http://%[^:]:%5u", pHost, &prxPort);
..but only for positive numbers. I have to figure out how to get only a positive number...
My thought was about the strlen. However, is stlen overflow safe?
What do you mean by strdup()/free()?
If you mean the "MAX_ENVSTR 256", I do not consider it as efficient way of programming. In...
Hmmm.
Yeap, I got yout point. a printf("%d", sizeof getenv...) return 5, so, it's wrong. Should I use the following, then?
envProxySrv=malloc(sizeof...
Hallo,
I have the problem with the parsing of the http_proxy variable (see thread:)
Now, in order to follow some best practices (at least that is what I have read), I need to use malloc before the...
Numeric overflow?
I know. That's my problem, the sscaf
envProxySrv=getenv("http_proxy");
Yes, that would be an option. But in that case, I should assume that the maximum length could be only 255 characters. OK, I know RFC etc, but since we are talking about user input, I would like to...
I am not sure that I understand your second question...
About the global variable, the issue is that I don't like from the designs point of view, to mess up with the rest of the code. In reallity,...
Guys, thank you for your answer. I was suspecting that. But, I am out of C programming for years and PHP or other scripting language are very easy on that matter.
So, the issue was indeed the sizes....
Dear all,
I need to parse the http_proxy environmental variable in a linux C program.
Of course I do know how to retrieve the variable, but I am not sure that I correctly split the variable into...
OK, I will open a new thread then :)
OK, I know that this is a very late "answer", but in my case it is not working.
I have the following data:
char *srv;
char *prxHostname;
srv=getenv("http_proxy");
sscanf(strcat(srv, "/"),...