aboutsummaryrefslogtreecommitdiffstats
path: root/m4-local/gethostbyname_r.m4
blob: 84f99c839215f4a0f451153a196261412d9d46de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
dnl @synopsis ACX_WHICH_GETHOSTBYNAME_R
dnl
dnl Provides a test to determine the correct way to call gethostbyname_r
dnl
dnl defines HAVE_GETHOSTBYNAME_R to the number of arguments required
dnl
dnl e.g. 6 arguments (linux)
dnl e.g. 5 arguments (solaris)
dnl e.g. 3 arguments (osf/1)
dnl
dnl @version $Id: acinclude.m4,v 1.6 2001/10/17 07:19:14 brian Exp $
dnl @author Brian Stafford <brian@stafford.uklinux.net>
dnl
dnl based on version by Caolan McNamara <caolan@skynet.ie>
dnl based on David Arnold's autoconf suggestion in the threads faq
dnl with fixes and updates by Matthias Andree
dnl
AC_DEFUN([ACX_WHICH_GETHOSTBYNAME_R],
[AC_CACHE_CHECK(number of arguments to gethostbyname_r,
                acx_cv_which_gethostbyname_r, [
	AC_TRY_LINK([
#		include <netdb.h> 
  	], 	[

        char *name;
        struct hostent *he;
        struct hostent_data data;
        (void) gethostbyname_r(name, he, &data);

		],acx_cv_which_gethostbyname_r=3,
			[
dnl			acx_cv_which_gethostbyname_r=0
  AC_TRY_LINK([
#include <stdlib.h>
#   include <netdb.h>
  ], [
	char *name;
	struct hostent *he, *res;
	char *buffer = NULL;
	int buflen = 2048;
	int h_errnop;
	(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
  ],acx_cv_which_gethostbyname_r=6,
  
  [
dnl  acx_cv_which_gethostbyname_r=0
  AC_TRY_LINK([
#include <stdlib.h>
#   include <netdb.h>
  ], [
			char *name;
			struct hostent *he;
			char *buffer = NULL;
			int buflen = 2048;
			int h_errnop;
			(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
  ],acx_cv_which_gethostbyname_r=5,acx_cv_which_gethostbyname_r=0)

  ]
  
  )
			]
		)
	])

if test $acx_cv_which_gethostbyname_r -gt 0 ; then
    AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME_R], $acx_cv_which_gethostbyname_r,
    		       [Number of parameters to gethostbyname_r or 0 if not available])
fi

])
"nv">$tmp/growthplot$$ >$tmp/growthnumbers$$ grep "^[0-9.]*.[05].0 " $tmp/growthplot$$ >$tmp/growthmajors$$ sed '/^4.2.9/,$d' <$tmp/growthnumbers$$ >$tmp/growthannounce$$ # gnuplot line styles. These occasionally change (like beteween 3.5 and 3.7); # use "echo 'set terminal png; test' | gnuplot | display -" to check. blue_boxes=3 green_crosses=2 cyan_diamonds=37 # Once purple triangles, but we can't do that anymore brown_triangles=23 cat >$tmp/growthimage$$ <<EOF set title "Fetchmail project growth history" set xlabel 'Days since baseline' set ylabel 'Participants' set y2label 'Lines of code' set ytics nomirror set y2tics set tics out set autoscale y set y2range [5000:50000] set key bottom right box set terminal png EOF # OK, now write the event labels ( count=0 lastday=0 breakheight=510 while read version legend do if [ "$version" = '%' ] then echo "# Associate $lastday to '$legend'" count=$((count+1)) lastday=$(($lastday-5)) endy=$((breakheight+50+count*50)) if ((endy>lasttotal)) then # Label over curve hanging right, arrow down arrowhead=$((lasttotal+50)) echo "set label '$legend' at $lastday-10, $endy+15" else # Label under curve hanging left, arrow up arrowhead=$((lasttotal-5)) strlen=`python -c "print len('$legend')"` lablen=$((strlen*22)) echo "set label '$legend' at $lastday-$lablen+10, $endy-15" fi echo set arrow \ from $lastday, $endy \ to $lastday, $arrowhead \ head else set -- $legend size=$1 friends=$2 announce=$3 total=$4 days=$5 date=$6 lastday=$days lasttotal=$total fi done ) <$tmp/growthplot$$ >>$tmp/growthimage$$ # OK, now write the major-release labels ( while read version size friends announce total days date do echo "set arrow from $days, $total - 55 to $days, $total - 15 head" echo "set label '$version' at $days - 5, $total - 65" done ) <$tmp/growthmajors$$ >>$tmp/growthimage$$ cat >>$tmp/growthimage$$ <<EOF plot [] [0:] '$tmp/growthnumbers$$' using 6:5 \ title "Both lists" with points $blue_boxes, \ '$tmp/growthannounce$$' using 6:4 \ title "fetchmail-announce" with points $cyan_diamonds, \ '$tmp/growthannounce$$' using 6:3 \ title "fetchmail-friends" with points $green_crosses, \ '$tmp/growthnumbers$$' using 6:2 axes x1y2 \ title "Lines of code" with points $brown_triangles EOF gnuplot $tmp/growthimage$$ >growth.png rm -f $tmp/growth* rmdir $tmp # growthplot ends here