Check-in [d8b9d9894a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:implementing dynamic styling - vector coverages
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8b9d9894ad2d72a83062b18c59ce9a3e43b495e
User & Date: sandro 2017-08-24 15:51:23
Context
2017-09-12
06:44
raster reprojection on-the-fly: initial implementation check-in: e0138d2c86 user: sandro tags: trunk
2017-08-24
15:51
implementing dynamic styling - vector coverages check-in: d8b9d9894a user: sandro tags: trunk
2017-08-02
16:17
several enhancements affecting vector styled rendering check-in: 7d2b183801 user: sandro tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to config.h.in.

68
69
70
71
72
73
74



75
76
77
78
79
80
81
...
152
153
154
155
156
157
158



159
160
161
162
163
164
165
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <openjpeg-2.0/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_0_OPENJPEG_H

/* Define to 1 if you have the <openjpeg-2.1/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_1_OPENJPEG_H




/* Define to 1 if you have the <png.h> header file. */
#undef HAVE_PNG_H

/* Define to 1 if you have the <sqlite3ext.h> header file. */
#undef HAVE_SQLITE3EXT_H

................................................................................
#undef OMIT_OPENJPEG

/* Should be defined in order to disable WebP support. */
#undef OMIT_WEBP

/* testing for OpenJpeg 2.1 */
#undef OPENJPEG_2_1




/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT








>
>
>







 







>
>
>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <openjpeg-2.0/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_0_OPENJPEG_H

/* Define to 1 if you have the <openjpeg-2.1/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_1_OPENJPEG_H

/* Define to 1 if you have the <openjpeg-2.2/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_2_OPENJPEG_H

/* Define to 1 if you have the <png.h> header file. */
#undef HAVE_PNG_H

/* Define to 1 if you have the <sqlite3ext.h> header file. */
#undef HAVE_SQLITE3EXT_H

................................................................................
#undef OMIT_OPENJPEG

/* Should be defined in order to disable WebP support. */
#undef OMIT_WEBP

/* testing for OpenJpeg 2.1 */
#undef OPENJPEG_2_1

/* testing for OpenJpeg 2.2 */
#undef OPENJPEG_2_2

/* Name of package */
#undef PACKAGE

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

Changes to configure.

3141
3142
3143
3144
3145
3146
3147

3148
3149
3150
3151
3152
3153
3154
.....
17909
17910
17911
17912
17913
17914
17915

17916
17917
17918
17919
17920
17921
17922
.....
17933
17934
17935
17936
17937
17938
17939
17940












17941
17942

17943
17944
17945
17946
17947
17948
17949
.....
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028

# disablibg debug support

$as_echo "#define NDEBUG 1" >>confdefs.h





# config depending options





................................................................................
fi

    if test x"$enable_openjpeg" != "xno"; then
    #
    # testing OpenJpeg-2 headers
    # they could be either on -/include/openjpeg-2.0
    #                   or on -/include/openjpeg-2.1

    #
    for ac_header in openjpeg-2.0/openjpeg.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
................................................................................
  cat >>confdefs.h <<_ACEOF
#define HAVE_OPENJPEG_2_1_OPENJPEG_H 1
_ACEOF

fi

done













    if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes";

    then
        as_fn_error $? "'OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system" "$LINENO" 5
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_create_decompress in -lopenjp2" >&5
$as_echo_n "checking for opj_create_decompress in -lopenjp2... " >&6; }
if ${ac_cv_lib_openjp2_opj_create_decompress+:} false; then :
  $as_echo_n "(cached) " >&6
................................................................................

  LIBS="-lopenjp2 $LIBS"

else
  as_fn_error $? "'libopenjp2' is required but it doesn't seems to be installed on this system." "$LINENO" 5
fi

    # testing for OpenJpeg 2.0 or 2.1
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H
                                       #include <openjpeg-2.1/openjpeg.h>
                                       #else
                                       #include <openjpeg-2.0/openjpeg.h>
                                       #endif
int
main ()
{
void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

                      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
                      $as_echo "#define OPENJPEG_2_1 1" >>confdefs.h


else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
  $as_echo "#define OMIT_OPENJPEG 1" >>confdefs.h

fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------







>







 







>







 








>
>
>
>
>
>
>
>
>
>
>
>

|
>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
.....
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
.....
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
.....
18001
18002
18003
18004
18005
18006
18007





























18008
18009
18010
18011
18012
18013
18014

# disablibg debug support

$as_echo "#define NDEBUG 1" >>confdefs.h





# config depending options





................................................................................
fi

    if test x"$enable_openjpeg" != "xno"; then
    #
    # testing OpenJpeg-2 headers
    # they could be either on -/include/openjpeg-2.0
    #                   or on -/include/openjpeg-2.1
    #                   or on -/include/openjpeg-2.2
    #
    for ac_header in openjpeg-2.0/openjpeg.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
................................................................................
  cat >>confdefs.h <<_ACEOF
#define HAVE_OPENJPEG_2_1_OPENJPEG_H 1
_ACEOF

fi

done

    for ac_header in openjpeg-2.2/openjpeg.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.2/openjpeg.h" "ac_cv_header_openjpeg_2_2_openjpeg_h" "$ac_includes_default"
if test "x$ac_cv_header_openjpeg_2_2_openjpeg_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_OPENJPEG_2_2_OPENJPEG_H 1
_ACEOF

fi

done

    if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes";
    then
        as_fn_error $? "'OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system" "$LINENO" 5
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_create_decompress in -lopenjp2" >&5
$as_echo_n "checking for opj_create_decompress in -lopenjp2... " >&6; }
if ${ac_cv_lib_openjp2_opj_create_decompress+:} false; then :
  $as_echo_n "(cached) " >&6
................................................................................

  LIBS="-lopenjp2 $LIBS"

else
  as_fn_error $? "'libopenjp2' is required but it doesn't seems to be installed on this system." "$LINENO" 5
fi






























else
  $as_echo "#define OMIT_OPENJPEG 1" >>confdefs.h

fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------

Changes to configure.ac.

26
27
28
29
30
31
32


33
34
35
36
37
38
39
...
146
147
148
149
150
151
152

153
154
155

156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
AH_TEMPLATE([NDEBUG],
            [Must be defined in order to disable debug mode.])
AC_DEFINE(NDEBUG)
AH_TEMPLATE([TARGET_CPU],
            [Should contain a text-string describing the intended target CPU])
AH_TEMPLATE([OPENJPEG_2_1],
            [testing for OpenJpeg 2.1])


            
# config depending options
AH_TEMPLATE([OMIT_LZMA],
            [Should be defined in order to disable LZMA support.])
AH_TEMPLATE([OMIT_WEBP],
            [Should be defined in order to disable WebP support.])
AH_TEMPLATE([OMIT_OPENJPEG],
................................................................................
  [--enable-openjpeg], [enables OpenJpeg inclusion [default=yes]])],
  [], [enable_openjpeg=yes])
    if test x"$enable_openjpeg" != "xno"; then
    #
    # testing OpenJpeg-2 headers
    # they could be either on -/include/openjpeg-2.0
    #                   or on -/include/openjpeg-2.1

    #
    AC_CHECK_HEADERS(openjpeg-2.0/openjpeg.h)
    AC_CHECK_HEADERS(openjpeg-2.1/openjpeg.h)

    if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes";

    then
        AC_MSG_ERROR(['OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system])
    fi 
    AC_CHECK_LIB(openjp2,opj_create_decompress,,AC_MSG_ERROR(['libopenjp2' is required but it doesn't seems to be installed on this system.]),-lm)
    # testing for OpenJpeg 2.0 or 2.1
    AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H
                                       #include <openjpeg-2.1/openjpeg.h>
                                       #else
                                       #include <openjpeg-2.0/openjpeg.h>
                                       #endif]],
                                     [[void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL);]])],
                    [
                      AC_MSG_RESULT([yes])
                      AC_DEFINE(OPENJPEG_2_1)
                    ],
                    [AC_MSG_RESULT([no])]
                 )
else
  AC_DEFINE(OMIT_OPENJPEG)
fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------
#   --enable-webp







>
>







 







>



>

|
>




<
<
<
<
<
<
<
<
<
<
<
<
<







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166













167
168
169
170
171
172
173
AH_TEMPLATE([NDEBUG],
            [Must be defined in order to disable debug mode.])
AC_DEFINE(NDEBUG)
AH_TEMPLATE([TARGET_CPU],
            [Should contain a text-string describing the intended target CPU])
AH_TEMPLATE([OPENJPEG_2_1],
            [testing for OpenJpeg 2.1])
AH_TEMPLATE([OPENJPEG_2_2],
            [testing for OpenJpeg 2.2])
            
# config depending options
AH_TEMPLATE([OMIT_LZMA],
            [Should be defined in order to disable LZMA support.])
AH_TEMPLATE([OMIT_WEBP],
            [Should be defined in order to disable WebP support.])
AH_TEMPLATE([OMIT_OPENJPEG],
................................................................................
  [--enable-openjpeg], [enables OpenJpeg inclusion [default=yes]])],
  [], [enable_openjpeg=yes])
    if test x"$enable_openjpeg" != "xno"; then
    #
    # testing OpenJpeg-2 headers
    # they could be either on -/include/openjpeg-2.0
    #                   or on -/include/openjpeg-2.1
    #                   or on -/include/openjpeg-2.2
    #
    AC_CHECK_HEADERS(openjpeg-2.0/openjpeg.h)
    AC_CHECK_HEADERS(openjpeg-2.1/openjpeg.h)
    AC_CHECK_HEADERS(openjpeg-2.2/openjpeg.h)
    if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" &&
        test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes";
    then
        AC_MSG_ERROR(['OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system])
    fi 
    AC_CHECK_LIB(openjp2,opj_create_decompress,,AC_MSG_ERROR(['libopenjp2' is required but it doesn't seems to be installed on this system.]),-lm)













else
  AC_DEFINE(OMIT_OPENJPEG)
fi
#-----------------------------------------------------------------------

#-----------------------------------------------------------------------
#   --enable-webp

Changes to headers/rasterlite2/rasterlite2.h.

5253
5254
5255
5256
5257
5258
5259




5260
5261
5262
5263
5264








5265
5266
5267
5268
5269
5270
5271
5272
5273
5274




5275
5276
5277
5278
5279
5280
5281
....
5284
5285
5286
5287
5288
5289
5290








5291
5292
5293
5294
5295
5296
5297
5298
5299









5300
5301
5302
5303
5304
5305
5306
....
5310
5311
5312
5313
5314
5315
5316








5317
5318
5319
5320
5321
5322
5323
....
5341
5342
5343
5344
5345
5346
5347































5348
5349
5350
5351
5352
5353
5354
....
5368
5369
5370
5371
5372
5373
5374








5375
5376
5377
5378
5379
5380
5381












5382
5383
5384
5385
5386
5387
5388
5389
5390
5391








5392
5393
5394
5395
5396
5397
5398








5399
5400
5401
5402
5403
5404
5405
5406
5407
5408




5409
5410
5411
5412
5413
5414
5415
....
5424
5425
5426
5427
5428
5429
5430








5431
5432
5433
5434
5435
5436
5437
....
5438
5439
5440
5441
5442
5443
5444












5445
5446
5447
5448
5449
5450
5451
5452
5453
5454








5455
5456
5457
5458
5459
5460
5461
5462
5463








5464
5465
5466
5467
5468
5469
5470
....
5478
5479
5480
5481
5482
5483
5484




5485
5486
5487
5488
5489








5490
5491
5492
5493
5494
5495
5496
....
5503
5504
5505
5506
5507
5508
5509




















5510
5511
5512



































5513
5514
5515
5516
5517
5518
5519
....
5572
5573
5574
5575
5576
5577
5578











5579
5580
5581
5582
5583
5584
5585




5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596












5597
5598
5599
5600
5601
5602
5603
5604
5605












5606
5607
5608
5609
5610
5611
5612
	rl2_point_symbolizer_is_graphic (rl2PointSymbolizerPtr symbolizer,
					 int index, int *external_graphic);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_graphic_href (rl2PointSymbolizerPtr
						symbolizer, int index);





    RL2_DECLARE int
	rl2_point_symbolizer_get_graphic_recode_color
	(rl2PointSymbolizerPtr symbolizer, int index, int repl_index,
	 int *color_index, unsigned char *red, unsigned char *green,
	 unsigned char *blue);









    RL2_DECLARE int
	rl2_point_symbolizer_is_mark (rl2PointSymbolizerPtr symbolizer,
				      int index, int *mark);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_well_known_type (rl2PointSymbolizerPtr
						       symbolizer, int index,
						       unsigned char *type);





    RL2_DECLARE int
	rl2_point_symbolizer_mark_has_stroke (rl2PointSymbolizerPtr symbolizer,
					      int index, int *stroke);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_color (rl2PointSymbolizerPtr
						    symbolizer, int index,
................................................................................
						    unsigned char *blue);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_width (rl2PointSymbolizerPtr
						    symbolizer, int index,
						    double *width);









    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_linejoin (rl2PointSymbolizerPtr
						       symbolizer, int index,
						       unsigned char *linejoin);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_linecap (rl2PointSymbolizerPtr
						      symbolizer, int index,
						      unsigned char *linecap);










    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_dash_offset (rl2PointSymbolizerPtr
							  symbolizer, int index,
							  double *offset);

    RL2_DECLARE int
................................................................................

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_dash_item (rl2PointSymbolizerPtr
							symbolizer, int index,
							int item_index,
							double *item);









    RL2_DECLARE int
	rl2_point_symbolizer_mark_has_fill (rl2PointSymbolizerPtr symbolizer,
					    int index, int *fill);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_fill_color (rl2PointSymbolizerPtr
						  symbolizer, int index,
................................................................................
	rl2_point_symbolizer_get_anchor_point (rl2PointSymbolizerPtr symbolizer,
					       double *x, double *y);

    RL2_DECLARE int
	rl2_point_symbolizer_get_displacement (rl2PointSymbolizerPtr symbolizer,
					       double *x, double *y);
































    RL2_DECLARE int
	rl2_line_symbolizer_has_stroke (rl2LineSymbolizerPtr symbolizer,
					int *stroke);

    RL2_DECLARE int
	rl2_line_symbolizer_has_graphic_stroke (rl2LineSymbolizerPtr symbolizer,
						int *stroke);
................................................................................

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_color (rl2LineSymbolizerPtr symbolizer,
					      unsigned char *red,
					      unsigned char *green,
					      unsigned char *blue);









    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_opacity (rl2LineSymbolizerPtr symbolizer,
						double *opacity);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_width (rl2LineSymbolizerPtr symbolizer,
					      double *width);













    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_linejoin (rl2LineSymbolizerPtr
						 symbolizer,
						 unsigned char *linejoin);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_linecap (rl2LineSymbolizerPtr symbolizer,
						unsigned char *linecap);









    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_offset (rl2LineSymbolizerPtr
						    symbolizer, double *offset);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_count (rl2LineSymbolizerPtr
						   symbolizer, int *count);









    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_item (rl2LineSymbolizerPtr
						  symbolizer, int index,
						  double *item);

    RL2_DECLARE int
	rl2_line_symbolizer_get_perpendicular_offset (rl2LineSymbolizerPtr
						      symbolizer,
						      double *offset);





    RL2_DECLARE int
	rl2_polygon_symbolizer_has_stroke (rl2PolygonSymbolizerPtr symbolizer,
					   int *stroke);

    RL2_DECLARE int
	rl2_polygon_symbolizer_has_graphic_stroke (rl2PolygonSymbolizerPtr
................................................................................
	(rl2PolygonSymbolizerPtr symbolizer, int *count);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_stroke_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index,
	 unsigned char *red, unsigned char *green, unsigned char *blue);









    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_color (rl2PolygonSymbolizerPtr
						 symbolizer, unsigned char *red,
						 unsigned char *green,
						 unsigned char *blue);

    RL2_DECLARE int
................................................................................
	rl2_polygon_symbolizer_get_stroke_opacity (rl2PolygonSymbolizerPtr
						   symbolizer, double *opacity);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_width (rl2PolygonSymbolizerPtr
						 symbolizer, double *width);













    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_linejoin (rl2PolygonSymbolizerPtr
						    symbolizer,
						    unsigned char *linejoin);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_linecap (rl2PolygonSymbolizerPtr
						   symbolizer,
						   unsigned char *linecap);









    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_offset (rl2PolygonSymbolizerPtr
						       symbolizer,
						       double *offset);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_count (rl2PolygonSymbolizerPtr
						      symbolizer, int *count);









    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_item (rl2PolygonSymbolizerPtr
						     symbolizer, int index,
						     double *item);

    RL2_DECLARE int
	rl2_polygon_symbolizer_has_fill (rl2PolygonSymbolizerPtr symbolizer,
................................................................................
	*rl2_polygon_symbolizer_get_graphic_fill_href (rl2PolygonSymbolizerPtr
						       symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_fill_recode_count
	(rl2PolygonSymbolizerPtr symbolizer, int *count);





    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_fill_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index,
	 unsigned char *red, unsigned char *green, unsigned char *blue);









    RL2_DECLARE int
	rl2_polygon_symbolizer_get_fill_color (rl2PolygonSymbolizerPtr
					       symbolizer, unsigned char *red,
					       unsigned char *green,
					       unsigned char *blue);

    RL2_DECLARE int
................................................................................
						 double *y);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_perpendicular_offset (rl2PolygonSymbolizerPtr
							 symbolizer,
							 double *offset);





















    RL2_DECLARE const char *rl2_text_symbolizer_get_label (rl2TextSymbolizerPtr
							   symbolizer);




































    RL2_DECLARE int
	rl2_text_symbolizer_get_font_families_count (rl2TextSymbolizerPtr
						     symbolizer, int *count);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_font_family_name (rl2TextSymbolizerPtr
						   symbolizer, int index);
................................................................................
							   symbolizer,
							   int *is_aligned);

    RL2_DECLARE int
	rl2_text_symbolizer_get_line_placement_generalize_line
	(rl2TextSymbolizerPtr symbolizer, int *generalize_line);












    RL2_DECLARE int
	rl2_text_symbolizer_has_halo (rl2TextSymbolizerPtr symbolizer,
				      int *halo);

    RL2_DECLARE int
	rl2_text_symbolizer_get_halo_radius (rl2TextSymbolizerPtr symbolizer,
					     double *radius);





    RL2_DECLARE int
	rl2_text_symbolizer_has_halo_fill (rl2TextSymbolizerPtr symbolizer,
					   int *fill);

    RL2_DECLARE int
	rl2_text_symbolizer_get_halo_fill_color (rl2TextSymbolizerPtr
						 symbolizer, unsigned char *red,
						 unsigned char *green,
						 unsigned char *blue);













    RL2_DECLARE int
	rl2_text_symbolizer_has_fill (rl2TextSymbolizerPtr symbolizer,
				      int *fill);

    RL2_DECLARE int
	rl2_text_symbolizer_get_fill_color (rl2TextSymbolizerPtr symbolizer,
					    unsigned char *red,
					    unsigned char *green,
					    unsigned char *blue);













    RL2_DECLARE rl2GroupStylePtr
	rl2_create_group_style_from_dbms (sqlite3 * handle,
					  const char *db_prefix,
					  const char *group, const char *style);

    RL2_DECLARE void rl2_destroy_group_style (rl2GroupStylePtr style);







>
>
>
>





>
>
>
>
>
>
>
>










>
>
>
>







 







>
>
>
>
>
>
>
>









>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>







>
>
>
>
>
>
>
>
>
>
>
>










>
>
>
>
>
>
>
>







>
>
>
>
>
>
>
>










>
>
>
>







 







>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>










>
>
>
>
>
>
>
>









>
>
>
>
>
>
>
>







 







>
>
>
>





>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>







>
>
>
>











>
>
>
>
>
>
>
>
>
>
>
>









>
>
>
>
>
>
>
>
>
>
>
>







5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
....
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
....
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
....
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
....
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
....
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
....
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
....
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
....
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
....
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
	rl2_point_symbolizer_is_graphic (rl2PointSymbolizerPtr symbolizer,
					 int index, int *external_graphic);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_graphic_href (rl2PointSymbolizerPtr
						symbolizer, int index);

    RL2_DECLARE int
	rl2_point_symbolizer_get_graphic_recode_count
	(rl2PointSymbolizerPtr symbolizer, int index, int *count);

    RL2_DECLARE int
	rl2_point_symbolizer_get_graphic_recode_color
	(rl2PointSymbolizerPtr symbolizer, int index, int repl_index,
	 int *color_index, unsigned char *red, unsigned char *green,
	 unsigned char *blue);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_graphic_href (rl2PointSymbolizerPtr
						    symbolizer, int index);

    RL2_DECLARE const char *rl2_point_symbolizer_get_col_graphic_recode_color
	(rl2PointSymbolizerPtr symbolizer, int index, int repl_index,
	 int *color_index);

    RL2_DECLARE int
	rl2_point_symbolizer_is_mark (rl2PointSymbolizerPtr symbolizer,
				      int index, int *mark);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_well_known_type (rl2PointSymbolizerPtr
						       symbolizer, int index,
						       unsigned char *type);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_well_known_type
	(rl2PointSymbolizerPtr symbolizer, int index);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_has_stroke (rl2PointSymbolizerPtr symbolizer,
					      int index, int *stroke);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_color (rl2PointSymbolizerPtr
						    symbolizer, int index,
................................................................................
						    unsigned char *blue);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_width (rl2PointSymbolizerPtr
						    symbolizer, int index,
						    double *width);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_color (rl2PointSymbolizerPtr
							 symbolizer, int index);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_width (rl2PointSymbolizerPtr
							 symbolizer, int index);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_linejoin (rl2PointSymbolizerPtr
						       symbolizer, int index,
						       unsigned char *linejoin);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_linecap (rl2PointSymbolizerPtr
						      symbolizer, int index,
						      unsigned char *linecap);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_linejoin
	(rl2PointSymbolizerPtr symbolizer, int index);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_linecap (rl2PointSymbolizerPtr
							   symbolizer,
							   int index);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_dash_offset (rl2PointSymbolizerPtr
							  symbolizer, int index,
							  double *offset);

    RL2_DECLARE int
................................................................................

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_stroke_dash_item (rl2PointSymbolizerPtr
							symbolizer, int index,
							int item_index,
							double *item);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_dash_array
	(rl2PointSymbolizerPtr symbolizer, int index);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_stroke_dash_offset
	(rl2PointSymbolizerPtr symbolizer, int index);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_has_fill (rl2PointSymbolizerPtr symbolizer,
					    int index, int *fill);

    RL2_DECLARE int
	rl2_point_symbolizer_mark_get_fill_color (rl2PointSymbolizerPtr
						  symbolizer, int index,
................................................................................
	rl2_point_symbolizer_get_anchor_point (rl2PointSymbolizerPtr symbolizer,
					       double *x, double *y);

    RL2_DECLARE int
	rl2_point_symbolizer_get_displacement (rl2PointSymbolizerPtr symbolizer,
					       double *x, double *y);

    RL2_DECLARE const char
	*rl2_point_symbolizer_mark_get_col_fill_color (rl2PointSymbolizerPtr
						       symbolizer, int index);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_opacity (rl2PointSymbolizerPtr
					       symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_size (rl2PointSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_rotation (rl2PointSymbolizerPtr
						symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_anchor_point_x (rl2PointSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_anchor_point_y (rl2PointSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_displacement_x (rl2PointSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_point_symbolizer_get_col_displacement_y (rl2PointSymbolizerPtr
						      symbolizer);

    RL2_DECLARE int
	rl2_line_symbolizer_has_stroke (rl2LineSymbolizerPtr symbolizer,
					int *stroke);

    RL2_DECLARE int
	rl2_line_symbolizer_has_graphic_stroke (rl2LineSymbolizerPtr symbolizer,
						int *stroke);
................................................................................

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_color (rl2LineSymbolizerPtr symbolizer,
					      unsigned char *red,
					      unsigned char *green,
					      unsigned char *blue);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_graphic_stroke_href (rl2LineSymbolizerPtr
							  symbolizer);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_graphic_stroke_recode_color
	(rl2LineSymbolizerPtr symbolizer, int index, int *color_index);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_opacity (rl2LineSymbolizerPtr symbolizer,
						double *opacity);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_width (rl2LineSymbolizerPtr symbolizer,
					      double *width);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_color (rl2LineSymbolizerPtr
						   symbolizer);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_opacity (rl2LineSymbolizerPtr
						     symbolizer);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_width (rl2LineSymbolizerPtr
						   symbolizer);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_linejoin (rl2LineSymbolizerPtr
						 symbolizer,
						 unsigned char *linejoin);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_linecap (rl2LineSymbolizerPtr symbolizer,
						unsigned char *linecap);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_linejoin (rl2LineSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_linecap (rl2LineSymbolizerPtr
						     symbolizer);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_offset (rl2LineSymbolizerPtr
						    symbolizer, double *offset);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_count (rl2LineSymbolizerPtr
						   symbolizer, int *count);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_dash_array (rl2LineSymbolizerPtr
							symbolizer);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_stroke_dash_offset (rl2LineSymbolizerPtr
							 symbolizer);

    RL2_DECLARE int
	rl2_line_symbolizer_get_stroke_dash_item (rl2LineSymbolizerPtr
						  symbolizer, int index,
						  double *item);

    RL2_DECLARE int
	rl2_line_symbolizer_get_perpendicular_offset (rl2LineSymbolizerPtr
						      symbolizer,
						      double *offset);

    RL2_DECLARE const char
	*rl2_line_symbolizer_get_col_perpendicular_offset (rl2LineSymbolizerPtr
							   symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_has_stroke (rl2PolygonSymbolizerPtr symbolizer,
					   int *stroke);

    RL2_DECLARE int
	rl2_polygon_symbolizer_has_graphic_stroke (rl2PolygonSymbolizerPtr
................................................................................
	(rl2PolygonSymbolizerPtr symbolizer, int *count);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_stroke_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index,
	 unsigned char *red, unsigned char *green, unsigned char *blue);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_graphic_stroke_href
	(rl2PolygonSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_color (rl2PolygonSymbolizerPtr
						 symbolizer, unsigned char *red,
						 unsigned char *green,
						 unsigned char *blue);

    RL2_DECLARE int
................................................................................
	rl2_polygon_symbolizer_get_stroke_opacity (rl2PolygonSymbolizerPtr
						   symbolizer, double *opacity);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_width (rl2PolygonSymbolizerPtr
						 symbolizer, double *width);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_color (rl2PolygonSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_opacity (rl2PolygonSymbolizerPtr
							symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_width (rl2PolygonSymbolizerPtr
						      symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_linejoin (rl2PolygonSymbolizerPtr
						    symbolizer,
						    unsigned char *linejoin);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_linecap (rl2PolygonSymbolizerPtr
						   symbolizer,
						   unsigned char *linecap);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_linejoin (rl2PolygonSymbolizerPtr
							 symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_linecap (rl2PolygonSymbolizerPtr
							symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_offset (rl2PolygonSymbolizerPtr
						       symbolizer,
						       double *offset);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_count (rl2PolygonSymbolizerPtr
						      symbolizer, int *count);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_dash_array
	(rl2PolygonSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_stroke_dash_offset
	(rl2PolygonSymbolizerPtr symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_stroke_dash_item (rl2PolygonSymbolizerPtr
						     symbolizer, int index,
						     double *item);

    RL2_DECLARE int
	rl2_polygon_symbolizer_has_fill (rl2PolygonSymbolizerPtr symbolizer,
................................................................................
	*rl2_polygon_symbolizer_get_graphic_fill_href (rl2PolygonSymbolizerPtr
						       symbolizer);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_fill_recode_count
	(rl2PolygonSymbolizerPtr symbolizer, int *count);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_fill_recode_count
	(rl2PolygonSymbolizerPtr symbolizer, int *count);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_graphic_fill_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index,
	 unsigned char *red, unsigned char *green, unsigned char *blue);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_graphic_fill_href
	(rl2PolygonSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_graphic_fill_recode_color
	(rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_fill_color (rl2PolygonSymbolizerPtr
					       symbolizer, unsigned char *red,
					       unsigned char *green,
					       unsigned char *blue);

    RL2_DECLARE int
................................................................................
						 double *y);

    RL2_DECLARE int
	rl2_polygon_symbolizer_get_perpendicular_offset (rl2PolygonSymbolizerPtr
							 symbolizer,
							 double *offset);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_fill_color (rl2PolygonSymbolizerPtr
						    symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_fill_opacity (rl2PolygonSymbolizerPtr
						      symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_displacement_x (rl2PolygonSymbolizerPtr
							symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_displacement_y (rl2PolygonSymbolizerPtr
							symbolizer);

    RL2_DECLARE const char
	*rl2_polygon_symbolizer_get_col_perpendicular_offset
	(rl2PolygonSymbolizerPtr symbolizer);

    RL2_DECLARE const char *rl2_text_symbolizer_get_label (rl2TextSymbolizerPtr
							   symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_label (rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_font (rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_style (rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_weight (rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_size (rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_point_placement_col_anchor_point_x
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_point_placement_col_anchor_point_y
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_point_placement_col_displacement_x
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_point_placement_col_displacement_y
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_point_placement_col_rotation
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_get_font_families_count (rl2TextSymbolizerPtr
						     symbolizer, int *count);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_font_family_name (rl2TextSymbolizerPtr
						   symbolizer, int index);
................................................................................
							   symbolizer,
							   int *is_aligned);

    RL2_DECLARE int
	rl2_text_symbolizer_get_line_placement_generalize_line
	(rl2TextSymbolizerPtr symbolizer, int *generalize_line);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_line_placement_col_perpendicular_offset
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_line_placement_col_initial_gap
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE const char *rl2_text_symbolizer_get_line_placement_col_gap
	(rl2TextSymbolizerPtr symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_has_halo (rl2TextSymbolizerPtr symbolizer,
				      int *halo);

    RL2_DECLARE int
	rl2_text_symbolizer_get_halo_radius (rl2TextSymbolizerPtr symbolizer,
					     double *radius);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_halo_col_radius (rl2TextSymbolizerPtr
						  symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_has_halo_fill (rl2TextSymbolizerPtr symbolizer,
					   int *fill);

    RL2_DECLARE int
	rl2_text_symbolizer_get_halo_fill_color (rl2TextSymbolizerPtr
						 symbolizer, unsigned char *red,
						 unsigned char *green,
						 unsigned char *blue);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_halo_col_fill_color (rl2TextSymbolizerPtr
						      symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_get_halo_fill_opacity (rl2TextSymbolizerPtr
						   symbolizer, double *opacity);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_halo_col_fill_opacity (rl2TextSymbolizerPtr
							symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_has_fill (rl2TextSymbolizerPtr symbolizer,
				      int *fill);

    RL2_DECLARE int
	rl2_text_symbolizer_get_fill_color (rl2TextSymbolizerPtr symbolizer,
					    unsigned char *red,
					    unsigned char *green,
					    unsigned char *blue);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_fill_color (rl2TextSymbolizerPtr
						 symbolizer);

    RL2_DECLARE int
	rl2_text_symbolizer_get_fill_opacity (rl2TextSymbolizerPtr
					      symbolizer, double *opacity);

    RL2_DECLARE const char
	*rl2_text_symbolizer_get_col_fill_opacity (rl2TextSymbolizerPtr
						   symbolizer);

    RL2_DECLARE rl2GroupStylePtr
	rl2_create_group_style_from_dbms (sqlite3 * handle,
					  const char *db_prefix,
					  const char *group, const char *style);

    RL2_DECLARE void rl2_destroy_group_style (rl2GroupStylePtr style);

Changes to headers/rasterlite2_private.h.

652
653
654
655
656
657
658

659
660
661
662
663
664
665

666
667
668
669
670
671
672
673
674
675
676

677
678
679
680
681
682
683
...
692
693
694
695
696
697
698







699
700
701
702
703
704
705
...
708
709
710
711
712
713
714







715
716
717
718
719
720
721
722
723
724


725
726
727
728
729
730
731
732
733
734
735
736
737

738
739
740
741
742
743
744
745
746
747



748
749
750
751
752
753
754
755
756
757





758
759
760
761
762
763
764
765
766
767
768



769
770
771
772
773
774
775

776
777
778
779
780
781
782
...
784
785
786
787
788
789
790





791
792
793
794
795
796
797
....
2261
2262
2263
2264
2265
2266
2267
2268











































































2269
2270
2271
2272
2273

    typedef struct rl2_priv_color_replacement
    {
	int index;
	unsigned char red;
	unsigned char green;
	unsigned char blue;

	struct rl2_priv_color_replacement *next;
    } rl2PrivColorReplacement;
    typedef rl2PrivColorReplacement *rl2PrivColorReplacementPtr;

    typedef struct rl2_priv_external_graphic
    {
	char *xlink_href;

	rl2PrivColorReplacementPtr first;
	rl2PrivColorReplacementPtr last;
    } rl2PrivExternalGraphic;
    typedef rl2PrivExternalGraphic *rl2PrivExternalGraphicPtr;

    typedef struct rl2_priv_mark
    {
	unsigned char well_known_type;
	rl2PrivExternalGraphicPtr external_graphic;
	struct rl2_priv_stroke *stroke;
	struct rl2_priv_fill *fill;

    } rl2PrivMark;
    typedef rl2PrivMark *rl2PrivMarkPtr;

    typedef struct rl2_priv_graphic_item
    {
	unsigned char type;
	void *item;
................................................................................
	double opacity;
	double size;
	double rotation;
	double anchor_point_x;
	double anchor_point_y;
	double displacement_x;
	double displacement_y;







    } rl2PrivGraphic;
    typedef rl2PrivGraphic *rl2PrivGraphicPtr;

    typedef struct rl2_priv_stroke
    {
	rl2PrivGraphicPtr graphic;
	unsigned char red;
................................................................................
	double opacity;
	double width;
	unsigned char linejoin;
	unsigned char linecap;
	int dash_count;
	double *dash_list;
	double dash_offset;







    } rl2PrivStroke;
    typedef rl2PrivStroke *rl2PrivStrokePtr;

    typedef struct rl2_priv_fill
    {
	rl2PrivGraphicPtr graphic;
	unsigned char red;
	unsigned char green;
	unsigned char blue;
	double opacity;


    } rl2PrivFill;
    typedef rl2PrivFill *rl2PrivFillPtr;

    typedef struct rl2_priv_point_symbolizer
    {
	rl2PrivGraphicPtr graphic;
    } rl2PrivPointSymbolizer;
    typedef rl2PrivPointSymbolizer *rl2PrivPointSymbolizerPtr;

    typedef struct rl2_priv_line_symbolizer
    {
	rl2PrivStrokePtr stroke;
	double perpendicular_offset;

    } rl2PrivLineSymbolizer;
    typedef rl2PrivLineSymbolizer *rl2PrivLineSymbolizerPtr;

    typedef struct rl2_priv_polygon_symbolizer
    {
	rl2PrivStrokePtr stroke;
	rl2PrivFillPtr fill;
	double displacement_x;
	double displacement_y;
	double perpendicular_offset;



    } rl2PrivPolygonSymbolizer;
    typedef rl2PrivPolygonSymbolizer *rl2PrivPolygonSymbolizerPtr;

    typedef struct rl2_priv_point_placement
    {
	double anchor_point_x;
	double anchor_point_y;
	double displacement_x;
	double displacement_y;
	double rotation;





    } rl2PrivPointPlacement;
    typedef rl2PrivPointPlacement *rl2PrivPointPlacementPtr;

    typedef struct rl2_priv_line_placement
    {
	double perpendicular_offset;
	int is_repeated;
	double initial_gap;
	double gap;
	int is_aligned;
	int generalize_line;



    } rl2PrivLinePlacement;
    typedef rl2PrivLinePlacement *rl2PrivLinePlacementPtr;

    typedef struct rl2_priv_halo
    {
	double radius;
	rl2PrivFillPtr fill;

    } rl2PrivHalo;
    typedef rl2PrivHalo *rl2PrivHaloPtr;

    typedef struct rl2_priv_text_symbolizer
    {
	char *label;
	int font_families_count;
................................................................................
	unsigned char font_style;
	unsigned char font_weight;
	double font_size;
	unsigned char label_placement_type;
	void *label_placement;
	rl2PrivHaloPtr halo;
	rl2PrivFillPtr fill;





    } rl2PrivTextSymbolizer;
    typedef rl2PrivTextSymbolizer *rl2PrivTextSymbolizerPtr;

    typedef struct rl2_priv_vector_symbolizer_item
    {
	unsigned char symbolizer_type;
	void *symbolizer;
................................................................................
	rl2_load_cached_raster (sqlite3 * handle, const void *data,
				const char *db_prefix, const char *coverage,
				int pyramid_level, double x, double y,
				rl2PalettePtr palette, rl2RasterPtr * raster);

    RL2_PRIVATE void
	rl2_destroy_private_tt_font (struct rl2_private_tt_font *font);












































































#ifdef __cplusplus
}
#endif

#endif				/* _RASTERLITE2_PRIVATE_H */







>







>








<


>







 







>
>
>
>
>
>
>







 







>
>
>
>
>
>
>










>
>













>










>
>
>










>
>
>
>
>











>
>
>







>







 







>
>
>
>
>







 








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675

676
677
678
679
680
681
682
683
684
685
...
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
...
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
...
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
....
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384

    typedef struct rl2_priv_color_replacement
    {
	int index;
	unsigned char red;
	unsigned char green;
	unsigned char blue;
	char *col_color;	/* table column: color */
	struct rl2_priv_color_replacement *next;
    } rl2PrivColorReplacement;
    typedef rl2PrivColorReplacement *rl2PrivColorReplacementPtr;

    typedef struct rl2_priv_external_graphic
    {
	char *xlink_href;
	char *col_href;		/* table column: href */
	rl2PrivColorReplacementPtr first;
	rl2PrivColorReplacementPtr last;
    } rl2PrivExternalGraphic;
    typedef rl2PrivExternalGraphic *rl2PrivExternalGraphicPtr;

    typedef struct rl2_priv_mark
    {
	unsigned char well_known_type;

	struct rl2_priv_stroke *stroke;
	struct rl2_priv_fill *fill;
	char *col_mark_type;	/* table column: well known type */
    } rl2PrivMark;
    typedef rl2PrivMark *rl2PrivMarkPtr;

    typedef struct rl2_priv_graphic_item
    {
	unsigned char type;
	void *item;
................................................................................
	double opacity;
	double size;
	double rotation;
	double anchor_point_x;
	double anchor_point_y;
	double displacement_x;
	double displacement_y;
	char *col_opacity;	/* table column: opacity */
	char *col_size;		/* table column: size */
	char *col_rotation;	/* table column: rotation */
	char *col_point_x;	/* table column: anchor point x */
	char *col_point_y;	/* table column: anchor point y */
	char *col_displ_x;	/* table column: displacement x */
	char *col_displ_y;	/* table_column: displacement y */
    } rl2PrivGraphic;
    typedef rl2PrivGraphic *rl2PrivGraphicPtr;

    typedef struct rl2_priv_stroke
    {
	rl2PrivGraphicPtr graphic;
	unsigned char red;
................................................................................
	double opacity;
	double width;
	unsigned char linejoin;
	unsigned char linecap;
	int dash_count;
	double *dash_list;
	double dash_offset;
	char *col_color;	/* table column: stroke color */
	char *col_opacity;	/* table column: stroke opacity */
	char *col_width;	/* table column: width */
	char *col_join;		/* table column: linejoin */
	char *col_cap;		/* table_column: linecap */
	char *col_dash;		/* table_column: dash list */
	char *col_dashoff;	/* table_column: dash offset */
    } rl2PrivStroke;
    typedef rl2PrivStroke *rl2PrivStrokePtr;

    typedef struct rl2_priv_fill
    {
	rl2PrivGraphicPtr graphic;
	unsigned char red;
	unsigned char green;
	unsigned char blue;
	double opacity;
	char *col_color;	/* table column: fill color */
	char *col_opacity;	/* table column: fill opacity */
    } rl2PrivFill;
    typedef rl2PrivFill *rl2PrivFillPtr;

    typedef struct rl2_priv_point_symbolizer
    {
	rl2PrivGraphicPtr graphic;
    } rl2PrivPointSymbolizer;
    typedef rl2PrivPointSymbolizer *rl2PrivPointSymbolizerPtr;

    typedef struct rl2_priv_line_symbolizer
    {
	rl2PrivStrokePtr stroke;
	double perpendicular_offset;
	char *col_perpoff;	/* table column: perpendicular offset */
    } rl2PrivLineSymbolizer;
    typedef rl2PrivLineSymbolizer *rl2PrivLineSymbolizerPtr;

    typedef struct rl2_priv_polygon_symbolizer
    {
	rl2PrivStrokePtr stroke;
	rl2PrivFillPtr fill;
	double displacement_x;
	double displacement_y;
	double perpendicular_offset;
	char *col_displ_x;	/* table column: displacement x */
	char *col_displ_y;	/* table column: displacement y */
	char *col_perpoff;	/* table column: perpendicular offset */
    } rl2PrivPolygonSymbolizer;
    typedef rl2PrivPolygonSymbolizer *rl2PrivPolygonSymbolizerPtr;

    typedef struct rl2_priv_point_placement
    {
	double anchor_point_x;
	double anchor_point_y;
	double displacement_x;
	double displacement_y;
	double rotation;
	char *col_point_x;	/* table column: anchor point x */
	char *col_point_y;	/* table column: anchor point y */
	char *col_displ_x;	/* table column: displacement x */
	char *col_displ_y;	/* table_column: displacement y */
	char *col_rotation;	/* table column: rotation */
    } rl2PrivPointPlacement;
    typedef rl2PrivPointPlacement *rl2PrivPointPlacementPtr;

    typedef struct rl2_priv_line_placement
    {
	double perpendicular_offset;
	int is_repeated;
	double initial_gap;
	double gap;
	int is_aligned;
	int generalize_line;
	char *col_perpoff;	/* table column: perpendicular offset */
	char *col_inigap;	/* table column: initial gap */
	char *col_gap;		/* table column: gap */
    } rl2PrivLinePlacement;
    typedef rl2PrivLinePlacement *rl2PrivLinePlacementPtr;

    typedef struct rl2_priv_halo
    {
	double radius;
	rl2PrivFillPtr fill;
	char *col_radius;	/* table column: radius */
    } rl2PrivHalo;
    typedef rl2PrivHalo *rl2PrivHaloPtr;

    typedef struct rl2_priv_text_symbolizer
    {
	char *label;
	int font_families_count;
................................................................................
	unsigned char font_style;
	unsigned char font_weight;
	double font_size;
	unsigned char label_placement_type;
	void *label_placement;
	rl2PrivHaloPtr halo;
	rl2PrivFillPtr fill;
	char *col_label;	/* table column: label value */
	char *col_font;		/* table column: font facename */
	char *col_style;	/* table column: font style */
	char *col_weight;	/* table_column: font weight */
	char *col_size;		/* table column: font size */
    } rl2PrivTextSymbolizer;
    typedef rl2PrivTextSymbolizer *rl2PrivTextSymbolizerPtr;

    typedef struct rl2_priv_vector_symbolizer_item
    {
	unsigned char symbolizer_type;
	void *symbolizer;
................................................................................
	rl2_load_cached_raster (sqlite3 * handle, const void *data,
				const char *db_prefix, const char *coverage,
				int pyramid_level, double x, double y,
				rl2PalettePtr palette, rl2RasterPtr * raster);

    RL2_PRIVATE void
	rl2_destroy_private_tt_font (struct rl2_private_tt_font *font);

    RL2_PRIVATE rl2PrivPointSymbolizerPtr
	rl2_clone_point_symbolizer (rl2PrivPointSymbolizerPtr in);

    RL2_PRIVATE rl2PrivLineSymbolizerPtr
	rl2_clone_line_symbolizer (rl2PrivLineSymbolizerPtr in);

    RL2_PRIVATE rl2PrivPolygonSymbolizerPtr
	rl2_clone_polygon_symbolizer (rl2PrivPolygonSymbolizerPtr in);

    RL2_PRIVATE rl2PrivTextSymbolizerPtr
	rl2_clone_text_symbolizer (rl2PrivTextSymbolizerPtr in);

    RL2_PRIVATE rl2PrivMarkPtr
	rl2_point_symbolizer_get_mark_ref (rl2PointSymbolizerPtr point,
					   int index);

    RL2_PRIVATE rl2PrivExternalGraphicPtr
	rl2_point_symbolizer_get_external_graphic_ref (rl2PointSymbolizerPtr
						       point, int index);

    RL2_PRIVATE rl2PrivColorReplacementPtr
	rl2_point_symbolizer_get_color_replacement_ref (rl2PointSymbolizerPtr
							point, int index,
							int repl_index,
							int *color_index);

    RL2_PRIVATE rl2PrivExternalGraphicPtr
	rl2_line_symbolizer_get_stroke_external_graphic_ref
	(rl2LineSymbolizerPtr line);

    RL2_PRIVATE rl2PrivColorReplacementPtr
	rl2_line_symbolizer_get_stroke_color_replacement_ref
	(rl2LineSymbolizerPtr line, int index, int *color_index);

    RL2_PRIVATE rl2PrivExternalGraphicPtr
	rl2_polygon_symbolizer_get_stroke_external_graphic_ref
	(rl2PolygonSymbolizerPtr polyg);

    RL2_PRIVATE rl2PrivColorReplacementPtr
	rl2_polygon_symbolizer_get_stroke_color_replacement_ref
	(rl2PolygonSymbolizerPtr polyg, int index, int *color_index);

    RL2_PRIVATE rl2PrivExternalGraphicPtr
	rl2_polygon_symbolizer_get_fill_external_graphic_ref
	(rl2PolygonSymbolizerPtr polyg);

    RL2_PRIVATE rl2PrivColorReplacementPtr
	rl2_polygon_symbolizer_get_fill_color_replacement_ref
	(rl2PolygonSymbolizerPtr polyg, int index, int *color_index);

    RL2_PRIVATE void
	rl2_set_point_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
					     rl2PrivPointSymbolizerPtr point);

    RL2_PRIVATE void
	rl2_set_line_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
					    rl2PrivLineSymbolizerPtr line);

    RL2_PRIVATE void
	rl2_set_polygon_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
					       rl2PrivPolygonSymbolizerPtr
					       polygon);

    RL2_PRIVATE void
	rl2_set_text_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
					    rl2PrivTextSymbolizerPtr text);

    RL2_PRIVATE void
	rl2_add_dyn_symbolizer (rl2PrivVectorSymbolizerPtr dyn, int type,
				void *symbolizer);

    RL2_PRIVATE int
	parse_sld_se_stroke_dasharray (const char *value, int *count,
				       double **list);

#ifdef __cplusplus
}
#endif

#endif				/* _RASTERLITE2_PRIVATE_H */

Changes to src/Makefile.am.

11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
..
31
32
33
34
35
36
37
38

39
40
41
42
43
44
45

librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2_internal_data.c


librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@	@LIBCURL_LIBS@ \
	@LIBXML2_LIBS@ @LIBFREETYPE2_LIBS@

if MINGW
librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
................................................................................

mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2_internal_data.c


mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
	@LIBXML2_LIBS@ @LIBFREETYPE2_LIBS@

mod_rasterlite2_la_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
mod_rasterlite2_la_CPPFLAGS += -I$(top_srcdir)/headers -I.







|
>







 







|
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2symclone.c \
	rl2_internal_data.c

librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@	@LIBCURL_LIBS@ \
	@LIBXML2_LIBS@ @LIBFREETYPE2_LIBS@

if MINGW
librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
................................................................................

mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2symclone.c \
	rl2_internal_data.c

mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
	@LIBXML2_LIBS@ @LIBFREETYPE2_LIBS@

mod_rasterlite2_la_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
mod_rasterlite2_la_CPPFLAGS += -I$(top_srcdir)/headers -I.

Changes to src/Makefile.in.

141
142
143
144
145
146
147
148

149
150
151
152
153
154
155
...
173
174
175
176
177
178
179

180
181
182
183
184
185
186
...
398
399
400
401
402
403
404
405

406
407
408
409
410
411
412
413
414
415
416
417
418

419
420
421
422
423
424
425
...
531
532
533
534
535
536
537

538
539
540
541
542
543
544
...
561
562
563
564
565
566
567

568
569
570
571
572
573
574
...
797
798
799
800
801
802
803







804
805
806
807
808
809
810
	$(am__DEPENDENCIES_1)
am_librasterlite2_la_OBJECTS = rasterlite2.lo rl2raw.lo rl2codec.lo \
	rl2jpeg.lo rl2png.lo rl2gif.lo rl2webp.lo rl2tiff.lo rl2wms.lo \
	rl2ascii.lo rl2paint.lo rl2dbms.lo rl2import.lo rl2pyramid.lo \
	rl2sql.lo rl2sqlaux.lo rl2auxrender.lo rl2svg.lo rl2svgxml.lo \
	rl2svgaux.lo rl2symbolizer.lo rl2symbaux.lo rl2rastersym.lo \
	rl2version.lo rl2md5.lo md5.lo rl2charls.lo rl2openjpeg.lo \
	rl2auxgeom.lo rl2auxfont.lo rl2_internal_data.lo

librasterlite2_la_OBJECTS = $(am_librasterlite2_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 = 
librasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
................................................................................
	mod_rasterlite2_la-rl2symbaux.lo \
	mod_rasterlite2_la-rl2rastersym.lo \
	mod_rasterlite2_la-rl2version.lo mod_rasterlite2_la-rl2md5.lo \
	mod_rasterlite2_la-md5.lo mod_rasterlite2_la-rl2charls.lo \
	mod_rasterlite2_la-rl2openjpeg.lo \
	mod_rasterlite2_la-rl2auxgeom.lo \
	mod_rasterlite2_la-rl2auxfont.lo \

	mod_rasterlite2_la-rl2_internal_data.lo
mod_rasterlite2_la_OBJECTS = $(am_mod_rasterlite2_la_OBJECTS)
mod_rasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
	$(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
	$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mod_rasterlite2_la_LDFLAGS) \
	$(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
................................................................................
lib_LTLIBRARIES = librasterlite2.la mod_rasterlite2.la
librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2_internal_data.c


librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
	@LIBCAIRO_LIBS@ @LIBCURL_LIBS@ @LIBXML2_LIBS@ \
	@LIBFREETYPE2_LIBS@ $(am__append_1) $(am__append_2)
@MINGW_FALSE@librasterlite2_la_LDFLAGS = -version-info 1:0:0
@MINGW_TRUE@librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2_internal_data.c


mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ @LIBXML2_LIBS@ \
	@LIBFREETYPE2_LIBS@ $(am__append_3) $(am__append_4)
mod_rasterlite2_la_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ \
	-I$(top_srcdir)/headers -I. -DLOADABLE_EXTENSION
mod_rasterlite2_la_LIBTOOLFLAGS = --tag=disable-static
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2sql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2symbaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Plo@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2tiff.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2version.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2webp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2wms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2_internal_data.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2ascii.Plo@am__quote@
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2sql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2sqlaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svgaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svgxml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2symbaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2symbolizer.Plo@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2tiff.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2version.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2webp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2wms.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
................................................................................
mod_rasterlite2_la-rl2auxfont.lo: rl2auxfont.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2auxfont.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Tpo -c -o mod_rasterlite2_la-rl2auxfont.lo `test -f 'rl2auxfont.c' || echo '$(srcdir)/'`rl2auxfont.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='rl2auxfont.c' object='mod_rasterlite2_la-rl2auxfont.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2auxfont.lo `test -f 'rl2auxfont.c' || echo '$(srcdir)/'`rl2auxfont.c








mod_rasterlite2_la-rl2_internal_data.lo: rl2_internal_data.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2_internal_data.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Tpo -c -o mod_rasterlite2_la-rl2_internal_data.lo `test -f 'rl2_internal_data.c' || echo '$(srcdir)/'`rl2_internal_data.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='rl2_internal_data.c' object='mod_rasterlite2_la-rl2_internal_data.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2_internal_data.lo `test -f 'rl2_internal_data.c' || echo '$(srcdir)/'`rl2_internal_data.c








|
>







 







>







 







|
>












|
>







 







>







 







>







 







>
>
>
>
>
>
>







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
...
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
...
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
...
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
	$(am__DEPENDENCIES_1)
am_librasterlite2_la_OBJECTS = rasterlite2.lo rl2raw.lo rl2codec.lo \
	rl2jpeg.lo rl2png.lo rl2gif.lo rl2webp.lo rl2tiff.lo rl2wms.lo \
	rl2ascii.lo rl2paint.lo rl2dbms.lo rl2import.lo rl2pyramid.lo \
	rl2sql.lo rl2sqlaux.lo rl2auxrender.lo rl2svg.lo rl2svgxml.lo \
	rl2svgaux.lo rl2symbolizer.lo rl2symbaux.lo rl2rastersym.lo \
	rl2version.lo rl2md5.lo md5.lo rl2charls.lo rl2openjpeg.lo \
	rl2auxgeom.lo rl2auxfont.lo rl2symclone.lo \
	rl2_internal_data.lo
librasterlite2_la_OBJECTS = $(am_librasterlite2_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 = 
librasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
................................................................................
	mod_rasterlite2_la-rl2symbaux.lo \
	mod_rasterlite2_la-rl2rastersym.lo \
	mod_rasterlite2_la-rl2version.lo mod_rasterlite2_la-rl2md5.lo \
	mod_rasterlite2_la-md5.lo mod_rasterlite2_la-rl2charls.lo \
	mod_rasterlite2_la-rl2openjpeg.lo \
	mod_rasterlite2_la-rl2auxgeom.lo \
	mod_rasterlite2_la-rl2auxfont.lo \
	mod_rasterlite2_la-rl2symclone.lo \
	mod_rasterlite2_la-rl2_internal_data.lo
mod_rasterlite2_la_OBJECTS = $(am_mod_rasterlite2_la_OBJECTS)
mod_rasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
	$(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
	$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mod_rasterlite2_la_LDFLAGS) \
	$(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
................................................................................
lib_LTLIBRARIES = librasterlite2.la mod_rasterlite2.la
librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2symclone.c \
	rl2_internal_data.c

librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
	@LIBCAIRO_LIBS@ @LIBCURL_LIBS@ @LIBXML2_LIBS@ \
	@LIBFREETYPE2_LIBS@ $(am__append_1) $(am__append_2)
@MINGW_FALSE@librasterlite2_la_LDFLAGS = -version-info 1:0:0
@MINGW_TRUE@librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
	rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
	rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
	rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
	rl2svgaux.c rl2symbolizer.c rl2symbaux.c rl2rastersym.c \
	rl2version.c rl2md5.c md5.c rl2charls.c rl2openjpeg.c \
	rl2auxgeom.c rl2auxfont.c rl2symclone.c \
	rl2_internal_data.c

mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
	@LIBLZMA_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ @LIBXML2_LIBS@ \
	@LIBFREETYPE2_LIBS@ $(am__append_3) $(am__append_4)
mod_rasterlite2_la_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ \
	-I$(top_srcdir)/headers -I. -DLOADABLE_EXTENSION
mod_rasterlite2_la_LIBTOOLFLAGS = --tag=disable-static
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2sql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2symbaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2symclone.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2tiff.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2version.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2webp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_rasterlite2_la-rl2wms.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2_internal_data.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2ascii.Plo@am__quote@
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2sql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2sqlaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svgaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2svgxml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2symbaux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2symbolizer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2symclone.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2tiff.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2version.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2webp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rl2wms.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
................................................................................
mod_rasterlite2_la-rl2auxfont.lo: rl2auxfont.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2auxfont.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Tpo -c -o mod_rasterlite2_la-rl2auxfont.lo `test -f 'rl2auxfont.c' || echo '$(srcdir)/'`rl2auxfont.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2auxfont.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='rl2auxfont.c' object='mod_rasterlite2_la-rl2auxfont.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2auxfont.lo `test -f 'rl2auxfont.c' || echo '$(srcdir)/'`rl2auxfont.c

mod_rasterlite2_la-rl2symclone.lo: rl2symclone.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2symclone.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2symclone.Tpo -c -o mod_rasterlite2_la-rl2symclone.lo `test -f 'rl2symclone.c' || echo '$(srcdir)/'`rl2symclone.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2symclone.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2symclone.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='rl2symclone.c' object='mod_rasterlite2_la-rl2symclone.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2symclone.lo `test -f 'rl2symclone.c' || echo '$(srcdir)/'`rl2symclone.c

mod_rasterlite2_la-rl2_internal_data.lo: rl2_internal_data.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2_internal_data.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Tpo -c -o mod_rasterlite2_la-rl2_internal_data.lo `test -f 'rl2_internal_data.c' || echo '$(srcdir)/'`rl2_internal_data.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2_internal_data.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='rl2_internal_data.c' object='mod_rasterlite2_la-rl2_internal_data.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2_internal_data.lo `test -f 'rl2_internal_data.c' || echo '$(srcdir)/'`rl2_internal_data.c

Changes to src/rl2auxrender.c.

2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
....
2473
2474
2475
2476
2477
2478
2479

2480
2481
2482
2483
2484

2485
2486
2487
2488
2489
2490
2491
....
3331
3332
3333
3334
3335
3336
3337

3338
3339
3340
3341
3342

3343
3344
3345
3346
3347
3348
3349
....
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
....
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
....
4440
4441
4442
4443
4444
4445
4446


























































4447
4448
4449
4450
4451
4452
4453
....
4455
4456
4457
4458
4459
4460
4461

4462
4463
4464
4465
4466







4467
4468
4469
4470
4471
4472
4473
....
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597


4598
4599
4600
4601
4602
4603
4604
					blue = ext->first->blue;
				    }
				  if (xlink_href != NULL)
				    {
					/* first attempt: Bitmap */
					pattern =
					    rl2_create_pattern_from_external_graphic
					    (handle, xlink_href, 1);
					if (pattern == NULL)
					  {
					      /* second attempt: SVG */
					      pattern =
						  rl2_create_pattern_from_external_svg
						  (handle, xlink_href,
						   point_sym->graphic->size);
................................................................................
		      /* releasing Patterns */
		      if (pattern != NULL)
			  rl2_graph_destroy_pattern (pattern);
		      if (pattern_fill != NULL)
			{
			    rl2_graph_release_pattern_pen (ctx);
			    rl2_graph_destroy_pattern (pattern_fill);

			}
		      if (pattern_stroke != NULL)
			{
			    rl2_graph_release_pattern_pen (ctx);
			    rl2_graph_destroy_pattern (pattern_stroke);

			}
		      graphic = graphic->next;
		  }
	    }
	  item = item->next;
      }
}
................................................................................
		polyg = polyg->next;
	    }
	  rl2_destroy_geometry (mod_geom);
	  if (pattern_fill != NULL)
	    {
		rl2_graph_release_pattern_brush (ctx);
		rl2_graph_destroy_pattern (pattern_fill);

	    }
	  if (pattern_stroke != NULL)
	    {
		rl2_graph_release_pattern_pen (ctx);
		rl2_graph_destroy_pattern (pattern_stroke);

	    }
	  item = item->next;
      }
}

static int
label_get_xy (sqlite3 * handle, const unsigned char *blob, int size,
................................................................................
    return 1;
}

static void
draw_labels (rl2GraphicsContextPtr ctx, sqlite3 * handle,
	     const void *priv_data, rl2PrivTextSymbolizerPtr sym, int height,
	     double minx, double miny, double maxx, double maxy, double x_res,
	     double y_res, rl2GeometryPtr geom, rl2PrivVariantValuePtr value)
{
/* drawing TextLabels */
    rl2GraphicsFontPtr font = NULL;
    char *dummy = NULL;
    const char *label = NULL;
    int font_style;
    int font_weight;
    double opacity;
    unsigned char norm_opacity;
    rl2PointPtr point;
    rl2LinestringPtr line;
    rl2PolygonPtr polyg;
................................................................................
    int is_repeated = 0;
    double initial_gap = 0.0;
    double gap = 0.0;
    int is_aligned = 0;
    int generalize_line = 0;
    int i;

/* preparing the Text */
    if (value->sqlite3_type == SQLITE_INTEGER)
      {
	  dummy = sqlite3_malloc (1024);
#if defined(_WIN32) && !defined(__MINGW32__)
	  sprintf (dummy, "%I64d", value->int_value);
#else
	  sprintf (dummy, "%lld", value->int_value);
#endif
	  label = dummy;
      }
    if (value->sqlite3_type == SQLITE_FLOAT)
      {
	  dummy = sqlite3_mprintf ("%1.2f", value->dbl_value);
	  label = dummy;
      }
    if (value->sqlite3_type == SQLITE_TEXT)
	label = (const char *) (value->text_value);
    if (label == NULL)
	return;

/* setting up the Font */
    switch (sym->font_style)
      {
      case RL2_FONT_STYLE_ITALIC:
................................................................................
	sqlite3_free (dummy);
    if (font != NULL)
      {
	  rl2_graph_release_font (ctx);
	  rl2_graph_destroy_font (font);
      }
}



























































RL2_PRIVATE void
rl2_draw_vector_feature (void *p_ctx, void *p_ctx_labels, sqlite3 * handle,
			 const void *priv_data,
			 rl2VectorSymbolizerPtr symbolizer, int height,
			 double minx, double miny, double maxx, double maxy,
			 double x_res, double y_res, rl2GeometryPtr geom,
................................................................................
{
/* drawing a vector feature on the current canvas */
    rl2PrivVectorSymbolizerItemPtr item;
    rl2GraphicsContextPtr ctx = (rl2GraphicsContextPtr) p_ctx;
    rl2GraphicsContextPtr ctx_labels = (rl2GraphicsContextPtr) p_ctx_labels;
    rl2PrivVectorSymbolizerPtr sym = (rl2PrivVectorSymbolizerPtr) symbolizer;
    rl2PrivVectorSymbolizerPtr default_symbolizer = NULL;


    if (ctx == NULL || geom == NULL)
	return;

    if (sym == NULL)







      {
	  /* creating a default general purpose Symbolizer */
	  default_symbolizer = rl2_create_default_vector_symbolizer ();
	  item = rl2_create_default_point_symbolizer ();
	  if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
	      && item->symbolizer != NULL)
	    {
................................................................................
    if (geom->first_linestring != NULL)
	draw_lines (ctx, handle, sym, height, minx, miny, maxx, maxy, x_res,
		    y_res, geom);
    if (geom->first_point != NULL)
	draw_points (ctx, handle, sym, height, minx, miny, maxx, maxy, x_res,
		     y_res, geom);

    if (sym != NULL)
      {
	  /* then we'll render any eventual TextSymbolizer */
	  item = sym->first;
	  while (item != NULL)
	    {
		if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
		    && item->symbolizer != NULL)
		  {
		      rl2PrivTextSymbolizerPtr text =
			  (rl2PrivTextSymbolizerPtr) (item->symbolizer);
		      if (text->label != NULL)
			{
			    int v;
			    rl2PrivVariantArrayPtr var =
				(rl2PrivVariantArrayPtr) variant;
			    if (var != NULL)
			      {
				  for (v = 0; v < var->count; v++)
				    {
					rl2PrivVariantValuePtr val =
					    *(var->array + v);
					if (val == NULL)
					    continue;
					if (val->column_name == NULL)
					    continue;
					if (strcasecmp
					    (text->label,
					     val->column_name) != 0)
					    continue;
					draw_labels (ctx_labels, handle,
						     priv_data, text, height,
						     minx, miny, maxx, maxy,
						     x_res, y_res, geom, val);
				    }
			      }
			}
		  }
		item = item->next;
	    }
      }

    if (default_symbolizer != NULL)
	rl2_destroy_vector_symbolizer (default_symbolizer);


}

RL2_PRIVATE int
rl2_aux_default_image (unsigned int width, unsigned int height,
		       unsigned char red, unsigned char green,
		       unsigned char blue, int format, int transparent,
		       int quality, unsigned char **ximage, int *ximage_sz)







|







 







>





>







 







>





>







 







|




|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>




|
>
>
>
>
>
>
>







 







|











<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
<
<
<







>
>







2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
....
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
....
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
....
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
....
4013
4014
4015
4016
4017
4018
4019


















4020
4021
4022
4023
4024
4025
4026
....
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
....
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
....
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617


















4618
4619
4620
4621



4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
					blue = ext->first->blue;
				    }
				  if (xlink_href != NULL)
				    {
					/* first attempt: Bitmap */
					pattern =
					    rl2_create_pattern_from_external_graphic
					    (handle, xlink_href, 0);
					if (pattern == NULL)
					  {
					      /* second attempt: SVG */
					      pattern =
						  rl2_create_pattern_from_external_svg
						  (handle, xlink_href,
						   point_sym->graphic->size);
................................................................................
		      /* releasing Patterns */
		      if (pattern != NULL)
			  rl2_graph_destroy_pattern (pattern);
		      if (pattern_fill != NULL)
			{
			    rl2_graph_release_pattern_pen (ctx);
			    rl2_graph_destroy_pattern (pattern_fill);
			    pattern_fill = NULL;
			}
		      if (pattern_stroke != NULL)
			{
			    rl2_graph_release_pattern_pen (ctx);
			    rl2_graph_destroy_pattern (pattern_stroke);
			    pattern_stroke = NULL;
			}
		      graphic = graphic->next;
		  }
	    }
	  item = item->next;
      }
}
................................................................................
		polyg = polyg->next;
	    }
	  rl2_destroy_geometry (mod_geom);
	  if (pattern_fill != NULL)
	    {
		rl2_graph_release_pattern_brush (ctx);
		rl2_graph_destroy_pattern (pattern_fill);
		pattern_fill = NULL;
	    }
	  if (pattern_stroke != NULL)
	    {
		rl2_graph_release_pattern_pen (ctx);
		rl2_graph_destroy_pattern (pattern_stroke);
		pattern_stroke = NULL;
	    }
	  item = item->next;
      }
}

static int
label_get_xy (sqlite3 * handle, const unsigned char *blob, int size,
................................................................................
    return 1;
}

static void
draw_labels (rl2GraphicsContextPtr ctx, sqlite3 * handle,
	     const void *priv_data, rl2PrivTextSymbolizerPtr sym, int height,
	     double minx, double miny, double maxx, double maxy, double x_res,
	     double y_res, rl2GeometryPtr geom)
{
/* drawing TextLabels */
    rl2GraphicsFontPtr font = NULL;
    char *dummy = NULL;
    const char *label = sym->label;
    int font_style;
    int font_weight;
    double opacity;
    unsigned char norm_opacity;
    rl2PointPtr point;
    rl2LinestringPtr line;
    rl2PolygonPtr polyg;
................................................................................
    int is_repeated = 0;
    double initial_gap = 0.0;
    double gap = 0.0;
    int is_aligned = 0;
    int generalize_line = 0;
    int i;



















    if (label == NULL)
	return;

/* setting up the Font */
    switch (sym->font_style)
      {
      case RL2_FONT_STYLE_ITALIC:
................................................................................
	sqlite3_free (dummy);
    if (font != NULL)
      {
	  rl2_graph_release_font (ctx);
	  rl2_graph_destroy_font (font);
      }
}

static rl2PrivVectorSymbolizerPtr
create_dyn_symbolizer (rl2PrivVectorSymbolizerPtr in,
		       rl2PrivVariantArrayPtr var)
{
/* creating a dynamic symbolizer based on current column values */
    rl2PrivVectorSymbolizerItemPtr item_in;
    rl2PrivVectorSymbolizerPtr out = rl2_create_default_vector_symbolizer ();

    item_in = in->first;
    while (item_in != NULL)
      {
	  /* copying individual Symbolizers */
	  if (item_in->symbolizer_type == RL2_POINT_SYMBOLIZER)
	    {
		/* cloning a Point Symbolizer */
		rl2PrivPointSymbolizerPtr point_in = item_in->symbolizer;
		rl2PrivPointSymbolizerPtr point_out =
		    rl2_clone_point_symbolizer (point_in);
		/* handling dynamic values (column based) */
		rl2_set_point_symbolizer_dyn_values (var, point_out);
		rl2_add_dyn_symbolizer (out, RL2_POINT_SYMBOLIZER, point_out);
	    }
	  if (item_in->symbolizer_type == RL2_LINE_SYMBOLIZER)
	    {
		/* cloning a Line Symbolizer */
		rl2PrivLineSymbolizerPtr line_in = item_in->symbolizer;
		rl2PrivLineSymbolizerPtr line_out =
		    rl2_clone_line_symbolizer (line_in);
		/* handling dynamic values (column based) */
		rl2_set_line_symbolizer_dyn_values (var, line_out);
		rl2_add_dyn_symbolizer (out, RL2_LINE_SYMBOLIZER, line_out);
	    }
	  if (item_in->symbolizer_type == RL2_POLYGON_SYMBOLIZER)
	    {
		/* cloning a Polygon Symbolizer */
		rl2PrivPolygonSymbolizerPtr polyg_in = item_in->symbolizer;
		rl2PrivPolygonSymbolizerPtr polyg_out =
		    rl2_clone_polygon_symbolizer (polyg_in);
		/* handling dynamic values (column based) */
		rl2_set_polygon_symbolizer_dyn_values (var, polyg_out);
		rl2_add_dyn_symbolizer (out, RL2_POLYGON_SYMBOLIZER, polyg_out);
	    }
	  if (item_in->symbolizer_type == RL2_TEXT_SYMBOLIZER)
	    {
		/* cloning a Text Symbolizer */
		rl2PrivTextSymbolizerPtr text_in = item_in->symbolizer;
		rl2PrivTextSymbolizerPtr text_out =
		    rl2_clone_text_symbolizer (text_in);
		/* handling dynamic values (column based) */
		rl2_set_text_symbolizer_dyn_values (var, text_out);
		rl2_add_dyn_symbolizer (out, RL2_TEXT_SYMBOLIZER, text_out);
	    }
	  item_in = item_in->next;
      }

    return out;
}

RL2_PRIVATE void
rl2_draw_vector_feature (void *p_ctx, void *p_ctx_labels, sqlite3 * handle,
			 const void *priv_data,
			 rl2VectorSymbolizerPtr symbolizer, int height,
			 double minx, double miny, double maxx, double maxy,
			 double x_res, double y_res, rl2GeometryPtr geom,
................................................................................
{
/* drawing a vector feature on the current canvas */
    rl2PrivVectorSymbolizerItemPtr item;
    rl2GraphicsContextPtr ctx = (rl2GraphicsContextPtr) p_ctx;
    rl2GraphicsContextPtr ctx_labels = (rl2GraphicsContextPtr) p_ctx_labels;
    rl2PrivVectorSymbolizerPtr sym = (rl2PrivVectorSymbolizerPtr) symbolizer;
    rl2PrivVectorSymbolizerPtr default_symbolizer = NULL;
    rl2PrivVectorSymbolizerPtr dyn_symbolizer = NULL;

    if (ctx == NULL || geom == NULL)
	return;

    if (sym != NULL)
      {
	  /* creating a dynamic symbolizer */
	  dyn_symbolizer =
	      create_dyn_symbolizer (sym, (rl2PrivVariantArrayPtr) variant);
	  sym = dyn_symbolizer;
      }
    else
      {
	  /* creating a default general purpose Symbolizer */
	  default_symbolizer = rl2_create_default_vector_symbolizer ();
	  item = rl2_create_default_point_symbolizer ();
	  if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
	      && item->symbolizer != NULL)
	    {
................................................................................
    if (geom->first_linestring != NULL)
	draw_lines (ctx, handle, sym, height, minx, miny, maxx, maxy, x_res,
		    y_res, geom);
    if (geom->first_point != NULL)
	draw_points (ctx, handle, sym, height, minx, miny, maxx, maxy, x_res,
		     y_res, geom);

    if (sym != NULL && ctx_labels != NULL)
      {
	  /* then we'll render any eventual TextSymbolizer */
	  item = sym->first;
	  while (item != NULL)
	    {
		if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
		    && item->symbolizer != NULL)
		  {
		      rl2PrivTextSymbolizerPtr text =
			  (rl2PrivTextSymbolizerPtr) (item->symbolizer);
		      if (text->label != NULL)


















			  draw_labels (ctx_labels, handle,
				       priv_data, text, height,
				       minx, miny, maxx, maxy,
				       x_res, y_res, geom);



		  }
		item = item->next;
	    }
      }

    if (default_symbolizer != NULL)
	rl2_destroy_vector_symbolizer (default_symbolizer);
    if (dyn_symbolizer != NULL)
	rl2_destroy_vector_symbolizer (dyn_symbolizer);
}

RL2_PRIVATE int
rl2_aux_default_image (unsigned int width, unsigned int height,
		       unsigned char red, unsigned char green,
		       unsigned char blue, int format, int transparent,
		       int quality, unsigned char **ximage, int *ximage_sz)

Changes to src/rl2openjpeg.c.

55
56
57
58
59
60
61



62
63
64
65
66

67
68
69
70
71
72
73
...
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
...
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
....
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
....
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
#include "rasterlite2/rl2tiff.h"
#include "rasterlite2_private.h"

#ifndef OMIT_OPENJPEG		/* only if OpenJpeg is enabled */

#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H
#include <openjpeg-2.1/openjpeg.h>



#else
#ifdef __ANDROID__		/* Android specific */
#include <openjpeg.h>
#else
#include <openjpeg-2.0/openjpeg.h>

#endif
#endif

struct jp2_memfile
{
/* a struct emulating a file [memory mapped] */
    unsigned char *buffer;
................................................................................
      }

/* preparing the output stream */
    stream = opj_stream_create (1024 * 1024, 0);
    opj_stream_set_write_function (stream, write_callback);
    opj_stream_set_seek_function (stream, seek_callback);
    opj_stream_set_skip_function (stream, skip_callback);
#ifdef OPENJPEG_2_1
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif

    if (!opj_start_compress (codec, image, stream))
      {
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#ifdef OPENJPEG_2_1
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#ifdef OPENJPEG_2_1
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#ifdef OPENJPEG_2_1
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");







>
>
>





>







 







|







 







|







 







|







 







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
...
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
....
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
....
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
#include "rasterlite2/rl2tiff.h"
#include "rasterlite2_private.h"

#ifndef OMIT_OPENJPEG		/* only if OpenJpeg is enabled */

#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H
#include <openjpeg-2.1/openjpeg.h>
#else
#ifdef HAVE_OPENJPEG_2_2_OPENJPEG_H
#include <openjpeg-2.2/openjpeg.h>
#else
#ifdef __ANDROID__		/* Android specific */
#include <openjpeg.h>
#else
#include <openjpeg-2.0/openjpeg.h>
#endif
#endif
#endif

struct jp2_memfile
{
/* a struct emulating a file [memory mapped] */
    unsigned char *buffer;
................................................................................
      }

/* preparing the output stream */
    stream = opj_stream_create (1024 * 1024, 0);
    opj_stream_set_write_function (stream, write_callback);
    opj_stream_set_seek_function (stream, seek_callback);
    opj_stream_set_skip_function (stream, skip_callback);
#if defined(HAVE_OPENJPEG_2_1_OPENJPEG_H) || defined(HAVE_OPENJPEG_2_2_OPENJPEG_H)
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif

    if (!opj_start_compress (codec, image, stream))
      {
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#if defined(HAVE_OPENJPEG_2_1_OPENJPEG_H) || defined(HAVE_OPENJPEG_2_2_OPENJPEG_H)
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#if defined(HAVE_OPENJPEG_2_1_OPENJPEG_H) || defined(HAVE_OPENJPEG_2_2_OPENJPEG_H)
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");
................................................................................
    opj_stream_set_skip_function (stream, skip_callback);
/* initializing the memory Read struct */
    clientdata.buffer = (unsigned char *) jpeg2000;
    clientdata.malloc_block = 1024;
    clientdata.size = jpeg2000_sz;
    clientdata.eof = jpeg2000_sz;
    clientdata.current = 0;
#if defined(HAVE_OPENJPEG_2_1_OPENJPEG_H) || defined(HAVE_OPENJPEG_2_2_OPENJPEG_H)
    opj_stream_set_user_data (stream, &clientdata, NULL);
#else
    opj_stream_set_user_data (stream, &clientdata);
#endif
    if (!opj_read_header (stream, codec, &image))
      {
	  fprintf (stderr, "OpenJpeg Error: opj_read_header() failed\n");

Changes to src/rl2paint.c.

1759
1760
1761
1762
1763
1764
1765

1766
1767
1768
1769
1770
1771
1772
....
2020
2021
2022
2023
2024
2025
2026


2027

2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038










2039
2040
2041
2042
2043
2044
2045
....
2831
2832
2833
2834
2835
2836
2837
2838

2839
2840
2841
2842
2843
2844
2845
....
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
....
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
....
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
....
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
    RL2GraphFontPtr fnt;
    int len;

    fnt = malloc (sizeof (RL2GraphFont));
    if (fnt == NULL)
	return NULL;
    fnt->toy_font = 1;

    fnt->tt_font = NULL;
    if (facename == NULL)
	facename = "monospace";
    if (strcasecmp (facename, "serif") == 0)
      {
	  len = strlen ("serif");
	  fnt->facename = malloc (len + 1);
................................................................................
    RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
    if (fnt == NULL)
	return;
    if (fnt->toy_font == 0)
      {
	  /* True Type Font */
	  if (fnt->cairo_scaled_font != NULL)


	      cairo_scaled_font_destroy (fnt->cairo_scaled_font);

	  if (fnt->cairo_font != NULL)
	    {
		if (cairo_font_face_get_reference_count (fnt->cairo_font) > 0)
		    cairo_font_face_destroy (fnt->cairo_font);
	    }
      }
    else
      {
	  /* Cairo Toy Font */
	  if (fnt->facename != NULL)
	      free (fnt->facename);










      }
    free (fnt);
}

RL2_DECLARE int
rl2_graph_font_set_color (rl2GraphicsFontPtr font, unsigned char red,
			  unsigned char green, unsigned char blue,
................................................................................
	sqlite3_finalize (stmt);
    if (out != NULL)
	rl2_destroy_geometry (out);
    return NULL;
}

static int
interpolate_point (sqlite3 * handle, rl2GeometryPtr geom, double percent, double *x, double *y)

{
/* interpolating a point on a Line */
    sqlite3_stmt *stmt = NULL;
    const char *sql;
    int ret;
    unsigned char *blob;
    int size;
................................................................................
  error:
    if (stmt != NULL)
	sqlite3_finalize (stmt);
    return 0;
}

static int
check_reverse (sqlite3 *sqlite, rl2GeometryPtr geom, double text_length)
{
/* testing for an inverse label */
    rl2LinestringPtr ln;
    double x0;
    double y0;
    double x1;
    double y1;
................................................................................
    double percent;

    if (geom == NULL)
	return 0;
    ln = geom->first_linestring;
    if (ln == NULL)
	return 0;
    
    line_length = rl2_compute_curve_length (geom);
    if (line_length < text_length)
    return 0;
    percent = text_length / line_length;
    if (!interpolate_point(sqlite, geom, percent, &x1, &y1))
    return 0;

    rl2GetPoint (ln->coords, 0, &x0, &y0);
    width = fabs (x0 - x1);
    if (width > 10.0)
      {
	  if (x0 > x1)
	      return 1;
................................................................................
    const char *c = text;
    cairo_font_extents_t extents;

    cairo_font_extents (cairo, &extents);
    radius =
	sqrt ((extents.max_x_advance * extents.max_x_advance) +
	      (extents.height * extents.height)) / 2.0;
    if (check_reverse (handle, g, radius * strlen(text)))
      {
	  /* reverse text */
	  int len = strlen (text);
	  rev_text = malloc (len + 1);
	  reverse_text (text, rev_text, len);
	  c = rev_text;
      }
................................................................................
	  c++;
	  g2 = aux_reduce_curve (handle, g, circle, x0, y0);
	  rl2_destroy_geometry (circle);
	  rl2_destroy_geometry (g);
	  g = g2;
      }
    if (rev_text)
	free (rev_text); 
    return g;
}

RL2_DECLARE int
rl2_graph_draw_warped_text (sqlite3 * handle, rl2GraphicsContextPtr context,
			    const char *text, int points, double *x,
			    double *y, double initial_gap, double gap,







>







 







>
>
|
>











>
>
>
>
>
>
>
>
>
>







 







|
>







 







|







 







|


|

|
|







 







|







 







|







1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
....
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
....
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
....
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
....
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
....
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
....
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
    RL2GraphFontPtr fnt;
    int len;

    fnt = malloc (sizeof (RL2GraphFont));
    if (fnt == NULL)
	return NULL;
    fnt->toy_font = 1;
    fnt->cairo_scaled_font = NULL;
    fnt->tt_font = NULL;
    if (facename == NULL)
	facename = "monospace";
    if (strcasecmp (facename, "serif") == 0)
      {
	  len = strlen ("serif");
	  fnt->facename = malloc (len + 1);
................................................................................
    RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
    if (fnt == NULL)
	return;
    if (fnt->toy_font == 0)
      {
	  /* True Type Font */
	  if (fnt->cairo_scaled_font != NULL)
	    {
			if (cairo_scaled_font_get_reference_count(fnt->cairo_scaled_font) > 0)
		cairo_scaled_font_destroy (fnt->cairo_scaled_font);
	    }
	  if (fnt->cairo_font != NULL)
	    {
		if (cairo_font_face_get_reference_count (fnt->cairo_font) > 0)
		    cairo_font_face_destroy (fnt->cairo_font);
	    }
      }
    else
      {
	  /* Cairo Toy Font */
	  if (fnt->facename != NULL)
	      free (fnt->facename);
	  if (fnt->cairo_scaled_font != NULL)
	    {
			if (cairo_scaled_font_get_reference_count(fnt->cairo_scaled_font) > 0)
		cairo_scaled_font_destroy (fnt->cairo_scaled_font);
	    }
	  if (fnt->cairo_font != NULL)
	    {
		if (cairo_font_face_get_reference_count (fnt->cairo_font) > 0)
		    cairo_font_face_destroy (fnt->cairo_font);
	    }
      }
    free (fnt);
}

RL2_DECLARE int
rl2_graph_font_set_color (rl2GraphicsFontPtr font, unsigned char red,
			  unsigned char green, unsigned char blue,
................................................................................
	sqlite3_finalize (stmt);
    if (out != NULL)
	rl2_destroy_geometry (out);
    return NULL;
}

static int
interpolate_point (sqlite3 * handle, rl2GeometryPtr geom, double percent,
		   double *x, double *y)
{
/* interpolating a point on a Line */
    sqlite3_stmt *stmt = NULL;
    const char *sql;
    int ret;
    unsigned char *blob;
    int size;
................................................................................
  error:
    if (stmt != NULL)
	sqlite3_finalize (stmt);
    return 0;
}

static int
check_reverse (sqlite3 * sqlite, rl2GeometryPtr geom, double text_length)
{
/* testing for an inverse label */
    rl2LinestringPtr ln;
    double x0;
    double y0;
    double x1;
    double y1;
................................................................................
    double percent;

    if (geom == NULL)
	return 0;
    ln = geom->first_linestring;
    if (ln == NULL)
	return 0;

    line_length = rl2_compute_curve_length (geom);
    if (line_length < text_length)
	return 0;
    percent = text_length / line_length;
    if (!interpolate_point (sqlite, geom, percent, &x1, &y1))
	return 0;

    rl2GetPoint (ln->coords, 0, &x0, &y0);
    width = fabs (x0 - x1);
    if (width > 10.0)
      {
	  if (x0 > x1)
	      return 1;
................................................................................
    const char *c = text;
    cairo_font_extents_t extents;

    cairo_font_extents (cairo, &extents);
    radius =
	sqrt ((extents.max_x_advance * extents.max_x_advance) +
	      (extents.height * extents.height)) / 2.0;
    if (check_reverse (handle, g, radius * strlen (text)))
      {
	  /* reverse text */
	  int len = strlen (text);
	  rev_text = malloc (len + 1);
	  reverse_text (text, rev_text, len);
	  c = rev_text;
      }
................................................................................
	  c++;
	  g2 = aux_reduce_curve (handle, g, circle, x0, y0);
	  rl2_destroy_geometry (circle);
	  rl2_destroy_geometry (g);
	  g = g2;
      }
    if (rev_text)
	free (rev_text);
    return g;
}

RL2_DECLARE int
rl2_graph_draw_warped_text (sqlite3 * handle, rl2GraphicsContextPtr context,
			    const char *text, int points, double *x,
			    double *y, double initial_gap, double gap,

Changes to src/rl2sqlaux.c.

6800
6801
6802
6803
6804
6805
6806










6807
6808
6809
6810
6811
6812
6813
....
7568
7569
7570
7571
7572
7573
7574









7575
7576
7577
7578
7579
7580
7581
....
7584
7585
7586
7587
7588
7589
7590





7591
7592
7593
7594
7595
7596
7597
    rl2_is_multilayer_topogeo (multi, &is_topogeo);
    rl2_is_multilayer_toponet (multi, &is_toponet);

    if (!canvas)
      {
	  /* preparing a Graphics Context */
	  ctx = rl2_graph_create_context (width, height);










      }

    for (j = 0; j < rl2_get_multilayer_count (multi); j++)
      {
	  /* looping on MultiLayer individual Layers */
	  const char *classname = NULL;
	  char *toponame;
................................................................................
		ctx_in = rl2_get_canvas_ctx (canvas, RL2_CANVAS_LINK_SEEDS_CTX);
		if (ctx_out != NULL && ctx_in != NULL)
		    rl2_graph_merge (ctx_out, ctx_in);
		do_set_canvas_ready (canvas, RL2_CANVAS_BASE_CTX);
	    }
	  return RL2_OK;
      }









    rl2_destroy_multi_layer (multi);
    multi = NULL;
    if (lyr_stl != NULL)
	rl2_destroy_feature_type_style (lyr_stl);
    lyr_stl = NULL;
    if (variant != NULL)
	rl2_destroy_variant_array (variant);
................................................................................
    rgb = rl2_graph_get_context_rgb_array (ctx);
    alpha = rl2_graph_get_context_alpha_array (ctx, &half_transparent);
    if (rgb == NULL || alpha == NULL)
	goto error;

    rl2_graph_destroy_context (ctx);
    ctx = NULL;






    if (!get_payload_from_rgb_rgba_transparent
	(width, height, rgb, alpha, format_id, quality, &image, &image_size,
	 1.0, half_transparent))
	goto error;
    if (rgb != NULL)
	free (rgb);







>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>







 







>
>
>
>
>







6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
....
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
....
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
    rl2_is_multilayer_topogeo (multi, &is_topogeo);
    rl2_is_multilayer_toponet (multi, &is_toponet);

    if (!canvas)
      {
	  /* preparing a Graphics Context */
	  ctx = rl2_graph_create_context (width, height);
	  if (lyr_stl != NULL)
	  {
		has_labels = rl2_style_has_labels (lyr_stl);
		if (has_labels)
		  {
		      ctx_labels = rl2_graph_create_context (width, height);
		      if (ctx_labels == NULL)
			  goto error;
		  }
	  }
      }

    for (j = 0; j < rl2_get_multilayer_count (multi); j++)
      {
	  /* looping on MultiLayer individual Layers */
	  const char *classname = NULL;
	  char *toponame;
................................................................................
		ctx_in = rl2_get_canvas_ctx (canvas, RL2_CANVAS_LINK_SEEDS_CTX);
		if (ctx_out != NULL && ctx_in != NULL)
		    rl2_graph_merge (ctx_out, ctx_in);
		do_set_canvas_ready (canvas, RL2_CANVAS_BASE_CTX);
	    }
	  return RL2_OK;
      }
      
      if (ctx_labels != NULL)
      {
		  /* merging Label sub-layer */
		rl2GraphicsContextPtr ctx_in = ctx_labels;
		rl2GraphicsContextPtr ctx_out = ctx;
		    rl2_graph_merge (ctx_out, ctx_in);
	  }
	  
    rl2_destroy_multi_layer (multi);
    multi = NULL;
    if (lyr_stl != NULL)
	rl2_destroy_feature_type_style (lyr_stl);
    lyr_stl = NULL;
    if (variant != NULL)
	rl2_destroy_variant_array (variant);
................................................................................
    rgb = rl2_graph_get_context_rgb_array (ctx);
    alpha = rl2_graph_get_context_alpha_array (ctx, &half_transparent);
    if (rgb == NULL || alpha == NULL)
	goto error;

    rl2_graph_destroy_context (ctx);
    ctx = NULL;
    if (ctx_labels != NULL)
    {
		rl2_graph_destroy_context (ctx_labels);
		ctx_labels = NULL;
	}

    if (!get_payload_from_rgb_rgba_transparent
	(width, height, rgb, alpha, format_id, quality, &image, &image_size,
	 1.0, half_transparent))
	goto error;
    if (rgb != NULL)
	free (rgb);

Changes to src/rl2symbaux.c.

876
877
878
879
880
881
882
883
884
885
886
887


888
889
890
891
892
893
894
...
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
....
1000
1001
1002
1003
1004
1005
1006





















1007
1008
1009
1010
1011
1012
1013
....
1585
1586
1587
1588
1589
1590
1591

1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602

1603
1604
1605
1606
1607
1608
1609
....
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620

1621
1622
1623
1624
1625
1626
1627
....
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640







1641
1642
1643
1644
1645
1646
1647
....
1653
1654
1655
1656
1657
1658
1659







1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672





1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686



1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699


1700
1701
1702
1703
1704
1705
1706
1707
1708
1709

1710
1711
1712
1713
1714
1715
1716
....
1747
1748
1749
1750
1751
1752
1753

1754
1755
1756
1757
1758
1759
1760
....
1774
1775
1776
1777
1778
1779
1780



1781
1782
1783
1784
1785
1786
1787
....
1798
1799
1800
1801
1802
1803
1804





1805
1806
1807
1808
1809
1810
1811
....
2032
2033
2034
2035
2036
2037
2038





















2039
2040
2041
2042
2043
2044
2045
....
2118
2119
2120
2121
2122
2123
2124









































































































2125
2126
2127
2128
2129
2130
2131
....
2163
2164
2165
2166
2167
2168
2169




































2170
2171
2172
2173
2174
2175
2176
....
2191
2192
2193
2194
2195
2196
2197
























2198
2199
2200
2201
2202
2203
2204
....
2239
2240
2241
2242
2243
2244
2245
























2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257











2258
2259
2260
2261
2262
2263
2264
....
2293
2294
2295
2296
2297
2298
2299










































2300
2301
2302
2303
2304
2305
2306
....
2314
2315
2316
2317
2318
2319
2320





















2321
2322
2323
2324
2325
2326
2327
....
2397
2398
2399
2400
2401
2402
2403






























































2404
2405
2406
2407
2408
2409
2410
....
2443
2444
2445
2446
2447
2448
2449





































2450
2451
2452
2453
2454
2455
2456
....
2471
2472
2473
2474
2475
2476
2477


























2478
2479
2480
2481
2482
2483
2484
....
2520
2521
2522
2523
2524
2525
2526


























2527
2528
2529
2530
2531
2532
2533
....
2561
2562
2563
2564
2565
2566
2567










































2568
2569
2570
2571
2572
2573
2574
....
2582
2583
2584
2585
2586
2587
2588





















2589
2590
2591
2592
2593
2594
2595
....
2668
2669
2670
2671
2672
2673
2674





























































2675
2676
2677
2678
2679
2680
2681
....
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733

























































2734
2735
2736
2737
2738
2739
2740
2741


















































2742
2743
2744
2745
2746
2747
2748
....
2879
2880
2881
2882
2883
2884
2885
















































































2886
2887
2888
2889
2890
2891
2892
....
2983
2984
2985
2986
2987
2988
2989















































2990
2991
2992
2993
2994
2995
2996
....
3011
3012
3013
3014
3015
3016
3017












3018
3019
3020
3021
3022
3023
3024
....
3047
3048
3049
3050
3051
3052
3053












































3054
3055
3056
3057
3058
3059
3060
....
3078
3079
3080
3081
3082
3083
3084






































3085
3086
3087
3088
3089
3090
3091
....
3209
3210
3211
3212
3213
3214
3215






























































































































































































3216
3217
3218
3219
3220
3221
3222
....
3283
3284
3285
3286
3287
3288
3289



























































3290
3291
3292
3293
3294
3295
3296
....
3387
3388
3389
3390
3391
3392
3393
































































3394
3395
3396
3397
3398
3399
3400
....
3455
3456
3457
3458
3459
3460
3461
































































3462
3463
3464
3465
3466
3467
3468
....
3563
3564
3565
3566
3567
3568
3569
































































3570
3571
3572
3573
3574
3575
3576
....
3622
3623
3624
3625
3626
3627
3628


3629
3630
3631
3632
3633
3634
3635
....
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
....
3705
3706
3707
3708
3709
3710
3711
3712





















































































































3713
3714
3715
3716
3717
3718


3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731


3732
3733
3734
3735
3736
3737
3738
....
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753


3754
3755
3756
3757
3758
3759
3760
....
3778
3779
3780
3781
3782
3783
3784














3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797














3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808




3809
3810
3811
3812
3813
3814
3815
....
3824
3825
3826
3827
3828
3829
3830


3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843






3844
3845
3846
3847
3848
3849
3850
3851
3852










3853
3854
3855
3856
3857
3858
3859
3860
3861






3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872


3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884










3885
3886
3887
3888
3889
3890
3891
		if (symbolizer == NULL)
		    *scale_forbidden = 1;
		else
		    return (rl2VectorSymbolizerPtr) symbolizer;
	    }
	  pR = pR->next;
      }
    if (stl->else_rule != NULL)
      {
	  /* applyhing the ELSE rule */
	  *scale_forbidden = 0;
	  pR = stl->else_rule;


	  if (pR->min_scale != DBL_MAX && pR->max_scale != DBL_MAX)
	    {
		if (scale >= pR->min_scale && scale < pR->max_scale)
		    symbolizer = pR->style;
	    }
	  else if (pR->min_scale != DBL_MAX)
	    {
................................................................................
/* test if a FeatureTypeStyle has Text Symbolizers */
    rl2PrivVectorSymbolizerPtr sym;
    rl2PrivVectorSymbolizerItemPtr item;
    rl2PrivStyleRulePtr pR;
    rl2PrivFeatureTypeStylePtr stl = (rl2PrivFeatureTypeStylePtr) style;
    if (stl == NULL)
	return 0;
    if (stl->first_rule == NULL)
      {
	  /* there are no rules */
	  return 0;
      }

    pR = stl->first_rule;
    while (pR != NULL)
      {
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	      ;
	  else
................................................................................
		      /* found a valid Text Symbolizer */
		      return 1;
		  }
		item = item->next;
	    }
	  pR = pR->next;
      }





















    return 0;
}

RL2_PRIVATE void
rl2_destroy_rule_like_args (rl2PrivRuleLikeArgsPtr args)
{
/* destroying a Rule Like arguments object */
................................................................................
{
/* creating a default Color Replacement object */
    rl2PrivColorReplacementPtr repl = malloc (sizeof (rl2PrivColorReplacement));
    repl->index = 0;
    repl->red = 0;
    repl->green = 0;
    repl->blue = 0;

    repl->next = NULL;
    return repl;
}

RL2_PRIVATE rl2PrivGraphicItemPtr
rl2_create_default_external_graphic ()
{
/* creating a default Graphic Item object (ExternalGraphic) */
    rl2PrivGraphicItemPtr item = malloc (sizeof (rl2PrivGraphicItem));
    rl2PrivExternalGraphicPtr ext = malloc (sizeof (rl2PrivExternalGraphic));
    ext->xlink_href = NULL;

    ext->first = NULL;
    ext->last = NULL;
    item->type = RL2_EXTERNAL_GRAPHIC;
    item->item = ext;
    item->next = NULL;
    return item;
}
................................................................................
RL2_PRIVATE rl2PrivGraphicItemPtr
rl2_create_default_mark ()
{
/* creating a default Graphic Item object (Mark) */
    rl2PrivGraphicItemPtr item = malloc (sizeof (rl2PrivGraphicItem));
    rl2PrivMarkPtr mark = malloc (sizeof (rl2PrivMark));
    mark->well_known_type = RL2_GRAPHIC_MARK_UNKNOWN;
    mark->external_graphic = NULL;
    mark->stroke = NULL;
    mark->fill = NULL;

    item->type = RL2_MARK_GRAPHIC;
    item->item = mark;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivGraphicPtr
................................................................................
rl2_create_default_graphic ()
{
/* creating a default Graphic object) */
    rl2PrivGraphicPtr graphic = malloc (sizeof (rl2PrivGraphic));
    graphic->first = NULL;
    graphic->last = NULL;
    graphic->opacity = 1.0;
    graphic->size = 10.0;
    graphic->rotation = 0.0;
    graphic->anchor_point_x = 0.5;
    graphic->anchor_point_y = 0.5;
    graphic->displacement_x = 0.0;
    graphic->displacement_y = 0.0;







    return graphic;
}

RL2_PRIVATE rl2PrivStrokePtr
rl2_create_default_stroke ()
{
/* creating a default Stroke object */
................................................................................
    stroke->opacity = 1.0;
    stroke->width = 1.0;
    stroke->linejoin = RL2_STROKE_LINEJOIN_UNKNOWN;
    stroke->linecap = RL2_STROKE_LINECAP_UNKNOWN;
    stroke->dash_count = 0;
    stroke->dash_list = NULL;
    stroke->dash_offset = 0.0;







    return stroke;
}

RL2_PRIVATE rl2PrivPointPlacementPtr
rl2_create_default_point_placement ()
{
/* creating a default PointPlacement object */
    rl2PrivPointPlacementPtr place = malloc (sizeof (rl2PrivPointPlacement));
    place->anchor_point_x = 0.5;
    place->anchor_point_y = 0.5;
    place->displacement_x = 0.0;
    place->displacement_y = 0.0;
    place->rotation = 0.0;





    return place;
}

RL2_PRIVATE rl2PrivLinePlacementPtr
rl2_create_default_line_placement ()
{
/* creating a default LinePlacement object */
    rl2PrivLinePlacementPtr place = malloc (sizeof (rl2PrivLinePlacement));
    place->perpendicular_offset = 0.0;
    place->is_repeated = 0;
    place->initial_gap = 0.0;
    place->gap = 0.0;
    place->is_aligned = 0;
    place->generalize_line = 0;



    return place;
}

RL2_PRIVATE rl2PrivFillPtr
rl2_create_default_fill ()
{
/* creating a default Fill object */
    rl2PrivFillPtr fill = malloc (sizeof (rl2PrivFill));
    fill->graphic = NULL;
    fill->red = 128;
    fill->green = 128;
    fill->blue = 128;
    fill->opacity = 1.0;


    return fill;
}

RL2_PRIVATE rl2PrivHaloPtr
rl2_create_default_halo ()
{
/* creating a default Halo object */
    rl2PrivHaloPtr halo = malloc (sizeof (rl2PrivHalo));
    halo->radius = 1.0;
    halo->fill = NULL;

    return halo;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
rl2_create_default_point_symbolizer ()
{
/* creating a default Point Symbolizer */
................................................................................
	      free (symbolizer);
	  if (item != NULL)
	      free (item);
	  return NULL;
      }
    symbolizer->stroke = NULL;
    symbolizer->perpendicular_offset = 0.0;

    item->symbolizer_type = RL2_LINE_SYMBOLIZER;
    item->symbolizer = symbolizer;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
................................................................................
	  return NULL;
      }
    symbolizer->stroke = NULL;
    symbolizer->fill = NULL;
    symbolizer->displacement_x = 0.0;
    symbolizer->displacement_y = 0.0;
    symbolizer->perpendicular_offset = 0.0;



    item->symbolizer_type = RL2_POLYGON_SYMBOLIZER;
    item->symbolizer = symbolizer;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
................................................................................
	  if (symbolizer != NULL)
	      free (symbolizer);
	  if (item != NULL)
	      free (item);
	  return NULL;
      }
    symbolizer->label = NULL;





    symbolizer->font_families_count = 0;
    for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
	*(symbolizer->font_families + i) = NULL;
    symbolizer->font_style = RL2_FONT_STYLE_NORMAL;
    symbolizer->font_weight = RL2_FONT_WEIGHT_NORMAL;
    symbolizer->font_size = 10.0;
    symbolizer->label_placement_type = RL2_LABEL_PLACEMENT_UNKNOWN;
................................................................................
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->xlink_href;
}






















RL2_DECLARE int
rl2_line_symbolizer_get_graphic_stroke_recode_count (rl2LineSymbolizerPtr
						     symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Stroke (LineSymbolizer) */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}










































































































RL2_DECLARE int
rl2_line_symbolizer_get_stroke_color (rl2LineSymbolizerPtr symbolizer,
				      unsigned char *red,
				      unsigned char *green, unsigned char *blue)
{
/* return the Line Symbolizer Stroke RGB color */
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *width = sym->stroke->width;
    return RL2_OK;
}





































RL2_DECLARE int
rl2_line_symbolizer_get_stroke_linejoin (rl2LineSymbolizerPtr symbolizer,
					 unsigned char *linejoin)
{
/* return the Line Symbolizer Stroke Linejoin mode */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *linecap = sym->stroke->linecap;
    return RL2_OK;
}

























RL2_DECLARE int
rl2_line_symbolizer_get_stroke_dash_count (rl2LineSymbolizerPtr symbolizer,
					   int *count)
{
/* return the Line Symbolizer Stroke Dash count */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *offset = sym->stroke->dash_offset;
    return RL2_OK;
}

























RL2_DECLARE int
rl2_line_symbolizer_get_perpendicular_offset (rl2LineSymbolizerPtr symbolizer,
					      double *offset)
{
/* return the Line Symbolizer perpendicular offset */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    *offset = sym->perpendicular_offset;
    return RL2_OK;
}












RL2_DECLARE int
rl2_polygon_symbolizer_has_stroke (rl2PolygonSymbolizerPtr symbolizer,
				   int *stroke)
{
/* checks if a Polygon Symbolizer has a Stroke */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			  && sym->stroke->graphic->first->item != NULL)
			  *stroke = 1;
		  }
	    }
      }
    return RL2_OK;
}











































RL2_DECLARE const char *
rl2_polygon_symbolizer_get_graphic_stroke_href (rl2PolygonSymbolizerPtr
						symbolizer)
{
/* return an eventual Polygon Symbolizer Graphic Stroke xlink:href  */
    rl2PrivExternalGraphicPtr ext;
................................................................................
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->xlink_href;
}






















RL2_DECLARE int
    rl2_polygon_symbolizer_get_graphic_stroke_recode_count
    (rl2PolygonSymbolizerPtr symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Stroke (PolygonSymbolizer) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}































































RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_color (rl2PolygonSymbolizerPtr symbolizer,
					 unsigned char *red,
					 unsigned char *green,
					 unsigned char *blue)
{
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *width = sym->stroke->width;
    return RL2_OK;
}






































RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_linejoin (rl2PolygonSymbolizerPtr
					    symbolizer, unsigned char *linejoin)
{
/* return the Polygon Symbolizer Stroke Linejoin mode */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *linecap = sym->stroke->linecap;
    return RL2_OK;
}



























RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_dash_count (rl2PolygonSymbolizerPtr
					      symbolizer, int *count)
{
/* return the Polygon Symbolizer Stroke Dash count */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *offset = sym->stroke->dash_offset;
    return RL2_OK;
}



























RL2_DECLARE int
rl2_polygon_symbolizer_has_fill (rl2PolygonSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Polygon Symbolizer has a Fill */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
			  && sym->fill->graphic->first->item != NULL)
			  *fill = 1;
		  }
	    }
      }
    return RL2_OK;
}











































RL2_DECLARE const char *
rl2_polygon_symbolizer_get_graphic_fill_href (rl2PolygonSymbolizerPtr
					      symbolizer)
{
/* return an eventual Polygon Symbolizer Graphic Fill xlink:href  */
    rl2PrivExternalGraphicPtr ext;
................................................................................
    if (sym->fill->graphic->first == NULL)
	return NULL;
    if (sym->fill->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->fill->graphic->first->item);
    return ext->xlink_href;
}






















RL2_DECLARE int
rl2_polygon_symbolizer_get_graphic_fill_recode_count (rl2PolygonSymbolizerPtr
						      symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Fill (PolygonSymbolizer) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}






























































RL2_DECLARE int
rl2_polygon_symbolizer_get_fill_color (rl2PolygonSymbolizerPtr symbolizer,
				       unsigned char *red,
				       unsigned char *green,
				       unsigned char *blue)
{
................................................................................
    return RL2_OK;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_displacement (rl2PolygonSymbolizerPtr symbolizer,
					 double *x, double *y)
{
/* return the Polygon Symbolizer Stroke perpendicula offset */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    *x = sym->displacement_x;
    *y = sym->displacement_y;
    return RL2_OK;
}

RL2_DECLARE const char *

























































rl2_text_symbolizer_get_label (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer label name */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->label;
}



















































RL2_DECLARE int
rl2_text_symbolizer_get_font_families_count (rl2TextSymbolizerPtr symbolizer,
					     int *count)
{
/* return how many Font Families are defined (Text Symbolizer) */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
................................................................................
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return RL2_ERROR;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    *rotation = place->rotation;
    return RL2_OK;
}

















































































RL2_DECLARE int
    rl2_text_symbolizer_get_line_placement_perpendicular_offset
    (rl2TextSymbolizerPtr symbolizer, double *offset)
{
/* return the Text Symbolizer LinePlacement PerpendicularOffset */
    rl2PrivLinePlacementPtr place;
................................................................................
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_LINE
	|| sym->label_placement == NULL)
	return RL2_ERROR;
    place = (rl2PrivLinePlacementPtr) (sym->label_placement);
    *generalize_line = place->generalize_line;
    return RL2_OK;
}
















































RL2_DECLARE int
rl2_text_symbolizer_has_halo (rl2TextSymbolizerPtr symbolizer, int *halo)
{
/* checks if a Text Symbolizer has an Halo */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->halo == NULL)
	return RL2_ERROR;
    *radius = sym->halo->radius;
    return RL2_OK;
}













RL2_DECLARE int
rl2_text_symbolizer_has_halo_fill (rl2TextSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Text Symbolizer Halo has a Fill */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym->halo->fill == NULL)
	return RL2_ERROR;
    *red = sym->halo->fill->red;
    *green = sym->halo->fill->green;
    *blue = sym->halo->fill->blue;
    return RL2_OK;
}













































RL2_DECLARE int
rl2_text_symbolizer_has_fill (rl2TextSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Text Symbolizer has a Fill */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym->fill == NULL)
	return RL2_ERROR;
    *red = sym->fill->red;
    *green = sym->fill->green;
    *blue = sym->fill->blue;
    return RL2_OK;
}







































RL2_DECLARE int
rl2_point_symbolizer_get_count (rl2PointSymbolizerPtr symbolizer, int *count)
{
/* return the Point Symbolizer items count */
    int cnt = 0;
    rl2PrivGraphicItemPtr item;
................................................................................
		return RL2_ERROR;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}































































































































































































RL2_DECLARE int
rl2_point_symbolizer_is_mark (rl2PointSymbolizerPtr symbolizer, int index,
			      int *mark)
{
/* checks if a Point Symbolizer item is a Mark */
    int count = 0;
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}




























































RL2_DECLARE int
rl2_point_symbolizer_mark_has_stroke (rl2PointSymbolizerPtr symbolizer,
				      int index, int *stroke)
{
/* checks if a Point Symbolizer Mark has a Stroke */
    int count = 0;
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

































































RL2_DECLARE int
rl2_point_symbolizer_mark_get_stroke_linejoin (rl2PointSymbolizerPtr
					       symbolizer, int index,
					       unsigned char *linejoin)
{
/* return the Point Symbolizer Mark Stroke Linejoin mode */
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

































































RL2_DECLARE int
rl2_point_symbolizer_mark_get_stroke_dash_count (rl2PointSymbolizerPtr
						 symbolizer, int index,
						 int *cnt)
{
/* return the Point Symbolizer Mark Stroke Dash count */
................................................................................
		return RL2_OK;
	    }
	  count++;
	  itm = itm->next;
      }
    return RL2_ERROR;
}

































































RL2_DECLARE int
rl2_point_symbolizer_mark_has_fill (rl2PointSymbolizerPtr symbolizer,
				    int index, int *fill)
{
/* checks if a Point Symbolizer Mark has a Fill */
    int count = 0;
................................................................................
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return RL2_ERROR;


		*red = mark->fill->red;
		*green = mark->fill->green;
		*blue = mark->fill->blue;
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
................................................................................

RL2_DECLARE int
rl2_point_symbolizer_get_rotation (rl2PointSymbolizerPtr symbolizer,
				   double *rotation)
{
/* return a Point Symbolizer Rotation */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    fprintf (stderr, "GetRotation2\n");
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->graphic == NULL)
	return RL2_ERROR;
    *rotation = sym->graphic->rotation;
    fprintf (stderr, "GetRotation2 %f\n", *rotation);
    return RL2_OK;
}

RL2_DECLARE int
rl2_point_symbolizer_get_anchor_point (rl2PointSymbolizerPtr symbolizer,
				       double *x, double *y)
{
................................................................................
	return RL2_ERROR;
    if (sym->graphic == NULL)
	return RL2_ERROR;
    *x = sym->graphic->displacement_x;
    *y = sym->graphic->displacement_y;
    return RL2_OK;
}






















































































































RL2_PRIVATE void
rl2_destroy_color_replacement (rl2PrivColorReplacementPtr repl)
{
/* destroying a Color Replacement object */
    if (repl == NULL)
	return;


    free (repl);
}

RL2_PRIVATE void
rl2_destroy_external_graphic (rl2PrivExternalGraphicPtr ext)
{
/* destroying an External Graphic object */
    rl2PrivColorReplacementPtr repl;
    rl2PrivColorReplacementPtr replN;
    if (ext == NULL)
	return;
    if (ext->xlink_href != NULL)
	free (ext->xlink_href);


    repl = ext->first;
    while (repl != NULL)
      {
	  replN = repl->next;
	  rl2_destroy_color_replacement (repl);
	  repl = replN;
      }
................................................................................

RL2_PRIVATE void
rl2_destroy_mark (rl2PrivMarkPtr mark)
{
/* destroying a Mark object */
    if (mark == NULL)
	return;
    if (mark->external_graphic != NULL)
	rl2_destroy_external_graphic (mark->external_graphic);
    if (mark->stroke != NULL)
	rl2_destroy_stroke (mark->stroke);
    if (mark->fill != NULL)
	rl2_destroy_fill (mark->fill);


    free (mark);
}

RL2_PRIVATE void
rl2_destroy_graphic_item (rl2PrivGraphicItemPtr item)
{
/* destroying a Graphic Item object */
................................................................................
    item = graphic->first;
    while (item != NULL)
      {
	  itemN = item->next;
	  rl2_destroy_graphic_item (item);
	  item = itemN;
      }














    free (graphic);
}

RL2_PRIVATE void
rl2_destroy_stroke (rl2PrivStrokePtr stroke)
{
/* destroying a Stroke object */
    if (stroke == NULL)
	return;
    if (stroke->graphic != NULL)
	rl2_destroy_graphic (stroke->graphic);
    if (stroke->dash_list != NULL)
	free (stroke->dash_list);














    free (stroke);
}

RL2_PRIVATE void
rl2_destroy_fill (rl2PrivFillPtr fill)
{
/* destroying a Fill object */
    if (fill == NULL)
	return;
    if (fill->graphic != NULL)
	rl2_destroy_graphic (fill->graphic);




    free (fill);
}

RL2_PRIVATE void
rl2_destroy_point_symbolizer (rl2PrivPointSymbolizerPtr ptr)
{
/* destroying a Point Symbolizer */
................................................................................
rl2_destroy_line_symbolizer (rl2PrivLineSymbolizerPtr ptr)
{
/* destroying a Line Symbolizer */
    if (ptr == NULL)
	return;
    if (ptr->stroke != NULL)
	rl2_destroy_stroke (ptr->stroke);


    free (ptr);
}

RL2_PRIVATE void
rl2_destroy_polygon_symbolizer (rl2PrivPolygonSymbolizerPtr ptr)
{
/* destroying a Polygon Symbolizer */
    if (ptr == NULL)
	return;
    if (ptr->stroke != NULL)
	rl2_destroy_stroke (ptr->stroke);
    if (ptr->fill != NULL)
	rl2_destroy_fill (ptr->fill);






    free (ptr);
}

RL2_PRIVATE void
rl2_destroy_point_placement (rl2PrivPointPlacementPtr place)
{
/* destroying a PointPlacement object */
    if (place == NULL)
	return;










    free (place);
}

RL2_PRIVATE void
rl2_destroy_line_placement (rl2PrivLinePlacementPtr place)
{
/* destroying a LinePlacement object */
    if (place == NULL)
	return;






    free (place);
}

RL2_PRIVATE void
rl2_destroy_halo (rl2PrivHaloPtr halo)
{
/* destroying an Halo object */
    if (halo == NULL)
	return;
    if (halo->fill != NULL)
	rl2_destroy_fill (halo->fill);


    free (halo);
}

RL2_PRIVATE void
rl2_destroy_text_symbolizer (rl2PrivTextSymbolizerPtr ptr)
{
/* destroying a Text Symbolizer */
    int i;
    if (ptr == NULL)
	return;
    if (ptr->label != NULL)
	free (ptr->label);










    for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
      {
	  if (*(ptr->font_families + i) != NULL)
	      free (*(ptr->font_families + i));
      }
    if (ptr->label_placement_type == RL2_LABEL_PLACEMENT_POINT
	&& ptr->label_placement != NULL)







<
|
<
<
|
>
>







 







<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>











>







 







<


>







 







|





>
>
>
>
>
>
>







 







>
>
>
>
>
>
>













>
>
>
>
>












<

>
>
>













>
>










>







 







>







 







>
>
>







 







>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>







 







<





<







 








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>













>
>







 







<
<




>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>











>
>
>
>







 







>
>













>
>
>
>
>
>









>
>
>
>
>
>
>
>
>
>









>
>
>
>
>
>











>
>












>
>
>
>
>
>
>
>
>
>







876
877
878
879
880
881
882

883


884
885
886
887
888
889
890
891
892
893
...
968
969
970
971
972
973
974





975
976
977
978
979
980
981
...
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
....
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
....
1628
1629
1630
1631
1632
1633
1634

1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
....
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
....
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720

1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
....
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
....
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
....
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
....
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
....
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
....
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
....
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
....
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
....
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
....
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
....
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
....
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
....
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
....
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
....
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
....
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
....
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
....
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
....
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
....
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
....
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
....
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
....
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
....
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
....
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
....
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
....
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
....
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
....
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
....
5046
5047
5048
5049
5050
5051
5052

5053
5054
5055
5056
5057

5058
5059
5060
5061
5062
5063
5064
....
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
....
5240
5241
5242
5243
5244
5245
5246


5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
....
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
....
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
		if (symbolizer == NULL)
		    *scale_forbidden = 1;
		else
		    return (rl2VectorSymbolizerPtr) symbolizer;
	    }
	  pR = pR->next;
      }




    pR = stl->else_rule;
    if (pR != NULL)
      {
	  if (pR->min_scale != DBL_MAX && pR->max_scale != DBL_MAX)
	    {
		if (scale >= pR->min_scale && scale < pR->max_scale)
		    symbolizer = pR->style;
	    }
	  else if (pR->min_scale != DBL_MAX)
	    {
................................................................................
/* test if a FeatureTypeStyle has Text Symbolizers */
    rl2PrivVectorSymbolizerPtr sym;
    rl2PrivVectorSymbolizerItemPtr item;
    rl2PrivStyleRulePtr pR;
    rl2PrivFeatureTypeStylePtr stl = (rl2PrivFeatureTypeStylePtr) style;
    if (stl == NULL)
	return 0;






    pR = stl->first_rule;
    while (pR != NULL)
      {
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	      ;
	  else
................................................................................
		      /* found a valid Text Symbolizer */
		      return 1;
		  }
		item = item->next;
	    }
	  pR = pR->next;
      }

    pR = stl->else_rule;
    if (pR != NULL)
      {
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	      ;
	  else
	      return 0;
	  sym = pR->style;
	  item = sym->first;
	  while (item != NULL)
	    {
		if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
		    && item->symbolizer != NULL)
		  {
		      /* found a valid Text Symbolizer */
		      return 1;
		  }
		item = item->next;
	    }
      }
    return 0;
}

RL2_PRIVATE void
rl2_destroy_rule_like_args (rl2PrivRuleLikeArgsPtr args)
{
/* destroying a Rule Like arguments object */
................................................................................
{
/* creating a default Color Replacement object */
    rl2PrivColorReplacementPtr repl = malloc (sizeof (rl2PrivColorReplacement));
    repl->index = 0;
    repl->red = 0;
    repl->green = 0;
    repl->blue = 0;
    repl->col_color = NULL;
    repl->next = NULL;
    return repl;
}

RL2_PRIVATE rl2PrivGraphicItemPtr
rl2_create_default_external_graphic ()
{
/* creating a default Graphic Item object (ExternalGraphic) */
    rl2PrivGraphicItemPtr item = malloc (sizeof (rl2PrivGraphicItem));
    rl2PrivExternalGraphicPtr ext = malloc (sizeof (rl2PrivExternalGraphic));
    ext->xlink_href = NULL;
    ext->col_href = NULL;
    ext->first = NULL;
    ext->last = NULL;
    item->type = RL2_EXTERNAL_GRAPHIC;
    item->item = ext;
    item->next = NULL;
    return item;
}
................................................................................
RL2_PRIVATE rl2PrivGraphicItemPtr
rl2_create_default_mark ()
{
/* creating a default Graphic Item object (Mark) */
    rl2PrivGraphicItemPtr item = malloc (sizeof (rl2PrivGraphicItem));
    rl2PrivMarkPtr mark = malloc (sizeof (rl2PrivMark));
    mark->well_known_type = RL2_GRAPHIC_MARK_UNKNOWN;

    mark->stroke = NULL;
    mark->fill = NULL;
    mark->col_mark_type = NULL;
    item->type = RL2_MARK_GRAPHIC;
    item->item = mark;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivGraphicPtr
................................................................................
rl2_create_default_graphic ()
{
/* creating a default Graphic object) */
    rl2PrivGraphicPtr graphic = malloc (sizeof (rl2PrivGraphic));
    graphic->first = NULL;
    graphic->last = NULL;
    graphic->opacity = 1.0;
    graphic->size = 6.0;
    graphic->rotation = 0.0;
    graphic->anchor_point_x = 0.5;
    graphic->anchor_point_y = 0.5;
    graphic->displacement_x = 0.0;
    graphic->displacement_y = 0.0;
    graphic->col_opacity = NULL;
    graphic->col_size = NULL;
    graphic->col_rotation = NULL;
    graphic->col_point_x = NULL;
    graphic->col_point_y = NULL;
    graphic->col_displ_x = NULL;
    graphic->col_displ_y = NULL;
    return graphic;
}

RL2_PRIVATE rl2PrivStrokePtr
rl2_create_default_stroke ()
{
/* creating a default Stroke object */
................................................................................
    stroke->opacity = 1.0;
    stroke->width = 1.0;
    stroke->linejoin = RL2_STROKE_LINEJOIN_UNKNOWN;
    stroke->linecap = RL2_STROKE_LINECAP_UNKNOWN;
    stroke->dash_count = 0;
    stroke->dash_list = NULL;
    stroke->dash_offset = 0.0;
    stroke->col_color = NULL;
    stroke->col_opacity = NULL;
    stroke->col_width = NULL;
    stroke->col_join = NULL;
    stroke->col_cap = NULL;
    stroke->col_dash = NULL;
    stroke->col_dashoff = NULL;
    return stroke;
}

RL2_PRIVATE rl2PrivPointPlacementPtr
rl2_create_default_point_placement ()
{
/* creating a default PointPlacement object */
    rl2PrivPointPlacementPtr place = malloc (sizeof (rl2PrivPointPlacement));
    place->anchor_point_x = 0.5;
    place->anchor_point_y = 0.5;
    place->displacement_x = 0.0;
    place->displacement_y = 0.0;
    place->rotation = 0.0;
    place->col_point_x = NULL;
    place->col_point_y = NULL;
    place->col_displ_x = NULL;
    place->col_displ_y = NULL;
    place->col_rotation = NULL;
    return place;
}

RL2_PRIVATE rl2PrivLinePlacementPtr
rl2_create_default_line_placement ()
{
/* creating a default LinePlacement object */
    rl2PrivLinePlacementPtr place = malloc (sizeof (rl2PrivLinePlacement));
    place->perpendicular_offset = 0.0;
    place->is_repeated = 0;
    place->initial_gap = 0.0;
    place->gap = 0.0;

    place->generalize_line = 0;
    place->col_perpoff = NULL;
    place->col_inigap = NULL;
    place->col_gap = NULL;
    return place;
}

RL2_PRIVATE rl2PrivFillPtr
rl2_create_default_fill ()
{
/* creating a default Fill object */
    rl2PrivFillPtr fill = malloc (sizeof (rl2PrivFill));
    fill->graphic = NULL;
    fill->red = 128;
    fill->green = 128;
    fill->blue = 128;
    fill->opacity = 1.0;
    fill->col_color = NULL;
    fill->col_opacity = NULL;
    return fill;
}

RL2_PRIVATE rl2PrivHaloPtr
rl2_create_default_halo ()
{
/* creating a default Halo object */
    rl2PrivHaloPtr halo = malloc (sizeof (rl2PrivHalo));
    halo->radius = 1.0;
    halo->fill = NULL;
    halo->col_radius = NULL;
    return halo;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
rl2_create_default_point_symbolizer ()
{
/* creating a default Point Symbolizer */
................................................................................
	      free (symbolizer);
	  if (item != NULL)
	      free (item);
	  return NULL;
      }
    symbolizer->stroke = NULL;
    symbolizer->perpendicular_offset = 0.0;
    symbolizer->col_perpoff = NULL;
    item->symbolizer_type = RL2_LINE_SYMBOLIZER;
    item->symbolizer = symbolizer;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
................................................................................
	  return NULL;
      }
    symbolizer->stroke = NULL;
    symbolizer->fill = NULL;
    symbolizer->displacement_x = 0.0;
    symbolizer->displacement_y = 0.0;
    symbolizer->perpendicular_offset = 0.0;
    symbolizer->col_displ_x = NULL;
    symbolizer->col_displ_y = NULL;
    symbolizer->col_perpoff = NULL;
    item->symbolizer_type = RL2_POLYGON_SYMBOLIZER;
    item->symbolizer = symbolizer;
    item->next = NULL;
    return item;
}

RL2_PRIVATE rl2PrivVectorSymbolizerItemPtr
................................................................................
	  if (symbolizer != NULL)
	      free (symbolizer);
	  if (item != NULL)
	      free (item);
	  return NULL;
      }
    symbolizer->label = NULL;
    symbolizer->col_label = NULL;
    symbolizer->col_font = NULL;
    symbolizer->col_style = NULL;
    symbolizer->col_weight = NULL;
    symbolizer->col_size = NULL;
    symbolizer->font_families_count = 0;
    for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
	*(symbolizer->font_families + i) = NULL;
    symbolizer->font_style = RL2_FONT_STYLE_NORMAL;
    symbolizer->font_weight = RL2_FONT_WEIGHT_NORMAL;
    symbolizer->font_size = 10.0;
    symbolizer->label_placement_type = RL2_LABEL_PLACEMENT_UNKNOWN;
................................................................................
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->xlink_href;
}

RL2_PRIVATE rl2PrivExternalGraphicPtr
rl2_line_symbolizer_get_stroke_external_graphic_ref (rl2LineSymbolizerPtr
						     symbolizer)
{
/* return a pointer to an External Graphic object (Line Stroke)  */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    if (sym->stroke->graphic == NULL)
	return NULL;
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext;
}

RL2_DECLARE int
rl2_line_symbolizer_get_graphic_stroke_recode_count (rl2LineSymbolizerPtr
						     symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Stroke (LineSymbolizer) */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}

RL2_PRIVATE rl2PrivColorReplacementPtr
rl2_line_symbolizer_get_stroke_color_replacement_ref (rl2LineSymbolizerPtr
						      symbolizer, int index,
						      int *color_index)
{
/* return a pointer to a ColorReplacement object (Line Stroke) */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke != NULL)
      {
	  if (sym->stroke->graphic != NULL)
	    {
		if (sym->stroke->graphic->first != NULL)
		  {
		      if (sym->stroke->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->stroke->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     stroke->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_graphic_stroke_href (rl2LineSymbolizerPtr
						 symbolizer)
{
/* return an eventual Line Symbolizer Table Column Name: Graphic Stroke Href */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    if (sym->stroke->graphic == NULL)
	return NULL;
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->col_href;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_graphic_stroke_recode_color (rl2LineSymbolizerPtr
							 symbolizer, int index,
							 int *color_index)
{
/* return an eventual Line Symbolizer Table Column Name: Graphic Stroke Color Replacement */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke != NULL)
      {
	  if (sym->stroke->graphic != NULL)
	    {
		if (sym->stroke->graphic->first != NULL)
		  {
		      if (sym->stroke->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->stroke->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     stroke->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl->col_color;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE int
rl2_line_symbolizer_get_stroke_color (rl2LineSymbolizerPtr symbolizer,
				      unsigned char *red,
				      unsigned char *green, unsigned char *blue)
{
/* return the Line Symbolizer Stroke RGB color */
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *width = sym->stroke->width;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_color (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke Color */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_color;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_opacity (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke Opacity */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_opacity;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_width (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke Width */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_width;
}

RL2_DECLARE int
rl2_line_symbolizer_get_stroke_linejoin (rl2LineSymbolizerPtr symbolizer,
					 unsigned char *linejoin)
{
/* return the Line Symbolizer Stroke Linejoin mode */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *linecap = sym->stroke->linecap;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_linejoin (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke LineJoin */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_join;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_linecap (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke LineCap */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_cap;
}

RL2_DECLARE int
rl2_line_symbolizer_get_stroke_dash_count (rl2LineSymbolizerPtr symbolizer,
					   int *count)
{
/* return the Line Symbolizer Stroke Dash count */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *offset = sym->stroke->dash_offset;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_dash_array (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke Dash Array */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_dash;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_stroke_dash_offset (rl2LineSymbolizerPtr symbolizer)
{
/* return the Line Symbolizer Table Column Name: Stroke Dash Offset */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_dashoff;
}

RL2_DECLARE int
rl2_line_symbolizer_get_perpendicular_offset (rl2LineSymbolizerPtr symbolizer,
					      double *offset)
{
/* return the Line Symbolizer perpendicular offset */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    *offset = sym->perpendicular_offset;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_line_symbolizer_get_col_perpendicular_offset (rl2LineSymbolizerPtr
						  symbolizer)
{
/* return the Line Symbolizer Table Column Name: Perpendicular Offset */
    rl2PrivLineSymbolizerPtr sym = (rl2PrivLineSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_perpoff;
}

RL2_DECLARE int
rl2_polygon_symbolizer_has_stroke (rl2PolygonSymbolizerPtr symbolizer,
				   int *stroke)
{
/* checks if a Polygon Symbolizer has a Stroke */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			  && sym->stroke->graphic->first->item != NULL)
			  *stroke = 1;
		  }
	    }
      }
    return RL2_OK;
}

RL2_PRIVATE rl2PrivColorReplacementPtr
rl2_polygon_symbolizer_get_stroke_color_replacement_ref (rl2PolygonSymbolizerPtr
							 symbolizer, int index,
							 int *color_index)
{
/* return a pointer to a ColorReplacement object (Polygon Stroke) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke != NULL)
      {
	  if (sym->stroke->graphic != NULL)
	    {
		if (sym->stroke->graphic->first != NULL)
		  {
		      if (sym->stroke->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->stroke->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     stroke->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_graphic_stroke_href (rl2PolygonSymbolizerPtr
						symbolizer)
{
/* return an eventual Polygon Symbolizer Graphic Stroke xlink:href  */
    rl2PrivExternalGraphicPtr ext;
................................................................................
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->xlink_href;
}

RL2_PRIVATE rl2PrivExternalGraphicPtr
rl2_polygon_symbolizer_get_stroke_external_graphic_ref (rl2PolygonSymbolizerPtr
							symbolizer)
{
/* return a pointer to an External Graphic object (Polygon Stroke) */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    if (sym->stroke->graphic == NULL)
	return NULL;
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext;
}

RL2_DECLARE int
    rl2_polygon_symbolizer_get_graphic_stroke_recode_count
    (rl2PolygonSymbolizerPtr symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Stroke (PolygonSymbolizer) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_graphic_stroke_href (rl2PolygonSymbolizerPtr
						    symbolizer)
{
/* return a Polygon Symbolizer Table Column Name: Graphic Stroke Href  */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    if (sym->stroke->graphic == NULL)
	return NULL;
    if (sym->stroke->graphic->first == NULL)
	return NULL;
    if (sym->stroke->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->stroke->graphic->first->item);
    return ext->col_href;
}

RL2_DECLARE const char
    *rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color
    (rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index)
{
/* return a Polygon Symbolizer Table Column Name: ColorReplacement */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke != NULL)
      {
	  if (sym->stroke->graphic != NULL)
	    {
		if (sym->stroke->graphic->first != NULL)
		  {
		      if (sym->stroke->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->stroke->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     stroke->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl->col_color;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_color (rl2PolygonSymbolizerPtr symbolizer,
					 unsigned char *red,
					 unsigned char *green,
					 unsigned char *blue)
{
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *width = sym->stroke->width;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_color (rl2PolygonSymbolizerPtr symbolizer)
{
/* return the Polygon Symbolizer Stroke Table Column Name: Stroke Color */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_color;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_opacity (rl2PolygonSymbolizerPtr
					       symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: Stroke Opacity */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_opacity;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_width (rl2PolygonSymbolizerPtr symbolizer)
{
/* return the Polygon Symbolizer Stroke width */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_width;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_linejoin (rl2PolygonSymbolizerPtr
					    symbolizer, unsigned char *linejoin)
{
/* return the Polygon Symbolizer Stroke Linejoin mode */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *linecap = sym->stroke->linecap;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_linejoin (rl2PolygonSymbolizerPtr
						symbolizer)
{
/* return the Polygon Symbolizer Stroke LineJoin */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_join;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_linecap (rl2PolygonSymbolizerPtr
					       symbolizer)
{
/* return the Polygon Symbolizer Stroke LineCap */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_cap;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_stroke_dash_count (rl2PolygonSymbolizerPtr
					      symbolizer, int *count)
{
/* return the Polygon Symbolizer Stroke Dash count */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->stroke == NULL)
	return RL2_ERROR;
    *offset = sym->stroke->dash_offset;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_dash_array (rl2PolygonSymbolizerPtr
						  symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: Stroke Dash Array */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_dash;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_stroke_dash_offset (rl2PolygonSymbolizerPtr
						   symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: Stroke Dash Offset */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->stroke == NULL)
	return NULL;
    return sym->stroke->col_dashoff;
}

RL2_DECLARE int
rl2_polygon_symbolizer_has_fill (rl2PolygonSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Polygon Symbolizer has a Fill */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
			  && sym->fill->graphic->first->item != NULL)
			  *fill = 1;
		  }
	    }
      }
    return RL2_OK;
}

RL2_PRIVATE rl2PrivColorReplacementPtr
rl2_polygon_symbolizer_get_fill_color_replacement_ref (rl2PolygonSymbolizerPtr
						       symbolizer, int index,
						       int *color_index)
{
/* return a pointer to a ColorReplacement object (Polygon Fill) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill != NULL)
      {
	  if (sym->fill->graphic != NULL)
	    {
		if (sym->fill->graphic->first != NULL)
		  {
		      if (sym->fill->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->fill->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     fill->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_graphic_fill_href (rl2PolygonSymbolizerPtr
					      symbolizer)
{
/* return an eventual Polygon Symbolizer Graphic Fill xlink:href  */
    rl2PrivExternalGraphicPtr ext;
................................................................................
    if (sym->fill->graphic->first == NULL)
	return NULL;
    if (sym->fill->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->fill->graphic->first->item);
    return ext->xlink_href;
}

RL2_PRIVATE rl2PrivExternalGraphicPtr
rl2_polygon_symbolizer_get_fill_external_graphic_ref (rl2PolygonSymbolizerPtr
						      symbolizer)
{
/* return a pointer to an External Graphic object (Polygon Fill) */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    if (sym->fill->graphic == NULL)
	return NULL;
    if (sym->fill->graphic->first == NULL)
	return NULL;
    if (sym->fill->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->fill->graphic->first->item);
    return ext;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_graphic_fill_recode_count (rl2PolygonSymbolizerPtr
						      symbolizer, int *count)
{
/* return how many ColorReplacement items are in a Graphic Fill (PolygonSymbolizer) */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
................................................................................
			      }
			}
		  }
	    }
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_graphic_fill_href (rl2PolygonSymbolizerPtr
						  symbolizer)
{
/* Polygon Symbolizer Table Column Name: Graphic Fill Href  */
    rl2PrivExternalGraphicPtr ext;
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    if (sym->fill->graphic == NULL)
	return NULL;
    if (sym->fill->graphic->first == NULL)
	return NULL;
    if (sym->fill->graphic->first->type != RL2_EXTERNAL_GRAPHIC)
	return NULL;
    ext = (rl2PrivExternalGraphicPtr) (sym->fill->graphic->first->item);
    return ext->col_href;
}

RL2_DECLARE const char *rl2_polygon_symbolizer_get_col_graphic_fill_recode_color
    (rl2PolygonSymbolizerPtr symbolizer, int index, int *color_index)
{
/* Polygon Symbolizer Table Column Name: Graphic Fill Colort Replacement */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill != NULL)
      {
	  if (sym->fill->graphic != NULL)
	    {
		if (sym->fill->graphic->first != NULL)
		  {
		      if (sym->fill->graphic->first->type ==
			  RL2_EXTERNAL_GRAPHIC
			  && sym->fill->graphic->first->item != NULL)
			{
			    int cnt = 0;
			    rl2PrivExternalGraphicPtr ext =
				(rl2PrivExternalGraphicPtr) (sym->
							     fill->graphic->
							     first->item);
			    rl2PrivColorReplacementPtr repl = ext->first;
			    while (repl != NULL)
			      {
				  if (cnt == index)
				    {
					*color_index = repl->index;
					return repl->col_color;
				    }
				  cnt++;
				  repl = repl->next;
			      }
			}
		  }
	    }
      }
    return NULL;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_fill_color (rl2PolygonSymbolizerPtr symbolizer,
				       unsigned char *red,
				       unsigned char *green,
				       unsigned char *blue)
{
................................................................................
    return RL2_OK;
}

RL2_DECLARE int
rl2_polygon_symbolizer_get_displacement (rl2PolygonSymbolizerPtr symbolizer,
					 double *x, double *y)
{
/* return the Polygon Symbolizer Displacement */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    *x = sym->displacement_x;
    *y = sym->displacement_y;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_fill_color (rl2PolygonSymbolizerPtr symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: Fill Color */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    return sym->fill->col_color;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_fill_opacity (rl2PolygonSymbolizerPtr symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: Fill opacity */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    return sym->fill->col_opacity;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_perpendicular_offset (rl2PolygonSymbolizerPtr
						     symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: perpendicular offset */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_perpoff;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_displacement_x (rl2PolygonSymbolizerPtr
					       symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: displacement X */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_displ_x;
}

RL2_DECLARE const char *
rl2_polygon_symbolizer_get_col_displacement_y (rl2PolygonSymbolizerPtr
					       symbolizer)
{
/* return the Polygon Symbolizer Table Column Name: displacement Y */
    rl2PrivPolygonSymbolizerPtr sym = (rl2PrivPolygonSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_displ_y;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_label (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer label name */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->label;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_label (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer table column name: label */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_label;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_font (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer table column name: font facename */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_font;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_style (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer table column name: font style */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_style;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_weight (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer table column name: font weight */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_weight;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_size (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer table column name: font size */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    return sym->col_size;
}

RL2_DECLARE int
rl2_text_symbolizer_get_font_families_count (rl2TextSymbolizerPtr symbolizer,
					     int *count)
{
/* return how many Font Families are defined (Text Symbolizer) */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
................................................................................
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return RL2_ERROR;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    *rotation = place->rotation;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_point_placement_col_anchor_point_x (rl2TextSymbolizerPtr
							    symbolizer)
{
/* return the Text Symbolizer PointPlacement table column name: Anchor Point X */
    rl2PrivPointPlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    return place->col_point_x;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_point_placement_col_anchor_point_y (rl2TextSymbolizerPtr
							    symbolizer)
{
/* return the Text Symbolizer PointPlacement table column name: Anchor Point Y */
    rl2PrivPointPlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    return place->col_point_y;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_point_placement_col_displacement_x (rl2TextSymbolizerPtr
							    symbolizer)
{
/* return the Text Symbolizer PointPlacement table column name: Displacement X */
    rl2PrivPointPlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    return place->col_displ_x;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_point_placement_col_displacement_y (rl2TextSymbolizerPtr
							    symbolizer)
{
/* return the Text Symbolizer PointPlacement table column name: Displacement Y */
    rl2PrivPointPlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    return place->col_displ_y;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_point_placement_col_rotation (rl2TextSymbolizerPtr
						      symbolizer)
{
/* return the Text Symbolizer PointPlacement table column name: Rotation  */
    rl2PrivPointPlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_POINT
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivPointPlacementPtr) (sym->label_placement);
    return place->col_rotation;
}

RL2_DECLARE int
    rl2_text_symbolizer_get_line_placement_perpendicular_offset
    (rl2TextSymbolizerPtr symbolizer, double *offset)
{
/* return the Text Symbolizer LinePlacement PerpendicularOffset */
    rl2PrivLinePlacementPtr place;
................................................................................
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_LINE
	|| sym->label_placement == NULL)
	return RL2_ERROR;
    place = (rl2PrivLinePlacementPtr) (sym->label_placement);
    *generalize_line = place->generalize_line;
    return RL2_OK;
}

RL2_DECLARE const char
    *rl2_text_symbolizer_get_line_placement_col_perpendicular_offset
    (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer LinePlacement Column Name: PerpendicularOffset */
    rl2PrivLinePlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_LINE
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivLinePlacementPtr) (sym->label_placement);
    return place->col_perpoff;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_line_placement_col_initial_gap (rl2TextSymbolizerPtr
							symbolizer)
{
/* return the Text Symbolizer LinePlacement Column Name: InitialGap */
    rl2PrivLinePlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_LINE
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivLinePlacementPtr) (sym->label_placement);
    return place->col_inigap;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_line_placement_col_gap (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer LinePlacement Column Name: Gap */
    rl2PrivLinePlacementPtr place;
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->label_placement_type != RL2_LABEL_PLACEMENT_LINE
	|| sym->label_placement == NULL)
	return NULL;
    place = (rl2PrivLinePlacementPtr) (sym->label_placement);
    return place->col_gap;
}

RL2_DECLARE int
rl2_text_symbolizer_has_halo (rl2TextSymbolizerPtr symbolizer, int *halo)
{
/* checks if a Text Symbolizer has an Halo */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->halo == NULL)
	return RL2_ERROR;
    *radius = sym->halo->radius;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_halo_col_radius (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer Halo Table Column Name: Radius */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->halo == NULL)
	return NULL;
    return sym->halo->col_radius;
}

RL2_DECLARE int
rl2_text_symbolizer_has_halo_fill (rl2TextSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Text Symbolizer Halo has a Fill */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym->halo->fill == NULL)
	return RL2_ERROR;
    *red = sym->halo->fill->red;
    *green = sym->halo->fill->green;
    *blue = sym->halo->fill->blue;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_halo_col_fill_color (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer Halo Table Column Name: Fill Colour */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->halo == NULL)
	return NULL;
    if (sym->halo->fill == NULL)
	return NULL;
    return sym->halo->fill->col_color;
}

RL2_DECLARE int
rl2_text_symbolizer_get_halo_fill_opacity (rl2TextSymbolizerPtr symbolizer,
					   double *opacity)
{
/* return the Text Symbolizer Halo Opacity */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->halo == NULL)
	return RL2_ERROR;
    if (sym->halo->fill == NULL)
	return RL2_ERROR;
    *opacity = sym->halo->fill->opacity;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_halo_col_fill_opacity (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer Table Column Name: Halo Opacity */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->halo == NULL)
	return NULL;
    if (sym->halo->fill == NULL)
	return NULL;
    return sym->halo->fill->col_opacity;
}

RL2_DECLARE int
rl2_text_symbolizer_has_fill (rl2TextSymbolizerPtr symbolizer, int *fill)
{
/* checks if a Text Symbolizer has a Fill */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
................................................................................
    if (sym->fill == NULL)
	return RL2_ERROR;
    *red = sym->fill->red;
    *green = sym->fill->green;
    *blue = sym->fill->blue;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_fill_color (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer Table Column Name: Fill Color */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    return sym->fill->col_color;
}

RL2_DECLARE int
rl2_text_symbolizer_get_fill_opacity (rl2TextSymbolizerPtr symbolizer,
				      double *opacity)
{
/* return the Text Symbolizer Fill Opacity */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->fill == NULL)
	return RL2_ERROR;
    *opacity = sym->fill->opacity;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_text_symbolizer_get_col_fill_opacity (rl2TextSymbolizerPtr symbolizer)
{
/* return the Text Symbolizer Table Column Name: Fill Opacity */
    rl2PrivTextSymbolizerPtr sym = (rl2PrivTextSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->fill == NULL)
	return NULL;
    return sym->fill->col_opacity;
}

RL2_DECLARE int
rl2_point_symbolizer_get_count (rl2PointSymbolizerPtr symbolizer, int *count)
{
/* return the Point Symbolizer items count */
    int cnt = 0;
    rl2PrivGraphicItemPtr item;
................................................................................
		return RL2_ERROR;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_graphic_href (rl2PointSymbolizerPtr symbolizer,
					   int index)
{
/* return the Point Symbolizer Table Column Name: External Graphic Href */
    int count = 0;
    rl2PrivExternalGraphicPtr ext;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_EXTERNAL_GRAPHIC && item->item != NULL)
		    ext = (rl2PrivExternalGraphicPtr) (item->item);
		else
		    return NULL;
		return ext->col_href;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_PRIVATE rl2PrivExternalGraphicPtr
rl2_point_symbolizer_get_external_graphic_ref (rl2PointSymbolizerPtr symbolizer,
					       int index)
{
/* return a pointer to an External Graphic object */
    int count = 0;
    rl2PrivExternalGraphicPtr ext;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_EXTERNAL_GRAPHIC && item->item != NULL)
		    ext = (rl2PrivExternalGraphicPtr) (item->item);
		else
		    return NULL;
		return ext;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_get_graphic_recode_count (rl2PointSymbolizerPtr
					       symbolizer, int index,
					       int *num_items)
{
/* return the Point Symbolizer Color Replacement Items Count */
    int count = 0;
    rl2PrivExternalGraphicPtr ext;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return RL2_ERROR;
    if (sym->graphic == NULL)
	return RL2_ERROR;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		int cnt = 0;
		rl2PrivColorReplacementPtr repl;
		if (item->type == RL2_EXTERNAL_GRAPHIC && item->item != NULL)
		    ext = (rl2PrivExternalGraphicPtr) (item->item);
		else
		    return RL2_ERROR;
		repl = ext->first;
		while (repl != NULL)
		  {
		      cnt++;
		      repl = repl->next;
		  }
		*num_items = cnt;
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_graphic_recode_color (rl2PointSymbolizerPtr
						   symbolizer, int index,
						   int repl_index,
						   int *color_index)
{
/* return the Point Symbolizer Table Column Name: Color Replacement */
    int count = 0;
    rl2PrivExternalGraphicPtr ext;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		int cnt = 0;
		rl2PrivColorReplacementPtr repl;
		if (item->type == RL2_EXTERNAL_GRAPHIC && item->item != NULL)
		    ext = (rl2PrivExternalGraphicPtr) (item->item);
		else
		    return NULL;
		repl = ext->first;
		while (repl != NULL)
		  {
		      if (cnt == repl_index)
			{
			    *color_index = repl->index;
			    return repl->col_color;
			}
		      cnt++;
		      repl = repl->next;
		  }
		return NULL;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_PRIVATE rl2PrivColorReplacementPtr
rl2_point_symbolizer_get_color_replacement_ref (rl2PointSymbolizerPtr
						symbolizer, int index,
						int repl_index,
						int *color_index)
{
/* return a pointer to a Color Replacement object */
    int count = 0;
    rl2PrivExternalGraphicPtr ext;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		int cnt = 0;
		rl2PrivColorReplacementPtr repl;
		if (item->type == RL2_EXTERNAL_GRAPHIC && item->item != NULL)
		    ext = (rl2PrivExternalGraphicPtr) (item->item);
		else
		    return NULL;
		repl = ext->first;
		while (repl != NULL)
		  {
		      if (cnt == repl_index)
			{
			    *color_index = repl->index;
			    return repl;
			}
		      cnt++;
		      repl = repl->next;
		  }
		return NULL;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_is_mark (rl2PointSymbolizerPtr symbolizer, int index,
			      int *mark)
{
/* checks if a Point Symbolizer item is a Mark */
    int count = 0;
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

RL2_PRIVATE rl2PrivMarkPtr
rl2_point_symbolizer_get_mark_ref (rl2PointSymbolizerPtr symbolizer, int index)
{
/* return a pointer to a Mark object */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		return mark;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_well_known_type (rl2PointSymbolizerPtr
						   symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: WellKnownType */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		return mark->col_mark_type;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_mark_has_stroke (rl2PointSymbolizerPtr symbolizer,
				      int index, int *stroke)
{
/* checks if a Point Symbolizer Mark has a Stroke */
    int count = 0;
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_color (rl2PointSymbolizerPtr
						symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke Color */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_color;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_width (rl2PointSymbolizerPtr
						symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke Width */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_width;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_mark_get_stroke_linejoin (rl2PointSymbolizerPtr
					       symbolizer, int index,
					       unsigned char *linejoin)
{
/* return the Point Symbolizer Mark Stroke Linejoin mode */
................................................................................
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_linejoin (rl2PointSymbolizerPtr
						   symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke LineJoin */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_join;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_linecap (rl2PointSymbolizerPtr
						  symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke LineCap */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_cap;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_mark_get_stroke_dash_count (rl2PointSymbolizerPtr
						 symbolizer, int index,
						 int *cnt)
{
/* return the Point Symbolizer Mark Stroke Dash count */
................................................................................
		return RL2_OK;
	    }
	  count++;
	  itm = itm->next;
      }
    return RL2_ERROR;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_dash_array (rl2PointSymbolizerPtr
						     symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke Dash Array */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_dash;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_stroke_dash_offset (rl2PointSymbolizerPtr
						      symbolizer, int index)
{
/* return the Point Symbolizer Mark Table Column Name: Stroke Dash Offset */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->stroke == NULL)
		    return NULL;
		return mark->stroke->col_dashoff;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE int
rl2_point_symbolizer_mark_has_fill (rl2PointSymbolizerPtr symbolizer,
				    int index, int *fill)
{
/* checks if a Point Symbolizer Mark has a Fill */
    int count = 0;
................................................................................
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return RL2_ERROR;
		if (mark->fill == NULL)
		    return RL2_ERROR;
		*red = mark->fill->red;
		*green = mark->fill->green;
		*blue = mark->fill->blue;
		return RL2_OK;
	    }
	  count++;
	  item = item->next;
................................................................................

RL2_DECLARE int
rl2_point_symbolizer_get_rotation (rl2PointSymbolizerPtr symbolizer,
				   double *rotation)
{
/* return a Point Symbolizer Rotation */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;

    if (sym == NULL)
	return RL2_ERROR;
    if (sym->graphic == NULL)
	return RL2_ERROR;
    *rotation = sym->graphic->rotation;

    return RL2_OK;
}

RL2_DECLARE int
rl2_point_symbolizer_get_anchor_point (rl2PointSymbolizerPtr symbolizer,
				       double *x, double *y)
{
................................................................................
	return RL2_ERROR;
    if (sym->graphic == NULL)
	return RL2_ERROR;
    *x = sym->graphic->displacement_x;
    *y = sym->graphic->displacement_y;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_point_symbolizer_mark_get_col_fill_color (rl2PointSymbolizerPtr symbolizer,
					      int index)
{
/* return the Point Symbolizer Mark Table Column Name: Fill Color */
    int count = 0;
    rl2PrivMarkPtr mark;
    rl2PrivGraphicItemPtr item;
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    item = sym->graphic->first;
    while (item != NULL)
      {
	  if (count == index)
	    {
		if (item->type == RL2_MARK_GRAPHIC && item->item != NULL)
		    mark = (rl2PrivMarkPtr) (item->item);
		else
		    return NULL;
		if (mark->fill == NULL)
		    return NULL;
		return mark->fill->col_color;
	    }
	  count++;
	  item = item->next;
      }
    return NULL;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_opacity (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Opacity */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_opacity;
    return RL2_OK;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_size (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Size */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_size;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_rotation (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Rotation */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_rotation;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_anchor_point_x (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Anchor Point X */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_point_x;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_anchor_point_y (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Anchor Point Y */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_point_y;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_displacement_x (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Displacement X */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_displ_x;
}

RL2_DECLARE const char *
rl2_point_symbolizer_get_col_displacement_y (rl2PointSymbolizerPtr symbolizer)
{
/* return a Point Symbolizer Table Column Name: Displacement Y */
    rl2PrivPointSymbolizerPtr sym = (rl2PrivPointSymbolizerPtr) symbolizer;
    if (sym == NULL)
	return NULL;
    if (sym->graphic == NULL)
	return NULL;
    return sym->graphic->col_displ_y;
}

RL2_PRIVATE void
rl2_destroy_color_replacement (rl2PrivColorReplacementPtr repl)
{
/* destroying a Color Replacement object */
    if (repl == NULL)
	return;
    if (repl->col_color != NULL)
	free (repl->col_color);
    free (repl);
}

RL2_PRIVATE void
rl2_destroy_external_graphic (rl2PrivExternalGraphicPtr ext)
{
/* destroying an External Graphic object */
    rl2PrivColorReplacementPtr repl;
    rl2PrivColorReplacementPtr replN;
    if (ext == NULL)
	return;
    if (ext->xlink_href != NULL)
	free (ext->xlink_href);
    if (ext->col_href != NULL)
	free (ext->col_href);
    repl = ext->first;
    while (repl != NULL)
      {
	  replN = repl->next;
	  rl2_destroy_color_replacement (repl);
	  repl = replN;
      }
................................................................................

RL2_PRIVATE void
rl2_destroy_mark (rl2PrivMarkPtr mark)
{
/* destroying a Mark object */
    if (mark == NULL)
	return;


    if (mark->stroke != NULL)
	rl2_destroy_stroke (mark->stroke);
    if (mark->fill != NULL)
	rl2_destroy_fill (mark->fill);
    if (mark->col_mark_type != NULL)
	free (mark->col_mark_type);
    free (mark);
}

RL2_PRIVATE void
rl2_destroy_graphic_item (rl2PrivGraphicItemPtr item)
{
/* destroying a Graphic Item object */
................................................................................
    item = graphic->first;
    while (item != NULL)
      {
	  itemN = item->next;
	  rl2_destroy_graphic_item (item);
	  item = itemN;
      }
    if (graphic->col_opacity != NULL)
	free (graphic->col_opacity);
    if (graphic->col_rotation != NULL)
	free (graphic->col_rotation);
    if (graphic->col_size != NULL)
	free (graphic->col_size);
    if (graphic->col_point_x != NULL)
	free (graphic->col_point_x);
    if (graphic->col_point_y != NULL)
	free (graphic->col_point_y);
    if (graphic->col_displ_x != NULL)
	free (graphic->col_displ_x);
    if (graphic->col_displ_y != NULL)
	free (graphic->col_displ_y);
    free (graphic);
}

RL2_PRIVATE void
rl2_destroy_stroke (rl2PrivStrokePtr stroke)
{
/* destroying a Stroke object */
    if (stroke == NULL)
	return;
    if (stroke->graphic != NULL)
	rl2_destroy_graphic (stroke->graphic);
    if (stroke->dash_list != NULL)
	free (stroke->dash_list);
    if (stroke->col_color != NULL)
	free (stroke->col_color);
    if (stroke->col_opacity != NULL)
	free (stroke->col_opacity);
    if (stroke->col_width != NULL)
	free (stroke->col_width);
    if (stroke->col_join != NULL)
	free (stroke->col_join);
    if (stroke->col_cap != NULL)
	free (stroke->col_cap);
    if (stroke->col_dash != NULL)
	free (stroke->col_dash);
    if (stroke->col_dashoff != NULL)
	free (stroke->col_dashoff);
    free (stroke);
}

RL2_PRIVATE void
rl2_destroy_fill (rl2PrivFillPtr fill)
{
/* destroying a Fill object */
    if (fill == NULL)
	return;
    if (fill->graphic != NULL)
	rl2_destroy_graphic (fill->graphic);
    if (fill->col_color != NULL)
	free (fill->col_color);
    if (fill->col_opacity != NULL)
	free (fill->col_opacity);
    free (fill);
}

RL2_PRIVATE void
rl2_destroy_point_symbolizer (rl2PrivPointSymbolizerPtr ptr)
{
/* destroying a Point Symbolizer */
................................................................................
rl2_destroy_line_symbolizer (rl2PrivLineSymbolizerPtr ptr)
{
/* destroying a Line Symbolizer */
    if (ptr == NULL)
	return;
    if (ptr->stroke != NULL)
	rl2_destroy_stroke (ptr->stroke);
    if (ptr->col_perpoff != NULL)
	free (ptr->col_perpoff);
    free (ptr);
}

RL2_PRIVATE void
rl2_destroy_polygon_symbolizer (rl2PrivPolygonSymbolizerPtr ptr)
{
/* destroying a Polygon Symbolizer */
    if (ptr == NULL)
	return;
    if (ptr->stroke != NULL)
	rl2_destroy_stroke (ptr->stroke);
    if (ptr->fill != NULL)
	rl2_destroy_fill (ptr->fill);
    if (ptr->col_displ_x != NULL)
	free (ptr->col_displ_x);
    if (ptr->col_displ_y != NULL)
	free (ptr->col_displ_y);
    if (ptr->col_perpoff != NULL)
	free (ptr->col_perpoff);
    free (ptr);
}

RL2_PRIVATE void
rl2_destroy_point_placement (rl2PrivPointPlacementPtr place)
{
/* destroying a PointPlacement object */
    if (place == NULL)
	return;
    if (place->col_point_x != NULL)
	free (place->col_point_x);
    if (place->col_point_y != NULL)
	free (place->col_point_y);
    if (place->col_displ_x != NULL)
	free (place->col_displ_x);
    if (place->col_displ_y != NULL)
	free (place->col_displ_y);
    if (place->col_rotation != NULL)
	free (place->col_rotation);
    free (place);
}

RL2_PRIVATE void
rl2_destroy_line_placement (rl2PrivLinePlacementPtr place)
{
/* destroying a LinePlacement object */
    if (place == NULL)
	return;
    if (place->col_perpoff != NULL)
	free (place->col_perpoff);
    if (place->col_inigap != NULL)
	free (place->col_inigap);
    if (place->col_gap != NULL)
	free (place->col_gap);
    free (place);
}

RL2_PRIVATE void
rl2_destroy_halo (rl2PrivHaloPtr halo)
{
/* destroying an Halo object */
    if (halo == NULL)
	return;
    if (halo->fill != NULL)
	rl2_destroy_fill (halo->fill);
    if (halo->col_radius != NULL)
	free (halo->col_radius);
    free (halo);
}

RL2_PRIVATE void
rl2_destroy_text_symbolizer (rl2PrivTextSymbolizerPtr ptr)
{
/* destroying a Text Symbolizer */
    int i;
    if (ptr == NULL)
	return;
    if (ptr->label != NULL)
	free (ptr->label);
    if (ptr->col_label != NULL)
	free (ptr->col_label);
    if (ptr->col_font != NULL)
	free (ptr->col_font);
    if (ptr->col_style != NULL)
	free (ptr->col_style);
    if (ptr->col_weight != NULL)
	free (ptr->col_weight);
    if (ptr->col_size != NULL)
	free (ptr->col_size);
    for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
      {
	  if (*(ptr->font_families + i) != NULL)
	      free (*(ptr->font_families + i));
      }
    if (ptr->label_placement_type == RL2_LABEL_PLACEMENT_POINT
	&& ptr->label_placement != NULL)

Changes to src/rl2symbolizer.c.

1236
1237
1238
1239
1240
1241
1242
























1243
1244
1245
1246
1247
1248
1249
....
1368
1369
1370
1371
1372
1373
1374















1375
1376
1377
1378
1379
1380
1381
1382
1383
1384

1385
1386
1387
1388
1389
1390
1391
....
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
....
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458














1459

1460
1461


1462
1463


1464
1465

1466
1467


1468
1469

1470



1471

1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
....
1534
1535
1536
1537
1538
1539
1540























1541
1542
1543
1544
1545
1546
1547
1548

1549

1550

1551
1552

1553
1554
























1555
1556



1557
1558
1559























1560
1561
1562
1563

1564
1565
1566
1567

1568
1569
1570
1571
1572

1573
1574
1575






















1576
1577
1578
1579

1580
1581
1582
1583

1584
1585
1586
1587
1588

1589
1590
1591






















1592
1593
1594
1595
1596
1597

1598
1599

1600
1601
1602
1603

1604
1605
1606
























1607
1608


1609
1610
1611
1612
1613
1614
1615
....
1672
1673
1674
1675
1676
1677
1678





















1679
1680
1681
1682
1683
1684
1685
1686
1687

1688


1689
1690
1691
1692
1693
1694
1695
....
1704
1705
1706
1707
1708
1709
1710

1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723












1724
1725
1726
1727
1728
1729
1730
....
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
....
1813
1814
1815
1816
1817
1818
1819






















1820
1821
1822
1823
1824
1825
1826
1827

1828

1829

1830
1831

1832
1833
























1834
1835



1836
1837























1838
1839



1840
1841
1842






















1843
1844
1845
1846

1847
1848
1849
1850

1851
1852
1853
1854
1855

1856
1857
1858






















1859
1860
1861
1862

1863
1864
1865
1866

1867
1868
1869
1870
1871

1872
1873
1874





















1875
1876
1877
1878
1879
1880

1881
1882

1883
1884
1885
1886

1887
1888
1889























1890
1891


1892
1893
1894
1895
1896
1897
1898
....
1911
1912
1913
1914
1915
1916
1917

















1918
1919



1920
1921
1922
1923
1924
1925
1926
....
2012
2013
2014
2015
2016
2017
2018






















2019
2020
2021
2022
2023
2024
2025
2026

2027

2028

2029
2030

2031
2032
























2033
2034



2035
2036























2037
2038



2039
2040
2041






















2042
2043
2044
2045

2046
2047
2048
2049

2050
2051
2052
2053
2054

2055
2056
2057






















2058
2059
2060
2061

2062
2063
2064
2065

2066
2067
2068
2069
2070

2071
2072
2073





















2074
2075
2076
2077
2078
2079

2080
2081

2082
2083
2084
2085

2086
2087
2088























2089
2090


2091
2092
2093
2094
2095
2096
2097
....
2154
2155
2156
2157
2158
2159
2160





















2161
2162
2163
2164
2165
2166
2167
2168
2169

2170

2171
2172

2173
2174























2175
2176


2177
2178
2179
2180
2181
2182
2183
....
2196
2197
2198
2199
2200
2201
2202

















2203
2204



2205
2206
2207
2208
2209
2210
2211
....
2222
2223
2224
2225
2226
2227
2228
2229


2230

















2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241


2242

















2243
2244
2245
2246
2247
2248
2249
....
2310
2311
2312
2313
2314
2315
2316
2317


2318



















2319
2320
2321
2322
2323
2324
2325
....
2336
2337
2338
2339
2340
2341
2342
2343


2344

















2345
2346
2347
2348
2349
2350
2351
....
2362
2363
2364
2365
2366
2367
2368
2369


2370




















2371
2372
2373
2374
2375
2376
2377
....
2388
2389
2390
2391
2392
2393
2394
2395


2396



















2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407


2408



















2409
2410
2411
2412
2413
2414
2415
....
2442
2443
2444
2445
2446
2447
2448
2449


2450



















2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461


2462



















2463
2464
2465
2466
2467
2468
2469
....
2560
2561
2562
2563
2564
2565
2566














2567
2568
2569
2570
2571
2572
2573
....
2620
2621
2622
2623
2624
2625
2626



















2627
2628
2629
2630
2631
2632

2633
2634

2635
2636
2637

2638
2639
2640

2641
2642
2643



















2644

2645
2646
2647
2648

2649
2650
2651
2652

2653
2654
2655
2656

2657
2658
2659




















2660

2661
2662
2663
2664

2665
2666
2667
2668

2669





















2670


2671
2672
2673
2674
2675
2676
2677
....
2690
2691
2692
2693
2694
2695
2696




















2697
2698



2699
2700
2701
2702
2703
2704
2705
2706
2707
2708




















2709
2710



2711
2712
2713
2714
2715
2716
2717
....
2744
2745
2746
2747
2748
2749
2750




















2751
2752



2753
2754
2755
2756
2757
2758
2759
2760
2761
2762




















2763
2764



2765
2766
2767
2768
2769
2770
2771
....
2798
2799
2800
2801
2802
2803
2804




















2805
2806



2807
2808
2809
2810
2811
2812
2813
....
2834
2835
2836
2837
2838
2839
2840




















2841
2842



2843
2844
2845
2846
2847
2848
2849
....
2860
2861
2862
2863
2864
2865
2866




















2867
2868



2869
2870
2871
2872
2873
2874
2875
....
2886
2887
2888
2889
2890
2891
2892




















2893
2894



2895
2896
2897
2898
2899
2900
2901
....
3116
3117
3118
3119
3120
3121
3122





















3123
3124
3125
3126
3127
3128
3129
3130
3131

3132
































3133
3134
3135
3136
3137
3138
3139
....
3177
3178
3179
3180
3181
3182
3183




























3184
3185

3186
3187
3188
3189
3190
3191
3192
....
3207
3208
3209
3210
3211
3212
3213



3214
3215
3216
3217
3218
3219
3220
....
3230
3231
3232
3233
3234
3235
3236





















3237
3238
3239
3240
3241
3242
3243
3244
3245

3246































3247
3248
3249
3250
3251
3252
3253
....
3973
3974
3975
3976
3977
3978
3979







































































































































































































































































































































































































































































3980
3981
3982
3983
3984
3985
3986
....
3988
3989
3990
3991
3992
3993
3994



3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012












4013
4014
4015







4016
4017
4018
4019
4020
4021
4022
....
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036












4037
4038
4039







4040
4041
4042
4043
4044
4045
4046
....
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072




4073
4074
4075
4076
4077
4078
4079
4080

4081













4082
4083
4084
4085
4086
4087
4088
....
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108




4109
4110
4111
4112
4113
4114
4115
4116

4117













4118
4119
4120
4121
4122
4123
4124
		child = child->next;
	    }
      }
    return 0;
}

static int
























parse_sld_se_stroke_dasharray (const char *value, int *count, double **list)
{
/* parsing a Stroke Dasharray */
    const char *in = value;
    const char *start;
    const char *end;
    double dblarray[128];
................................................................................
	    {
		child = node->children;
		while (child)
		  {
		      if (child->type == XML_TEXT_NODE
			  && child->content != NULL)
			{















			    unsigned char red;
			    unsigned char green;
			    unsigned char blue;
			    if (parse_sld_se_color
				((const char *) (child->content), &red,
				 &green, &blue))
			      {
				  repl->red = red;
				  repl->green = green;
				  repl->blue = blue;

			      }
			    ok_value = 1;
			}
		      child = child->next;
		  }
	    }
	  node = node->next;
................................................................................
			}
		  }
	    }
	  node = node->next;
      }
}

static int
parse_mark_well_known_type (xmlNodePtr node)
{
/* parsing Mark WellKnownName */
    while (node)
      {
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
................................................................................
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {

				  const char *type =
				      (const char *) (child->content);














				  if (strcasecmp (type, "square") == 0)

				      return RL2_GRAPHIC_MARK_SQUARE;
				  if (strcasecmp (type, "circle") == 0)


				      return RL2_GRAPHIC_MARK_CIRCLE;
				  if (strcasecmp (type, "triangle") == 0)


				      return RL2_GRAPHIC_MARK_TRIANGLE;
				  if (strcasecmp (type, "star") == 0)

				      return RL2_GRAPHIC_MARK_STAR;
				  if (strcasecmp (type, "cross") == 0)


				      return RL2_GRAPHIC_MARK_CROSS;
				  if (strcasecmp (type, "x") == 0)

				      return RL2_GRAPHIC_MARK_X;



			      }

			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
    return RL2_GRAPHIC_MARK_UNKNOWN;
}

static void
parse_mark_stroke (xmlNodePtr node, rl2PrivMarkPtr mark)
{
/* parsing Mark Stroke */
    while (node)
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {























					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    mark->stroke->red = red;

						    mark->stroke->green = green;

						    mark->stroke->blue = blue;

						}
					  }

					if (strcmp (svg_name, "stroke-width")
					    == 0)
























					    mark->stroke->width =
						atof ((const char *) svg_value);



					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {























					      if (strcmp (svg_value, "mitre")
						  == 0)
						  mark->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_MITRE;

					      if (strcmp (svg_value, "round")
						  == 0)
						  mark->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_ROUND;

					      if (strcmp (svg_value, "bevel")
						  == 0)
						  mark->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_BEVEL;
					  }

					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {






















					      if (strcmp (svg_value, "butt")
						  == 0)
						  mark->stroke->linecap =
						      RL2_STROKE_LINECAP_BUTT;

					      if (strcmp (svg_value, "round")
						  == 0)
						  mark->stroke->linecap =
						      RL2_STROKE_LINECAP_ROUND;

					      if (strcmp (svg_value, "square")
						  == 0)
						  mark->stroke->linecap =
						      RL2_STROKE_LINECAP_SQUARE;
					  }

					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {






















					      int dash_count;
					      double *dash_list = NULL;
					      if (parse_sld_se_stroke_dasharray
						  (svg_value, &dash_count,
						   &dash_list))
						{

						    mark->stroke->dash_count =
							dash_count;

						    mark->stroke->dash_list =
							dash_list;
						}
					  }

					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)
























					    mark->stroke->dash_offset =
						atof ((const char *) svg_value);


				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {





















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    mark->fill->red = red;
						    mark->fill->green = green;

						    mark->fill->blue = blue;


						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
/* parsing Graphic */
    while (node)
      {
	  const char *name = (const char *) (node->name);
	  if (strcmp (name, "ExternalGraphic") == 0)
	    {
		xmlNodePtr child = node->children;

		rl2PrivExternalGraphicPtr ext;
		rl2PrivGraphicItemPtr item =
		    rl2_create_default_external_graphic ();
		if (item == NULL)
		    return;
		ext = (rl2PrivExternalGraphicPtr) (item->item);
		ext->xlink_href =
		    parse_graphic_online_resource (node->children);
		if (ext->xlink_href == NULL)
		  {
		      rl2_destroy_graphic_item (item);
		      return;
		  }












		while (child)
		  {
		      name = (const char *) (child->name);
		      if (strcmp (name, "ColorReplacement") == 0)
			  parse_graphic_color_replacement (child->children,
							   ext);
		      child = child->next;
................................................................................
	  if (strcmp (name, "Mark") == 0)
	    {
		rl2PrivMarkPtr mark;
		rl2PrivGraphicItemPtr item = rl2_create_default_mark ();
		if (item == NULL)
		    return;
		mark = (rl2PrivMarkPtr) (item->item);
		mark->well_known_type =
		    parse_mark_well_known_type (node->children);
		parse_mark_fill (node->children, mark);
		parse_mark_stroke (node->children, mark);
		if (graphic->first == NULL)
		    graphic->first = item;
		if (graphic->last != NULL)
		    graphic->last->next = item;
		graphic->last = item;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {






















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    sym->stroke->red = red;

						    sym->stroke->green = green;

						    sym->stroke->blue = blue;

						}
					  }

					if (strcmp
					    (svg_name, "stroke-opacity") == 0)
























					    sym->stroke->opacity =
						atof ((const char *) svg_value);



					if (strcmp (svg_name, "stroke-width")
					    == 0)























					    sym->stroke->width =
						atof ((const char *) svg_value);



					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {






















					      if (strcmp (svg_value, "mitre")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_MITRE;

					      if (strcmp (svg_value, "round")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_ROUND;

					      if (strcmp (svg_value, "bevel")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_BEVEL;
					  }

					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {






















					      if (strcmp (svg_value, "butt")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_BUTT;

					      if (strcmp (svg_value, "round")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_ROUND;

					      if (strcmp (svg_value, "square")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_SQUARE;
					  }

					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {





















					      int dash_count;
					      double *dash_list = NULL;
					      if (parse_sld_se_stroke_dasharray
						  (svg_value, &dash_count,
						   &dash_list))
						{

						    sym->stroke->dash_count =
							dash_count;

						    sym->stroke->dash_list =
							dash_list;
						}
					  }

					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)























					    sym->stroke->dash_offset =
						atof ((const char *) svg_value);


				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

















				sym->perpendicular_offset =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {






















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    sym->stroke->red = red;

						    sym->stroke->green = green;

						    sym->stroke->blue = blue;

						}
					  }

					if (strcmp
					    (svg_name, "stroke-opacity") == 0)
























					    sym->stroke->opacity =
						atof ((const char *) svg_value);



					if (strcmp (svg_name, "stroke-width")
					    == 0)























					    sym->stroke->width =
						atof ((const char *) svg_value);



					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {






















					      if (strcmp (svg_value, "mitre")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_MITRE;

					      if (strcmp (svg_value, "round")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_ROUND;

					      if (strcmp (svg_value, "bevel")
						  == 0)
						  sym->stroke->linejoin =
						      RL2_STROKE_LINEJOIN_BEVEL;
					  }

					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {






















					      if (strcmp (svg_value, "butt")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_BUTT;

					      if (strcmp (svg_value, "round")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_ROUND;

					      if (strcmp (svg_value, "square")
						  == 0)
						  sym->stroke->linecap =
						      RL2_STROKE_LINECAP_SQUARE;
					  }

					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {





















					      int dash_count;
					      double *dash_list = NULL;
					      if (parse_sld_se_stroke_dasharray
						  (svg_value, &dash_count,
						   &dash_list))
						{

						    sym->stroke->dash_count =
							dash_count;

						    sym->stroke->dash_list =
							dash_list;
						}
					  }

					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)























					    sym->stroke->dash_offset =
						atof ((const char *) svg_value);


				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {





















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    sym->fill->red = red;
						    sym->fill->green = green;

						    sym->fill->blue = blue;

						}
					  }

					if (strcmp (svg_name, "fill-opacity")
					    == 0)























					    sym->fill->opacity =
						atof (svg_value);


				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

















				sym->perpendicular_offset =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				sym->displacement_x =


				    atof ((const char *) child->content);

















			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				sym->displacement_y =


				    atof ((const char *) child->content);

















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Opacity") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->opacity =


				    atof ((const char *) child->content);



















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Size") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->size =


				    atof ((const char *) child->content);

















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Rotation") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->rotation =


				    atof ((const char *) child->content);




















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "AnchorPointX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->anchor_point_x =


				    atof ((const char *) child->content);



















			    child = child->next;
			}
		  }
		if (strcmp (name, "AnchorPointY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->anchor_point_y =


				    atof ((const char *) child->content);



















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->displacement_x =


				    atof ((const char *) child->content);



















			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
				graphic->displacement_y =


				    atof ((const char *) child->content);



















			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
				&& child->content != NULL)
			      {
				  int len;
				  const char *label =
				      (const char *) (child->content);
				  if (text->label != NULL)
				      free (text->label);














				  if (label == NULL)
				    {
					text->label = NULL;
					return;
				    }
				  len = strlen (label);
				  text->label = malloc (len + 1);
................................................................................
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "font-family")
					    == 0)
					  {



















					      if (sym->font_families_count <
						  RL2_MAX_FONT_FAMILIES)
						{
						    int idx =
							sym->font_families_count++;
						    int len =

							strlen (svg_value);
						    *(sym->font_families +

						      idx) = malloc (len + 1);
						    strcpy (*
							    (sym->font_families

							     + idx), svg_value);
						}
					  }

					if (strcmp (svg_name, "font-style") ==
					    0)
					  {



















					      if (strcasecmp

						  (svg_value, "normal") == 0)
						  sym->font_style =
						      RL2_FONT_STYLE_NORMAL;
					      if (strcasecmp

						  (svg_value, "italic") == 0)
						  sym->font_style =
						      RL2_FONT_STYLE_ITALIC;
					      if (strcasecmp

						  (svg_value, "oblique") == 0)
						  sym->font_style =
						      RL2_FONT_STYLE_OBLIQUE;
					  }

					if (strcmp (svg_name, "font-weight")
					    == 0)
					  {




















					      if (strcasecmp

						  (svg_value, "normal") == 0)
						  sym->font_weight =
						      RL2_FONT_WEIGHT_NORMAL;
					      if (strcasecmp

						  (svg_value, "bold") == 0)
						  sym->font_weight =
						      RL2_FONT_WEIGHT_BOLD;
					  }

					if (strcmp (svg_name, "font-size") == 0)





















					    sym->font_size = atof (svg_value);


				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "AnchorPointX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->anchor_point_x =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
		if (strcmp (name, "AnchorPointY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->anchor_point_y =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->displacement_x =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->displacement_y =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Rotation") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->rotation =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->perpendicular_offset =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "InitialGap") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->initial_gap =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Gap") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)




















				place->gap =
				    atof ((const char *) child->content);



			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {





















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    halo->fill->red = red;
						    halo->fill->green = green;

						    halo->fill->blue = blue;
































						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
						  && grandchild->content !=
						  NULL)
						{
						    const char *radius =
							(const char
							 *)
							(grandchild->content);




























						    sym->halo->radius =
							atof (radius);

						}
					      grandchild = grandchild->next;
					  }
				    }
				  if (strcmp (name, "Fill") == 0)
				      parse_halo_fill (child, sym->halo);
			      }
................................................................................
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
		if (strcmp (name, "Fill") == 0)
		  {
		      xmlNodePtr child = node->children;
		      sym->fill = rl2_create_default_fill ();



		      sym->fill->red = 0;
		      sym->fill->green = 0;
		      sym->fill->blue = 0;
		      sym->fill->opacity = 1.0;
		      if (sym->fill == NULL)
			  return;
		      while (child)
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {





















					      unsigned char red;
					      unsigned char green;
					      unsigned char blue;
					      if (parse_sld_se_color
						  (svg_value, &red, &green,
						   &blue))
						{
						    sym->fill->red = red;
						    sym->fill->green = green;

						    sym->fill->blue = blue;































						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
		      return ret;
		  }
	    }
	  node = node->next;
      }
    return 0;
}








































































































































































































































































































































































































































































static void
build_column_names_array (rl2PrivFeatureTypeStylePtr style)
{
/* building the column names array - Feature Type Style */
    char **strings;
    char *dupl;
................................................................................
    int count = 0;
    int count2 = 0;
    int i;
    int j;
    rl2PrivStyleRulePtr pR;
    rl2PrivVectorSymbolizerPtr pV;
    rl2PrivVectorSymbolizerItemPtr item;



    rl2PrivTextSymbolizerPtr text;

    pR = style->first_rule;
    while (pR != NULL)
      {
	  /* counting max column names */
	  if (pR->column_name != NULL)
	      count++;
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text =












				(rl2PrivTextSymbolizerPtr) (item->symbolizer);
			    if (text->label != NULL)
				count++;







			}
		      item = item->next;
		  }
	    }
	  pR = pR->next;
      }
    pR = style->else_rule;
................................................................................
	      count++;
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text =












				(rl2PrivTextSymbolizerPtr) (item->symbolizer);
			    if (text->label != NULL)
				count++;







			}
		      item = item->next;
		  }
	    }
      }
    if (count == 0)
	return;
................................................................................
	    }
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text =




				(rl2PrivTextSymbolizerPtr) (item->symbolizer);
			    if (text->label != NULL)
			      {
				  len = strlen (text->label);
				  *(strings + i) = malloc (len + 1);
				  strcpy (*(strings + i), text->label);
				  *(dupl + i) = 'N';
				  i++;

			      }













			}
		      item = item->next;
		  }
	    }
	  pR = pR->next;
      }
    pR = style->else_rule;
................................................................................
	    }
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text =




				(rl2PrivTextSymbolizerPtr) (item->symbolizer);
			    if (text->label != NULL)
			      {
				  len = strlen (text->label);
				  *(strings + i) = malloc (len + 1);
				  strcpy (*(strings + i), text->label);
				  *(dupl + i) = 'N';
				  i++;

			      }













			}
		      item = item->next;
		  }
	    }
      }

    for (i = 0; i < count; i++)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
<
|
|
|
|
|
>







 







|
|







 







<


>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
|
>
>
|
|
>
>
|
|
>
|
|
>
>
|
|
>
|
>
>
>
|
>






<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
>
|
>
|
>
|
|
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
<
<
|
>
|
|
>
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
>
|
>
>







 







>






<
|
|




>
>
>
>
>
>
>
>
>
>
>
>







 







<
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
>
|
>
|
>
|
|
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
<
<
|
>
|
|
>
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
>
|
>
|
>
|
|
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
<
<
|
>
|
|
>
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
>
|
>
|
|
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>










<
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
>
|
|
>
|
|
|
>
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
|
|
|
>
|
|
|
|
>
|
|
|
|
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
|
|
|
>
|
|
|
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>







 







>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
|













|


|
>
>
>
>
>
>
>
>
>
>
>
>
|
<
|
>
>
>
>
>
>
>







 







|


|
>
>
>
>
>
>
>
>
>
>
>
>
|
<
|
>
>
>
>
>
>
>







 







|


|
>
>
>
>
|
<
|
<
<
<
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|


|
>
>
>
>
|
<
|
<
<
<
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>







1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
....
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417

1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
....
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
....
1488
1489
1490
1491
1492
1493
1494

1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542

1543
1544
1545
1546
1547
1548
1549
....
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785


1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
....
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
....
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959

1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
....
1992
1993
1994
1995
1996
1997
1998

1999
2000
2001
2002
2003
2004
2005
2006
....
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280


2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
....
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364

2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
....
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674


2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
....
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
....
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893

2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
....
2914
2915
2916
2917
2918
2919
2920

2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950

2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
....
3038
3039
3040
3041
3042
3043
3044

3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
....
3084
3085
3086
3087
3088
3089
3090

3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
....
3128
3129
3130
3131
3132
3133
3134

3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
....
3175
3176
3177
3178
3179
3180
3181

3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213

3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
....
3269
3270
3271
3272
3273
3274
3275

3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307

3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
....
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
....
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
....
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
....
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
....
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
....
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
....
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
....
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
....
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
....
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
....
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
....
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
....
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
....
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779

5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
....
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821

5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
....
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867

5868



5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
....
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917

5918



5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
		child = child->next;
	    }
      }
    return 0;
}

static int
is_table_column (const char *name)
{
/* 
 * testing for a special table column name
 * 
 * expected to be declared as:
 *     @colname@ or
 *     $colname$
 * 
*/
    int len;
    if (name == NULL)
	return 0;
    len = strlen (name);
    if (len < 3)
	return 0;
    if (*(name + 0) == '@' && *(name + len - 1) == '@')
	return 1;
    if (*(name + 0) == '$' && *(name + len - 1) == '$')
	return 1;
    return 0;
}

RL2_PRIVATE int
parse_sld_se_stroke_dasharray (const char *value, int *count, double **list)
{
/* parsing a Stroke Dasharray */
    const char *in = value;
    const char *start;
    const char *end;
    double dblarray[128];
................................................................................
	    {
		child = node->children;
		while (child)
		  {
		      if (child->type == XML_TEXT_NODE
			  && child->content != NULL)
			{
			    const char *value = (const char *) (child->content);
			    if (repl->col_color != NULL)
				free (repl->col_color);
			    repl->col_color = NULL;
			    if (is_table_column (value))
			      {
				  /* table column name instead of value */
				  int len = strlen (value) - 1;
				  repl->col_color = malloc (len + 1);
				  strcpy (repl->col_color, value + 1);
				  len = strlen (repl->col_color);
				  *(repl->col_color + len - 1) = '\0';
			      }
			    else
			      {
				  unsigned char red;
				  unsigned char green;
				  unsigned char blue;
				  if (parse_sld_se_color

				      (value, &red, &green, &blue))
				    {
					repl->red = red;
					repl->green = green;
					repl->blue = blue;
				    }
			      }
			    ok_value = 1;
			}
		      child = child->next;
		  }
	    }
	  node = node->next;
................................................................................
			}
		  }
	    }
	  node = node->next;
      }
}

static void
parse_mark_well_known_type (xmlNodePtr node, rl2PrivMarkPtr mark)
{
/* parsing Mark WellKnownName */
    while (node)
      {
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
................................................................................
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {

				  const char *type =
				      (const char *) (child->content);
				  if (mark->col_mark_type != NULL)
				      free (mark->col_mark_type);
				  mark->col_mark_type = NULL;
				  if (is_table_column (type))
				    {
					/* table column name instead of value */
					int len = strlen (type) - 1;
					mark->col_mark_type = malloc (len + 1);
					strcpy (mark->col_mark_type, type + 1);
					len = strlen (mark->col_mark_type);
					*(mark->col_mark_type + len - 1) = '\0';
				    }
				  else
				    {
					if (strcasecmp (type, "square") == 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_SQUARE;
					else if (strcasecmp (type, "circle") ==
						 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_CIRCLE;
					else if (strcasecmp (type, "triangle")
						 == 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_TRIANGLE;
					else if (strcasecmp (type, "star") == 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_STAR;
					else if (strcasecmp (type, "cross") ==
						 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_CROSS;
					else if (strcasecmp (type, "x") == 0)
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_X;
					else
					    mark->well_known_type =
						RL2_GRAPHIC_MARK_UNKNOWN;
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }

}

static void
parse_mark_stroke (xmlNodePtr node, rl2PrivMarkPtr mark)
{
/* parsing Mark Stroke */
    while (node)
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {
					      if (mark->stroke->col_color !=
						  NULL)
						  free (mark->
							stroke->col_color);
					      mark->stroke->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_color =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_color,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_color);
						    *(mark->stroke->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  mark->stroke->red =
							      red;
							  mark->stroke->green =
							      green;
							  mark->stroke->blue =
							      blue;
						      }
						}
					  }
					if (strcmp (svg_name, "stroke-width")
					    == 0)
					  {
					      if (mark->stroke->col_width !=
						  NULL)
						  free (mark->
							stroke->col_width);
					      mark->stroke->col_width = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_width =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_width,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_width);
						    *(mark->stroke->col_width +
						      len - 1) = '\0';
						}
					      else
						{
						    mark->stroke->width =
							atof ((const char *)
							      svg_value);
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {
					      if (mark->stroke->col_join !=
						  NULL)
						  free (mark->stroke->col_join);
					      mark->stroke->col_join = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_join =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_join,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_join);
						    *(mark->stroke->col_join +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "mitre") == 0)
							mark->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_MITRE;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							mark->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_ROUND;
						    if (strcmp
							(svg_value,
							 "bevel") == 0)
							mark->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_BEVEL;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {
					      if (mark->stroke->col_cap != NULL)
						  free (mark->stroke->col_cap);
					      mark->stroke->col_cap = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_cap =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_cap,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_cap);
						    *(mark->stroke->col_cap +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "butt") == 0)
							mark->stroke->linecap =
							    RL2_STROKE_LINECAP_BUTT;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							mark->stroke->linecap =
							    RL2_STROKE_LINECAP_ROUND;
						    if (strcmp
							(svg_value,
							 "square") == 0)
							mark->stroke->linecap =
							    RL2_STROKE_LINECAP_SQUARE;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {
					      if (mark->stroke->col_dash !=
						  NULL)
						  free (mark->stroke->col_dash);
					      mark->stroke->col_dash = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_dash =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_dash,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_dash);
						    *(mark->stroke->col_dash +
						      len - 1) = '\0';
						}
					      else
						{
						    int dash_count;
						    double *dash_list = NULL;
						    if (parse_sld_se_stroke_dasharray (svg_value, &dash_count, &dash_list))


						      {
							  mark->
							      stroke->dash_count
							      = dash_count;
							  mark->
							      stroke->dash_list
							      = dash_list;
						      }
						}
					  }
					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)
					  {
					      if (mark->stroke->col_dashoff !=
						  NULL)
						  free (mark->
							stroke->col_dashoff);
					      mark->stroke->col_dashoff = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->stroke->col_dashoff =
							malloc (len + 1);
						    strcpy (mark->
							    stroke->col_dashoff,
							    svg_value + 1);
						    len =
							strlen (mark->
								stroke->col_dashoff);
						    *(mark->
						      stroke->col_dashoff +
						      len - 1) = '\0';
						}
					      else
						  mark->stroke->dash_offset =
						      atof ((const char *)
							    svg_value);
					  }
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {
					      if (mark->fill->col_color != NULL)
						  free (mark->fill->col_color);
					      mark->fill->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    mark->fill->col_color =
							malloc (len + 1);
						    strcpy (mark->
							    fill->col_color,
							    svg_value + 1);
						    len =
							strlen (mark->
								fill->col_color);
						    *(mark->fill->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  mark->fill->red = red;
							  mark->fill->green =
							      green;
							  mark->fill->blue =
							      blue;
						      }
						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
/* parsing Graphic */
    while (node)
      {
	  const char *name = (const char *) (node->name);
	  if (strcmp (name, "ExternalGraphic") == 0)
	    {
		xmlNodePtr child = node->children;
		char *href;
		rl2PrivExternalGraphicPtr ext;
		rl2PrivGraphicItemPtr item =
		    rl2_create_default_external_graphic ();
		if (item == NULL)
		    return;
		ext = (rl2PrivExternalGraphicPtr) (item->item);

		href = parse_graphic_online_resource (node->children);
		if (href == NULL)
		  {
		      rl2_destroy_graphic_item (item);
		      return;
		  }
		if (is_table_column (href))
		  {
		      /* table column name instead of value */
		      int len = strlen (href) - 1;
		      ext->col_href = malloc (len + 1);
		      strcpy (ext->col_href, href + 1);
		      len = strlen (ext->col_href);
		      *(ext->col_href + len - 1) = '\0';
		      free (href);
		  }
		else
		    ext->xlink_href = href;
		while (child)
		  {
		      name = (const char *) (child->name);
		      if (strcmp (name, "ColorReplacement") == 0)
			  parse_graphic_color_replacement (child->children,
							   ext);
		      child = child->next;
................................................................................
	  if (strcmp (name, "Mark") == 0)
	    {
		rl2PrivMarkPtr mark;
		rl2PrivGraphicItemPtr item = rl2_create_default_mark ();
		if (item == NULL)
		    return;
		mark = (rl2PrivMarkPtr) (item->item);

		parse_mark_well_known_type (node->children, mark);
		parse_mark_fill (node->children, mark);
		parse_mark_stroke (node->children, mark);
		if (graphic->first == NULL)
		    graphic->first = item;
		if (graphic->last != NULL)
		    graphic->last->next = item;
		graphic->last = item;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {
					      if (sym->stroke->col_color !=
						  NULL)
						  free (sym->stroke->col_color);
					      sym->stroke->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_color =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_color,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_color);
						    *(sym->stroke->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  sym->stroke->red =
							      red;
							  sym->stroke->green =
							      green;
							  sym->stroke->blue =
							      blue;
						      }
						}
					  }
					if (strcmp
					    (svg_name, "stroke-opacity") == 0)
					  {
					      if (sym->stroke->col_opacity !=
						  NULL)
						  free (sym->
							stroke->col_opacity);
					      sym->stroke->col_opacity = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_opacity =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_opacity,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_opacity);
						    *(sym->stroke->col_opacity +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->stroke->opacity =
							atof ((const char *)
							      svg_value);
						}
					  }
					if (strcmp (svg_name, "stroke-width")
					    == 0)
					  {
					      if (sym->stroke->col_width !=
						  NULL)
						  free (sym->stroke->col_width);
					      sym->stroke->col_width = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_width =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_width,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_width);
						    *(sym->stroke->col_width +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->stroke->width =
							atof ((const char *)
							      svg_value);
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {
					      if (sym->stroke->col_join != NULL)
						  free (sym->stroke->col_join);
					      sym->stroke->col_join = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_join =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_join,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_join);
						    *(sym->stroke->col_join +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "mitre") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_MITRE;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_ROUND;
						    if (strcmp
							(svg_value,
							 "bevel") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_BEVEL;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {
					      if (sym->stroke->col_cap != NULL)
						  free (sym->stroke->col_cap);
					      sym->stroke->col_cap = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_cap =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_cap,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_cap);
						    *(sym->stroke->col_cap +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "butt") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_BUTT;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_ROUND;
						    if (strcmp
							(svg_value,
							 "square") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_SQUARE;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {
					      if (sym->stroke->col_dash != NULL)
						  free (sym->stroke->col_dash);
					      sym->stroke->col_dash = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_dash =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_dash,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_dash);
						    *(sym->stroke->col_dash +
						      len - 1) = '\0';
						}
					      else
						{
						    int dash_count;
						    double *dash_list = NULL;
						    if (parse_sld_se_stroke_dasharray (svg_value, &dash_count, &dash_list))


						      {
							  sym->
							      stroke->dash_count
							      = dash_count;
							  sym->
							      stroke->dash_list
							      = dash_list;
						      }
						}
					  }
					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)
					  {
					      if (sym->stroke->col_dashoff !=
						  NULL)
						  free (sym->
							stroke->col_dashoff);
					      sym->stroke->col_dashoff = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_dashoff =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_dashoff,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_dashoff);
						    *(sym->stroke->col_dashoff +
						      len - 1) = '\0';
						}
					      else
						  sym->stroke->dash_offset =
						      atof ((const char *)
							    svg_value);
					  }
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  const char *value =
				      (const char *) child->content;
				  if (sym->col_perpoff != NULL)
				      free (sym->col_perpoff);
				  sym->col_perpoff = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					sym->col_perpoff = malloc (len + 1);
					strcpy (sym->col_perpoff, value + 1);
					len = strlen (sym->col_perpoff);
					*(sym->col_perpoff + len - 1) = '\0';
				    }
				  else
				    {
					sym->perpendicular_offset =

					    atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "stroke") == 0)
					  {
					      if (sym->stroke->col_color !=
						  NULL)
						  free (sym->stroke->col_color);
					      sym->stroke->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_color =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_color,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_color);
						    *(sym->stroke->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  sym->stroke->red =
							      red;
							  sym->stroke->green =
							      green;
							  sym->stroke->blue =
							      blue;
						      }
						}
					  }
					if (strcmp
					    (svg_name, "stroke-opacity") == 0)
					  {
					      if (sym->stroke->col_opacity !=
						  NULL)
						  free (sym->
							stroke->col_opacity);
					      sym->stroke->col_opacity = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_opacity =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_opacity,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_opacity);
						    *(sym->stroke->col_opacity +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->stroke->opacity =
							atof ((const char *)
							      svg_value);
						}
					  }
					if (strcmp (svg_name, "stroke-width")
					    == 0)
					  {
					      if (sym->stroke->col_width !=
						  NULL)
						  free (sym->stroke->col_width);
					      sym->stroke->col_width = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_width =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_width,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_width);
						    *(sym->stroke->col_width +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->stroke->width =
							atof ((const char *)
							      svg_value);
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linejoin") == 0)
					  {
					      if (sym->stroke->col_join != NULL)
						  free (sym->stroke->col_join);
					      sym->stroke->col_join = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_join =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_join,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_join);
						    *(sym->stroke->col_join +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "mitre") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_MITRE;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_ROUND;
						    if (strcmp
							(svg_value,
							 "bevel") == 0)
							sym->stroke->linejoin =
							    RL2_STROKE_LINEJOIN_BEVEL;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-linecap") == 0)
					  {
					      if (sym->stroke->col_cap != NULL)
						  free (sym->stroke->col_cap);
					      sym->stroke->col_cap = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_cap =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_cap,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_cap);
						    *(sym->stroke->col_cap +
						      len - 1) = '\0';
						}
					      else
						{
						    if (strcmp
							(svg_value,
							 "butt") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_BUTT;
						    if (strcmp
							(svg_value,
							 "round") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_ROUND;
						    if (strcmp
							(svg_value,
							 "square") == 0)
							sym->stroke->linecap =
							    RL2_STROKE_LINECAP_SQUARE;
						}
					  }
					if (strcmp
					    (svg_name, "stroke-dasharray") == 0)
					  {
					      if (sym->stroke->col_dash != NULL)
						  free (sym->stroke->col_dash);
					      sym->stroke->col_dash = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_dash =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_dash,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_dash);
						    *(sym->stroke->col_dash +
						      len - 1) = '\0';
						}
					      else
						{
						    int dash_count;
						    double *dash_list = NULL;
						    if (parse_sld_se_stroke_dasharray (svg_value, &dash_count, &dash_list))


						      {
							  sym->
							      stroke->dash_count
							      = dash_count;
							  sym->
							      stroke->dash_list
							      = dash_list;
						      }
						}
					  }
					if (strcmp
					    (svg_name,
					     "stroke-dashoffset") == 0)
					  {
					      if (sym->stroke->col_dashoff !=
						  NULL)
						  free (sym->
							stroke->col_dashoff);
					      sym->stroke->col_dashoff = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->stroke->col_dashoff =
							malloc (len + 1);
						    strcpy (sym->
							    stroke->col_dashoff,
							    svg_value + 1);
						    len =
							strlen (sym->
								stroke->col_dashoff);
						    *(sym->stroke->col_dashoff +
						      len - 1) = '\0';
						}
					      else
						  sym->stroke->dash_offset =
						      atof ((const char *)
							    svg_value);
					  }
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {
					      if (sym->fill->col_color != NULL)
						  free (sym->fill->col_color);
					      sym->fill->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->fill->col_color =
							malloc (len + 1);
						    strcpy (sym->
							    fill->col_color,
							    svg_value + 1);
						    len =
							strlen (sym->
								fill->col_color);
						    *(sym->fill->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  sym->fill->red = red;
							  sym->fill->green =
							      green;
							  sym->fill->blue =
							      blue;
						      }
						}
					  }
					if (strcmp (svg_name, "fill-opacity")
					    == 0)
					  {
					      if (sym->fill->col_opacity !=
						  NULL)
						  free (sym->fill->col_opacity);
					      sym->fill->col_opacity = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->fill->col_opacity =
							malloc (len + 1);
						    strcpy (sym->
							    fill->col_opacity,
							    svg_value + 1);
						    len =
							strlen (sym->
								fill->col_opacity);
						    *(sym->fill->col_opacity +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->fill->opacity =
							atof (svg_value);
						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  const char *value =
				      (const char *) child->content;
				  if (sym->col_perpoff != NULL)
				      free (sym->col_perpoff);
				  sym->col_perpoff = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					sym->col_perpoff = malloc (len + 1);
					strcpy (sym->col_perpoff, value + 1);
					len = strlen (sym->col_perpoff);
					*(sym->col_perpoff + len - 1) = '\0';
				    }
				  else
				    {
					sym->perpendicular_offset =

					    atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (sym->col_displ_x != NULL)
				      free (sym->col_displ_x);
				  sym->col_displ_x = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					sym->col_displ_x = malloc (len + 1);
					strcpy (sym->col_displ_x, value + 1);
					len = strlen (sym->col_displ_x);
					*(sym->col_displ_x + len - 1) = '\0';
				    }
				  else
				    {
					sym->displacement_x = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (sym->col_displ_y != NULL)
				      free (sym->col_displ_y);
				  sym->col_displ_y = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					sym->col_displ_y = malloc (len + 1);
					strcpy (sym->col_displ_y, value + 1);
					len = strlen (sym->col_displ_y);
					*(sym->col_displ_y + len - 1) = '\0';
				    }
				  else
				    {
					sym->displacement_y = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Opacity") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_opacity != NULL)
				      free (graphic->col_opacity);
				  graphic->col_opacity = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_opacity = malloc (len + 1);
					strcpy (graphic->col_opacity,
						value + 1);
					len = strlen (graphic->col_opacity);
					*(graphic->col_opacity +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->opacity = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Size") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_size != NULL)
				      free (graphic->col_size);
				  graphic->col_size = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_size = malloc (len + 1);
					strcpy (graphic->col_size, value + 1);
					len = strlen (graphic->col_size);
					*(graphic->col_size + len - 1) = '\0';
				    }
				  else
				    {
					graphic->size = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Rotation") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_rotation != NULL)
				      free (graphic->col_rotation);
				  graphic->col_rotation = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_rotation =
					    malloc (len + 1);
					strcpy (graphic->col_rotation,
						value + 1);
					len = strlen (graphic->col_rotation);
					*(graphic->col_rotation +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->rotation = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "AnchorPointX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_point_x != NULL)
				      free (graphic->col_point_x);
				  graphic->col_point_x = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_point_x = malloc (len + 1);
					strcpy (graphic->col_point_x,
						value + 1);
					len = strlen (graphic->col_point_x);
					*(graphic->col_point_x +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->anchor_point_x = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
		if (strcmp (name, "AnchorPointY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_point_y != NULL)
				      free (graphic->col_point_y);
				  graphic->col_point_y = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_point_y = malloc (len + 1);
					strcpy (graphic->col_point_y,
						value + 1);
					len = strlen (graphic->col_point_y);
					*(graphic->col_point_y +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->anchor_point_y = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_displ_x != NULL)
				      free (graphic->col_displ_x);
				  graphic->col_displ_x = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_displ_x = malloc (len + 1);
					strcpy (graphic->col_displ_x,
						value + 1);
					len = strlen (graphic->col_displ_x);
					*(graphic->col_displ_x +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->displacement_x = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)

			      {
				  const char *value =
				      (const char *) child->content;
				  if (graphic->col_displ_y != NULL)
				      free (graphic->col_displ_y);
				  graphic->col_displ_y = NULL;
				  if (is_table_column (value))
				    {
					/* table column name instead of value */
					int len = strlen (value) - 1;
					graphic->col_displ_y = malloc (len + 1);
					strcpy (graphic->col_displ_y,
						value + 1);
					len = strlen (graphic->col_displ_y);
					*(graphic->col_displ_y +
					  len - 1) = '\0';
				    }
				  else
				    {
					graphic->displacement_y = atof (value);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
				&& child->content != NULL)
			      {
				  int len;
				  const char *label =
				      (const char *) (child->content);
				  if (text->label != NULL)
				      free (text->label);
				  if (text->col_label != NULL)
				      free (text->col_label);
				  text->label = NULL;
				  text->col_label = NULL;
				  if (is_table_column (label))
				    {
					/* table column name instead of value */
					len = strlen (label) - 1;
					text->col_label = malloc (len + 1);
					strcpy (text->col_label, label + 1);
					len = strlen (text->col_label);
					*(text->col_label + len - 1) = '\0';
					return;
				    }
				  if (label == NULL)
				    {
					text->label = NULL;
					return;
				    }
				  len = strlen (label);
				  text->label = malloc (len + 1);
................................................................................
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "font-family")
					    == 0)
					  {
					      if (sym->col_font != NULL)
						  free (sym->col_font);
					      sym->col_font = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->col_font =
							malloc (len + 1);
						    strcpy (sym->col_font,
							    svg_value + 1);
						    len =
							strlen (sym->col_font);
						    *(sym->col_font + len - 1) =
							'\0';
						}
					      else
						{
						    if (sym->font_families_count
							< RL2_MAX_FONT_FAMILIES)
						      {
							  int idx =
							      sym->font_families_count++;
							  int len =
							      strlen
							      (svg_value);
							  *(sym->font_families +
							    idx) =
					 malloc (len + 1);
							  strcpy (*
								  (sym->font_families
								   + idx),
								  svg_value);
						      }
						}
					  }
					if (strcmp (svg_name, "font-style") ==
					    0)
					  {
					      if (sym->col_style != NULL)
						  free (sym->col_style);
					      sym->col_style = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->col_style =
							malloc (len + 1);
						    strcpy (sym->col_style,
							    svg_value + 1);
						    len =
							strlen (sym->col_style);
						    *(sym->col_style + len -
						      1) = '\0';
						}
					      else
						{
						    if (strcasecmp
							(svg_value,
							 "normal") == 0)
							sym->font_style =
							    RL2_FONT_STYLE_NORMAL;
						    if (strcasecmp
							(svg_value,
							 "italic") == 0)
							sym->font_style =
							    RL2_FONT_STYLE_ITALIC;
						    if (strcasecmp
							(svg_value,
							 "oblique") == 0)
							sym->font_style =
							    RL2_FONT_STYLE_OBLIQUE;
						}
					  }
					if (strcmp (svg_name, "font-weight")
					    == 0)
					  {
					      if (sym->col_weight != NULL)
						  free (sym->col_weight);
					      sym->col_weight = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->col_weight =
							malloc (len + 1);
						    strcpy (sym->col_weight,
							    svg_value + 1);
						    len =
							strlen
							(sym->col_weight);
						    *(sym->col_weight + len -
						      1) = '\0';
						}
					      else
						{
						    if (strcasecmp
							(svg_value,
							 "normal") == 0)
							sym->font_weight =
							    RL2_FONT_WEIGHT_NORMAL;
						    if (strcasecmp
							(svg_value,
							 "bold") == 0)
							sym->font_weight =
							    RL2_FONT_WEIGHT_BOLD;
						}
					  }
					if (strcmp (svg_name, "font-size") == 0)
					  {
					      if (sym->col_size != NULL)
						  free (sym->col_size);
					      sym->col_size = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->col_size =
							malloc (len + 1);
						    strcpy (sym->col_size,
							    svg_value + 1);
						    len =
							strlen (sym->col_size);
						    *(sym->col_size + len - 1) =
							'\0';
						}
					      else
						{
						    sym->font_size =
							atof (svg_value);
						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
................................................................................
		if (strcmp (name, "AnchorPointX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_point_x != NULL)
				      free (place->col_point_x);
				  place->col_point_x = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_point_x = malloc (len + 1);
					strcpy (place->col_point_x,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_point_x);
					*(place->col_point_x + len - 1) = '\0';
				    }
				  else
				    {
					place->anchor_point_x =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
		if (strcmp (name, "AnchorPointY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_point_y != NULL)
				      free (place->col_point_y);
				  place->col_point_y = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_point_y = malloc (len + 1);
					strcpy (place->col_point_y,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_point_y);
					*(place->col_point_y + len - 1) = '\0';
				    }
				  else
				    {
					place->anchor_point_y =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "DisplacementX") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_displ_x != NULL)
				      free (place->col_displ_x);
				  place->col_displ_x = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_displ_x = malloc (len + 1);
					strcpy (place->col_displ_x,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_displ_x);
					*(place->col_displ_x + len - 1) = '\0';
				    }
				  else
				    {
					place->displacement_x =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
		if (strcmp (name, "DisplacementY") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_displ_y != NULL)
				      free (place->col_displ_y);
				  place->col_displ_y = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_displ_y = malloc (len + 1);
					strcpy (place->col_displ_y,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_displ_y);
					*(place->col_displ_y + len - 1) = '\0';
				    }
				  else
				    {
					place->displacement_y =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Rotation") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_rotation != NULL)
				      free (place->col_rotation);
				  place->col_rotation = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_rotation = malloc (len + 1);
					strcpy (place->col_rotation,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_rotation);
					*(place->col_rotation + len - 1) = '\0';
				    }
				  else
				    {
					place->rotation =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "PerpendicularOffset") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_perpoff != NULL)
				      free (place->col_perpoff);
				  place->col_perpoff = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_perpoff = malloc (len + 1);
					strcpy (place->col_perpoff,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_perpoff);
					*(place->col_perpoff + len - 1) = '\0';
				    }
				  else
				    {
					place->perpendicular_offset =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "InitialGap") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_inigap != NULL)
				      free (place->col_inigap);
				  place->col_inigap = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_inigap = malloc (len + 1);
					strcpy (place->col_inigap,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_inigap);
					*(place->col_inigap + len - 1) = '\0';
				    }
				  else
				    {
					place->initial_gap =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
		if (strcmp (name, "Gap") == 0)
		  {
		      xmlNodePtr child = node->children;
		      while (child)
			{
			    if (child->type == XML_TEXT_NODE
				&& child->content != NULL)
			      {
				  if (place->col_gap != NULL)
				      free (place->col_gap);
				  place->col_gap = NULL;
				  if (is_table_column
				      ((const char *) child->content))
				    {
					/* table column name instead of value */
					int len =
					    strlen ((const char
						     *) (child->content)) - 1;
					place->col_gap = malloc (len + 1);
					strcpy (place->col_gap,
						(const char *) (child->content)
						+ 1);
					len = strlen (place->col_gap);
					*(place->col_gap + len - 1) = '\0';
				    }
				  else
				    {
					place->gap =
					    atof ((const char *)
						  child->content);
				    }
			      }
			    child = child->next;
			}
		  }
	    }
	  node = node->next;
      }
}
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {
					      if (halo->fill->col_color != NULL)
						  free (halo->fill->col_color);
					      halo->fill->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    halo->fill->col_color =
							malloc (len + 1);
						    strcpy (halo->
							    fill->col_color,
							    svg_value + 1);
						    len =
							strlen (halo->
								fill->col_color);
						    *(halo->fill->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  halo->fill->red = red;
							  halo->fill->green =
							      green;
							  halo->fill->blue =
							      blue;
						      }
						}
					  }
					if (strcmp (svg_name, "fill-opacity")
					    == 0)
					  {
					      if (halo->fill->col_opacity !=
						  NULL)
						  free (halo->
							fill->col_opacity);
					      halo->fill->col_opacity = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    halo->fill->col_opacity =
							malloc (len + 1);
						    strcpy (halo->
							    fill->col_opacity,
							    svg_value + 1);
						    len =
							strlen (halo->
								fill->col_opacity);
						    *(halo->fill->col_opacity +
						      len - 1) = '\0';
						}
					      else
						{
						    halo->fill->opacity =
							atof (svg_value);
						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
						  && grandchild->content !=
						  NULL)
						{
						    const char *radius =
							(const char
							 *)
							(grandchild->content);
						    if (sym->halo->col_radius !=
							NULL)
							free (sym->
							      halo->col_radius);
						    sym->halo->col_radius =
							NULL;
						    if (is_table_column
							(radius))
						      {
							  /* table column name instead of value */
							  int len =
							      strlen (radius) -
							      1;
							  sym->
							      halo->col_radius =
							      malloc (len + 1);
							  strcpy (sym->
								  halo->col_radius,
								  radius + 1);
							  len =
							      strlen
							      (sym->halo->col_radius);
							  *(sym->
							    halo->col_radius +
							    len - 1) = '\0';
						      }
						    else
						      {
							  sym->halo->radius =
							      atof (radius);
						      }
						}
					      grandchild = grandchild->next;
					  }
				    }
				  if (strcmp (name, "Fill") == 0)
				      parse_halo_fill (child, sym->halo);
			      }
................................................................................
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
		if (strcmp (name, "Fill") == 0)
		  {
		      xmlNodePtr child = node->children;
		      sym->fill = rl2_create_default_fill ();
		      sym->fill->red = 0x00;
		      sym->fill->green = 0x00;
		      sym->fill->blue = 0x00;
		      sym->fill->red = 0;
		      sym->fill->green = 0;
		      sym->fill->blue = 0;
		      sym->fill->opacity = 1.0;
		      if (sym->fill == NULL)
			  return;
		      while (child)
................................................................................
					    (child, &svg_name, &svg_value))
					  {
					      child = child->next;
					      continue;
					  }
					if (strcmp (svg_name, "fill") == 0)
					  {
					      if (sym->fill->col_color != NULL)
						  free (sym->fill->col_color);
					      sym->fill->col_color = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->fill->col_color =
							malloc (len + 1);
						    strcpy (sym->
							    fill->col_color,
							    svg_value + 1);
						    len =
							strlen (sym->
								fill->col_color);
						    *(sym->fill->col_color +
						      len - 1) = '\0';
						}
					      else
						{
						    unsigned char red;
						    unsigned char green;
						    unsigned char blue;
						    if (parse_sld_se_color
							(svg_value, &red,
							 &green, &blue))
						      {
							  sym->fill->red = red;
							  sym->fill->green =
							      green;
							  sym->fill->blue =
							      blue;
						      }
						}
					  }
					if (strcmp (svg_name, "fill-opacity")
					    == 0)
					  {
					      if (sym->fill->col_opacity !=
						  NULL)
						  free (sym->fill->col_opacity);
					      sym->fill->col_opacity = NULL;
					      if (is_table_column (svg_value))
						{
						    /* table column name instead of value */
						    int len =
							strlen (svg_value) - 1;
						    sym->fill->col_opacity =
							malloc (len + 1);
						    strcpy (sym->
							    fill->col_opacity,
							    svg_value + 1);
						    len =
							strlen (sym->
								fill->col_opacity);
						    *(sym->fill->col_opacity +
						      len - 1) = '\0';
						}
					      else
						{
						    sym->fill->opacity =
							atof (svg_value);
						}
					  }
				    }
			      }
			    child = child->next;
			}
		  }
................................................................................
		      return ret;
		  }
	    }
	  node = node->next;
      }
    return 0;
}

static int
count_point_symbolizer_column_names (rl2PointSymbolizerPtr point)
{
/* counting Point Symbolizer column names) */
    int count = 0;
    int index;
    int max;
    if (rl2_point_symbolizer_get_col_opacity (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_size (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_rotation (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_anchor_point_x (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_anchor_point_y (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_displacement_x (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_col_displacement_y (point) != NULL)
	count++;
    if (rl2_point_symbolizer_get_count (point, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int repl_index;
	  int max_repl;
	  if (rl2_point_symbolizer_mark_get_col_well_known_type (point, index)
	      != NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_color (point, index) !=
	      NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_width (point, index) !=
	      NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_linejoin (point, index)
	      != NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_linecap (point, index) !=
	      NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_dash_array (point, index)
	      != NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_stroke_dash_offset
	      (point, index) != NULL)
	      count++;
	  if (rl2_point_symbolizer_mark_get_col_fill_color (point, index) !=
	      NULL)
	      count++;
	  if (rl2_point_symbolizer_get_col_graphic_href (point, index) != NULL)
	      count++;
	  if (rl2_point_symbolizer_get_graphic_recode_count
	      (point, index, &max_repl) != RL2_OK)
	      max_repl = 0;
	  for (repl_index = 0; repl_index < max_repl; repl_index++)
	    {
		int color_index;
		if (rl2_point_symbolizer_get_col_graphic_recode_color
		    (point, index, repl_index, &color_index) != NULL)
		    count++;
	    }
      }
    return count;
}

static int
count_line_symbolizer_column_names (rl2LineSymbolizerPtr line)
{
/* counting Line Symbolizer column names) */
    int count = 0;
    int index;
    int max;
    if (rl2_line_symbolizer_get_col_graphic_stroke_href (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_color (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_opacity (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_width (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_linejoin (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_linecap (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_dash_array (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_stroke_dash_offset (line) != NULL)
	count++;
    if (rl2_line_symbolizer_get_col_perpendicular_offset (line) != NULL)
	count++;
    max = 0;
    if (rl2_line_symbolizer_get_graphic_stroke_recode_count
	(line, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  if (rl2_line_symbolizer_get_col_graphic_stroke_recode_color
	      (line, index, &color_index) != NULL)
	      count++;
      }
    return count;
}

static int
count_polygon_symbolizer_column_names (rl2PolygonSymbolizerPtr polyg)
{
/* counting Polygon Symbolizer column names) */
    int count = 0;
    int index;
    int max;
    if (rl2_polygon_symbolizer_get_col_graphic_stroke_href (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_color (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_opacity (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_width (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_linejoin (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_linecap (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_dash_array (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_stroke_dash_offset (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_graphic_fill_href (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_graphic_fill_href (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_fill_color (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_fill_opacity (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_displacement_x (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_displacement_y (polyg) != NULL)
	count++;
    if (rl2_polygon_symbolizer_get_col_perpendicular_offset (polyg) != NULL)
	count++;
    max = 0;
    if (rl2_polygon_symbolizer_get_graphic_stroke_recode_count
	(polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  if (rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color
	      (polyg, index, &color_index) != NULL)
	      count++;
      }
    max = 0;
    if (rl2_polygon_symbolizer_get_graphic_fill_recode_count
	(polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  if (rl2_polygon_symbolizer_get_col_graphic_fill_recode_color
	      (polyg, index, &color_index) != NULL)
	      count++;
      }
    return count;
}

static int
count_text_symbolizer_column_names (rl2TextSymbolizerPtr text)
{
/* counting Text Symbolizer column names) */
    int count = 0;
    if (rl2_text_symbolizer_get_col_label (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_font (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_style (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_weight (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_size (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_point_placement_col_anchor_point_x (text) !=
	NULL)
	count++;
    if (rl2_text_symbolizer_get_point_placement_col_anchor_point_y (text) !=
	NULL)
	count++;
    if (rl2_text_symbolizer_get_point_placement_col_displacement_x (text) !=
	NULL)
	count++;
    if (rl2_text_symbolizer_get_point_placement_col_displacement_y (text) !=
	NULL)
	count++;
    if (rl2_text_symbolizer_get_point_placement_col_rotation (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_line_placement_col_perpendicular_offset (text)
	!= NULL)
	count++;
    if (rl2_text_symbolizer_get_line_placement_col_initial_gap (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_line_placement_col_gap (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_halo_col_radius (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_halo_col_fill_color (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_halo_col_fill_opacity (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_fill_color (text) != NULL)
	count++;
    if (rl2_text_symbolizer_get_col_fill_opacity (text) != NULL)
	count++;
    return count;
}

static void
do_add_column_name (char **strings, char *dupl, const char *name, int *index)
{
/* adding a Column Name (may be duplicated) */
    int len;
    int i = *index;
    if (name != NULL)
      {
	  len = strlen (name);
	  *(strings + i) = malloc (len + 1);
	  strcpy (*(strings + i), name);
	  *(dupl + i) = 'N';
	  i++;
      }
    *index = i;
}

static void
get_point_symbolizer_strings (char **strings, char *dupl,
			      rl2PointSymbolizerPtr point, int *idx)
{
/* extracting all Point Symbolizer Column Names */
    const char *str;
    int index;
    int max;
    int i = *idx;
    str = rl2_point_symbolizer_get_col_opacity (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_size (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_rotation (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_anchor_point_x (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_anchor_point_y (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_displacement_x (point);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_point_symbolizer_get_col_displacement_y (point);
    do_add_column_name (strings, dupl, str, &i);
    if (rl2_point_symbolizer_get_count (point, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int repl_index;
	  int max_repl;
	  str =
	      rl2_point_symbolizer_mark_get_col_well_known_type (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str = rl2_point_symbolizer_mark_get_col_stroke_color (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str = rl2_point_symbolizer_mark_get_col_stroke_width (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_linejoin (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str = rl2_point_symbolizer_mark_get_col_stroke_linecap (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_dash_array (point,
								   index);
	  do_add_column_name (strings, dupl, str, &i);
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_dash_offset (point,
								    index);
	  do_add_column_name (strings, dupl, str, &i);
	  str = rl2_point_symbolizer_mark_get_col_fill_color (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  str = rl2_point_symbolizer_get_col_graphic_href (point, index);
	  do_add_column_name (strings, dupl, str, &i);
	  if (rl2_point_symbolizer_get_graphic_recode_count
	      (point, index, &max_repl) != RL2_OK)
	      max_repl = 0;
	  for (repl_index = 0; repl_index < max_repl; repl_index++)
	    {
		int color_index;
		str =
		    rl2_point_symbolizer_get_col_graphic_recode_color
		    (point, index, repl_index, &color_index);
		do_add_column_name (strings, dupl, str, &i);
	    }
      }
    *idx = i;
}

static void
get_line_symbolizer_strings (char **strings, char *dupl,
			     rl2LineSymbolizerPtr line, int *idx)
{
/* extracting all Line Symbolizer Column Names */
    const char *str;
    int i = *idx;
    int index;
    int max;
    str = rl2_line_symbolizer_get_col_graphic_stroke_href (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_color (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_opacity (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_width (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_linejoin (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_linecap (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_dash_array (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_stroke_dash_offset (line);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_line_symbolizer_get_col_perpendicular_offset (line);
    do_add_column_name (strings, dupl, str, &i);
    max = 0;
    if (rl2_line_symbolizer_get_graphic_stroke_recode_count
	(line, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str = rl2_line_symbolizer_get_col_graphic_stroke_recode_color
	      (line, index, &color_index);
	  do_add_column_name (strings, dupl, str, &i);
      }
    *idx = i;
}

static void
get_polygon_symbolizer_strings (char **strings, char *dupl,
				rl2PolygonSymbolizerPtr polyg, int *idx)
{
/* extracting all Polygon Symbolizer Column Names */
    const char *str;
    int i = *idx;
    int index;
    int max;
    str = rl2_polygon_symbolizer_get_col_graphic_stroke_href (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_color (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_opacity (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_width (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_linejoin (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_linecap (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_dash_array (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_stroke_dash_offset (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_graphic_fill_href (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_graphic_fill_href (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_fill_color (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_fill_opacity (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_displacement_x (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_displacement_y (polyg);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_polygon_symbolizer_get_col_perpendicular_offset (polyg);
    do_add_column_name (strings, dupl, str, &i);
    max = 0;
    if (rl2_polygon_symbolizer_get_graphic_stroke_recode_count
	(polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str = rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color
	      (polyg, index, &color_index);
	  do_add_column_name (strings, dupl, str, &i);
      }
    max = 0;
    if (rl2_polygon_symbolizer_get_graphic_fill_recode_count
	(polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str = rl2_polygon_symbolizer_get_col_graphic_fill_recode_color
	      (polyg, index, &color_index);
	  do_add_column_name (strings, dupl, str, &i);
      }

    *idx = i;
}

static void
get_text_symbolizer_strings (char **strings, char *dupl,
			     rl2TextSymbolizerPtr text, int *idx)
{
/* extracting all Text Symbolizer Column Names */
    const char *str;
    int i = *idx;
    str = rl2_text_symbolizer_get_col_label (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_font (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_style (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_weight (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_size (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_point_placement_col_anchor_point_x (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_point_placement_col_anchor_point_y (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_point_placement_col_displacement_x (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_point_placement_col_displacement_y (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_point_placement_col_rotation (text);
    do_add_column_name (strings, dupl, str, &i);
    str =
	rl2_text_symbolizer_get_line_placement_col_perpendicular_offset (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_line_placement_col_initial_gap (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_line_placement_col_gap (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_halo_col_radius (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_halo_col_fill_color (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_halo_col_fill_opacity (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_fill_color (text);
    do_add_column_name (strings, dupl, str, &i);
    str = rl2_text_symbolizer_get_col_fill_opacity (text);
    do_add_column_name (strings, dupl, str, &i);
    *idx = i;
}

static void
build_column_names_array (rl2PrivFeatureTypeStylePtr style)
{
/* building the column names array - Feature Type Style */
    char **strings;
    char *dupl;
................................................................................
    int count = 0;
    int count2 = 0;
    int i;
    int j;
    rl2PrivStyleRulePtr pR;
    rl2PrivVectorSymbolizerPtr pV;
    rl2PrivVectorSymbolizerItemPtr item;
    rl2PointSymbolizerPtr point;
    rl2LineSymbolizerPtr line;
    rl2PolygonSymbolizerPtr polyg;
    rl2TextSymbolizerPtr text;

    pR = style->first_rule;
    while (pR != NULL)
      {
	  /* counting max column names */
	  if (pR->column_name != NULL)
	      count++;
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    point = item->symbolizer;
			    count +=
				count_point_symbolizer_column_names (point);
			}
		      if (item->symbolizer_type == RL2_LINE_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    line = item->symbolizer;
			    count += count_line_symbolizer_column_names (line);
			}
		      if (item->symbolizer_type == RL2_POLYGON_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    polyg = item->symbolizer;

			    count +=
				count_polygon_symbolizer_column_names (polyg);
			}
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text = item->symbolizer;
			    count += count_text_symbolizer_column_names (text);
			}
		      item = item->next;
		  }
	    }
	  pR = pR->next;
      }
    pR = style->else_rule;
................................................................................
	      count++;
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    point = item->symbolizer;
			    count +=
				count_point_symbolizer_column_names (point);
			}
		      if (item->symbolizer_type == RL2_LINE_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    line = item->symbolizer;
			    count += count_line_symbolizer_column_names (line);
			}
		      if (item->symbolizer_type == RL2_POLYGON_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    polyg = item->symbolizer;

			    count +=
				count_polygon_symbolizer_column_names (polyg);
			}
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text = item->symbolizer;
			    count += count_text_symbolizer_column_names (text);
			}
		      item = item->next;
		  }
	    }
      }
    if (count == 0)
	return;
................................................................................
	    }
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    point = item->symbolizer;
			    get_point_symbolizer_strings (strings, dupl, point,
							  &i);
			}
		      if (item->symbolizer_type == RL2_LINE_SYMBOLIZER
			  && item->symbolizer != NULL)

			{



			    line = item->symbolizer;
			    get_line_symbolizer_strings (strings, dupl, line,
							 &i);
			}
		      if (item->symbolizer_type == RL2_POLYGON_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    polyg = item->symbolizer;
			    get_polygon_symbolizer_strings (strings, dupl,
							    polyg, &i);
			}
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text = item->symbolizer;
			    get_text_symbolizer_strings (strings, dupl, text,
							 &i);
			}
		      item = item->next;
		  }
	    }
	  pR = pR->next;
      }
    pR = style->else_rule;
................................................................................
	    }
	  if (pR->style_type == RL2_VECTOR_STYLE && pR->style != NULL)
	    {
		pV = (rl2PrivVectorSymbolizerPtr) (pR->style);
		item = pV->first;
		while (item != NULL)
		  {
		      if (item->symbolizer_type == RL2_POINT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    point = item->symbolizer;
			    get_point_symbolizer_strings (strings, dupl, point,
							  &i);
			}
		      if (item->symbolizer_type == RL2_LINE_SYMBOLIZER
			  && item->symbolizer != NULL)

			{



			    line = item->symbolizer;
			    get_line_symbolizer_strings (strings, dupl, line,
							 &i);
			}
		      if (item->symbolizer_type == RL2_POLYGON_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    polyg = item->symbolizer;
			    get_polygon_symbolizer_strings (strings, dupl,
							    polyg, &i);
			}
		      if (item->symbolizer_type == RL2_TEXT_SYMBOLIZER
			  && item->symbolizer != NULL)
			{
			    text = item->symbolizer;
			    get_text_symbolizer_strings (strings, dupl, text,
							 &i);
			}
		      item = item->next;
		  }
	    }
      }

    for (i = 0; i < count; i++)

Added src/rl2symclone.c.















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
/*

 rl2symclone -- private SQL helper methods

 version 0.1, 2015 January 18

 Author: Sandro Furieri a.furieri@lqt.it

 -----------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2008-2013
the Initial Developer. All Rights Reserved.

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>

#include "config.h"

#include "rasterlite2/rasterlite2.h"
#include "rasterlite2_private.h"

RL2_PRIVATE void
rl2_add_dyn_symbolizer (rl2PrivVectorSymbolizerPtr dyn, int type,
			void *symbolizer)
{
/* adding an individual Symbolizer to a Dynamic Vector Symbolizer */
    rl2PrivVectorSymbolizerItemPtr item =
	malloc (sizeof (rl2PrivVectorSymbolizerItem));
    item->symbolizer_type = type;
    item->symbolizer = symbolizer;
    item->next = NULL;
    if (dyn->first == NULL)
	dyn->first = item;
    if (dyn->last != NULL)
	dyn->last->next = item;
    dyn->last = item;
}

static int
parse_hex_byte (const char hi, const char lo, unsigned char *value)
{
/* attempting to parse an hexadecimal byte */
    unsigned char hex;
    switch (hi)
      {
      case 'f':
      case 'F':
	  hex = 15 * 16;
	  break;
      case 'e':
      case 'E':
	  hex = 14 * 16;
	  break;
      case 'd':
      case 'D':
	  hex = 13 * 16;
	  break;
      case 'c':
      case 'C':
	  hex = 12 * 16;
	  break;
      case 'b':
      case 'B':
	  hex = 11 * 16;
	  break;
      case 'a':
      case 'A':
	  hex = 10 * 16;
	  break;
      case '9':
	  hex = 9 * 16;
	  break;
      case '8':
	  hex = 8 * 16;
	  break;
      case '7':
	  hex = 7 * 16;
	  break;
      case '6':
	  hex = 6 * 16;
	  break;
      case '5':
	  hex = 5 * 16;
	  break;
      case '4':
	  hex = 4 * 16;
	  break;
      case '3':
	  hex = 3 * 16;
	  break;
      case '2':
	  hex = 2 * 16;
	  break;
      case '1':
	  hex = 1 * 16;
	  break;
      case '0':
	  hex = 0;
	  break;
      default:
	  return 0;
      };
    switch (lo)
      {
      case 'f':
      case 'F':
	  hex += 15;
	  break;
      case 'e':
      case 'E':
	  hex += 14;
	  break;
      case 'd':
      case 'D':
	  hex += 13;
	  break;
      case 'c':
      case 'C':
	  hex += 12;
	  break;
      case 'b':
      case 'B':
	  hex += 11;
	  break;
      case 'a':
      case 'A':
	  hex += 10;
	  break;
      case '9':
	  hex += 9;
	  break;
      case '8':
	  hex += 8;
	  break;
      case '7':
	  hex += 7;
	  break;
      case '6':
	  hex += 6;
	  break;
      case '5':
	  hex = 5;
	  break;
      case '4':
	  hex += 4;
	  break;
      case '3':
	  hex += 3;
	  break;
      case '2':
	  hex += 2;
	  break;
      case '1':
	  hex += 1;
	  break;
      case '0':
	  hex += 0;
	  break;
      default:
	  return 0;
      };
    *value = hex;
    return 1;
}

static void
find_variant_color (rl2PrivVariantArrayPtr var, const char *column_name,
		    unsigned char *red, unsigned char *green,
		    unsigned char *blue)
{
/* attempting to parse and Hex Color (#rrggbb) from Variant Array */
    int i;
    for (i = 0; i < var->count; i++)
      {
	  rl2PrivVariantValuePtr variant = *(var->array + i);
	  if (strcasecmp (variant->column_name, column_name) == 0)
	    {
		if (variant->sqlite3_type == SQLITE_TEXT)
		  {
		      unsigned char r;
		      unsigned char g;
		      unsigned char b;
		      const char *value = (const char *) (variant->text_value);
		      if (strlen (value) != 7)
			  return;
		      if (*value != '#')
			  return;
		      if (!parse_hex_byte (*(value + 1), *(value + 2), &r))
			  return;
		      if (!parse_hex_byte (*(value + 3), *(value + 4), &g))
			  return;
		      if (!parse_hex_byte (*(value + 5), *(value + 6), &b))
			  return;
		      *red = r;
		      *green = g;
		      *blue = b;
		      return;
		  }
		return;
	    }
      }
}

static int
find_variant_double_value (rl2PrivVariantArrayPtr var, const char *column_name,
			   double *value)
{
/* attempting to retry a Double value from Variant Array */
    int i;
    for (i = 0; i < var->count; i++)
      {
	  rl2PrivVariantValuePtr variant = *(var->array + i);
	  if (strcasecmp (variant->column_name, column_name) == 0)
	    {
		if (variant->sqlite3_type == SQLITE_FLOAT)
		    *value = variant->dbl_value;
		if (variant->sqlite3_type == SQLITE_INTEGER)
		    *value = (double) (variant->int_value);
		return 1;
	    }
      }
    return 0;
}

static void
find_variant_text_value (rl2PrivVariantArrayPtr var, const char *column_name,
			 const char **value)
{
/* attempting to retry a Text value from Variant Array */
    int i;
    for (i = 0; i < var->count; i++)
      {
	  rl2PrivVariantValuePtr variant = *(var->array + i);
	  if (strcasecmp (variant->column_name, column_name) == 0)
	    {
		if (variant->sqlite3_type == SQLITE_TEXT)
		    *value = (const char *) (variant->text_value);
		return;
	    }
      }
}

static void
find_variant_href (rl2PrivVariantArrayPtr var, const char *column_name,
		   char **value)
{
/* attempting to retry a Text value from Variant Array */
    int i;
    for (i = 0; i < var->count; i++)
      {
	  rl2PrivVariantValuePtr variant = *(var->array + i);
	  if (strcasecmp (variant->column_name, column_name) == 0)
	    {
		if (variant->sqlite3_type == SQLITE_TEXT)
		  {
		      *value =
			  sqlite3_mprintf ("http://www.utopia.gov/%s",
					   (const char
					    *) (variant->text_value));
		  }
		return;
	    }
      }
}

RL2_PRIVATE void
rl2_set_point_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
				     rl2PrivPointSymbolizerPtr point)
{
/* replacing Point Symbolizer dynamic (column based) values */
    int index;
    int max;
    const char *str =
	rl2_point_symbolizer_get_col_opacity ((rl2PointSymbolizerPtr) point);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  point->graphic->opacity = value;
      }
    str = rl2_point_symbolizer_get_col_size ((rl2PointSymbolizerPtr) point);
    if (str != NULL)
      {
	  double value = 6.0;
	  find_variant_double_value (var, str, &value);
	  point->graphic->size = value;
      }
    str = rl2_point_symbolizer_get_col_rotation ((rl2PointSymbolizerPtr) point);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  point->graphic->rotation = value;
      }
    str =
	rl2_point_symbolizer_get_col_anchor_point_x ((rl2PointSymbolizerPtr)
						     point);
    if (str != NULL)
      {
	  double value = 0.5;
	  find_variant_double_value (var, str, &value);
	  point->graphic->anchor_point_x = value;
      }
    str =
	rl2_point_symbolizer_get_col_anchor_point_y ((rl2PointSymbolizerPtr)
						     point);
    if (str != NULL)
      {
	  double value = 0.5;
	  find_variant_double_value (var, str, &value);
	  point->graphic->anchor_point_y = value;
      }
    str =
	rl2_point_symbolizer_get_col_displacement_x ((rl2PointSymbolizerPtr)
						     point);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  point->graphic->displacement_x = value;
      }
    str =
	rl2_point_symbolizer_get_col_displacement_y ((rl2PointSymbolizerPtr)
						     point);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  point->graphic->displacement_y = value;
      }
    if (rl2_point_symbolizer_get_count ((rl2PointSymbolizerPtr) point, &max) !=
	RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int repl_index;
	  int max_repl;
	  str =
	      rl2_point_symbolizer_mark_get_col_well_known_type ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      const char *value = NULL;
		      find_variant_text_value (var, str, &value);
		      mark->well_known_type = RL2_GRAPHIC_MARK_SQUARE;
		      if (value != NULL)
			{
			    if (strcasecmp (value, "square") == 0)
				mark->well_known_type = RL2_GRAPHIC_MARK_SQUARE;
			    else if (strcasecmp (value, "circle") == 0)
				mark->well_known_type = RL2_GRAPHIC_MARK_CIRCLE;
			    else if (strcasecmp (value, "triangle") == 0)
				mark->well_known_type =
				    RL2_GRAPHIC_MARK_TRIANGLE;
			    else if (strcasecmp (value, "star") == 0)
				mark->well_known_type = RL2_GRAPHIC_MARK_STAR;
			    else if (strcasecmp (value, "cross") == 0)
				mark->well_known_type = RL2_GRAPHIC_MARK_CROSS;
			    else if (strcasecmp (value, "x") == 0)
				mark->well_known_type = RL2_GRAPHIC_MARK_X;
			}
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_color ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      unsigned char red = 0;
		      unsigned char green = 0;
		      unsigned char blue = 0;
		      find_variant_color (var, str, &red, &green, &blue);
		      mark->stroke->red = red;
		      mark->stroke->green = green;
		      mark->stroke->blue = blue;
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_width ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      double value = 0.0;
		      find_variant_double_value (var, str, &value);
		      mark->stroke->width = value;
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_linejoin ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      const char *value = NULL;
		      find_variant_text_value (var, str, &value);
		      mark->stroke->linejoin = RL2_STROKE_LINEJOIN_ROUND;
		      if (value != NULL)
			{
			    if (strcasecmp (value, "mitre") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINEJOIN_MITRE;
			    else if (strcasecmp (value, "round") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINEJOIN_ROUND;
			    else if (strcasecmp (value, "bevel") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINEJOIN_BEVEL;
			}
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_linecap ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      const char *value = NULL;
		      find_variant_text_value (var, str, &value);
		      mark->stroke->linejoin = RL2_STROKE_LINECAP_ROUND;
		      if (value != NULL)
			{
			    if (strcasecmp (value, "butt") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINECAP_BUTT;
			    else if (strcasecmp (value, "round") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINECAP_ROUND;
			    else if (strcasecmp (value, "square") == 0)
				mark->stroke->linejoin =
				    RL2_STROKE_LINECAP_SQUARE;
			}
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_dash_array ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      const char *value = NULL;
		      find_variant_text_value (var, str, &value);
		      if (value == NULL)
			{
			    if (mark->stroke->dash_list != NULL)
				free (mark->stroke->dash_list);
			    mark->stroke->dash_list = NULL;
			    mark->stroke->dash_count = 0;
			}
		      else
			{
			    int count = 0;
			    double *list = NULL;
			    if (parse_sld_se_stroke_dasharray
				(value, &count, &list))
			      {
				  if (mark->stroke->dash_list != NULL)
				      free (mark->stroke->dash_list);
				  mark->stroke->dash_list = list;
				  mark->stroke->dash_count = count;
			      }
			}
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_stroke_dash_offset ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      double value = 0.0;
		      find_variant_double_value (var, str, &value);
		      mark->stroke->dash_offset = value;
		  }
	    }
	  str =
	      rl2_point_symbolizer_mark_get_col_fill_color ((rl2PointSymbolizerPtr) point, index);
	  if (str != NULL)
	    {
		rl2PrivMarkPtr mark =
		    rl2_point_symbolizer_get_mark_ref ((rl2PointSymbolizerPtr)
						       point, index);
		if (mark != NULL)
		  {
		      unsigned char red = 128;
		      unsigned char green = 128;
		      unsigned char blue = 128;
		      find_variant_color (var, str, &red, &green, &blue);
		      mark->fill->red = red;
		      mark->fill->green = green;
		      mark->fill->blue = blue;
		  }
	    }
	  str =
	      rl2_point_symbolizer_get_col_graphic_href ((rl2PointSymbolizerPtr)
							 point, index);
	  if (str != NULL)
	    {
		rl2PrivExternalGraphicPtr ext =
		    rl2_point_symbolizer_get_external_graphic_ref ((rl2PointSymbolizerPtr) point, index);
		if (ext != NULL)
		  {
		      char *value = NULL;
		      find_variant_href (var, str, &value);
		      if (value != NULL)
			{
			    int len = strlen (value);
			    ext->xlink_href = malloc (len + 1);
			    strcpy (ext->xlink_href, value);
			    sqlite3_free (value);
			}
		  }
	    }
	  if (rl2_point_symbolizer_get_graphic_recode_count
	      ((rl2PointSymbolizerPtr) point, index, &max_repl) != RL2_OK)
	      max_repl = 0;
	  for (repl_index = 0; repl_index < max_repl; repl_index++)
	    {
		int color_index;
		str =
		    rl2_point_symbolizer_get_col_graphic_recode_color
		    ((rl2PointSymbolizerPtr) point, index, repl_index,
		     &color_index);
		if (str != NULL)
		  {
		      rl2PrivColorReplacementPtr repl =
			  rl2_point_symbolizer_get_color_replacement_ref ((rl2PointSymbolizerPtr) point, index, repl_index, &color_index);
		      if (repl != NULL)
			{
			    unsigned char red = 128;
			    unsigned char green = 128;
			    unsigned char blue = 128;
			    find_variant_color (var, str, &red, &green, &blue);
			    repl->index = color_index;
			    repl->red = red;
			    repl->green = green;
			    repl->blue = blue;
			}
		  }
	    }
      }
}

RL2_PRIVATE void
rl2_set_line_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
				    rl2PrivLineSymbolizerPtr line)
{
/* replacing Line Symbolizer dynamic (column based) values */
    int index;
    int max;
    const char *str =
	rl2_line_symbolizer_get_col_graphic_stroke_href ((rl2LineSymbolizerPtr)
							 line);
    if (str != NULL)
      {
	  rl2PrivExternalGraphicPtr ext =
	      rl2_line_symbolizer_get_stroke_external_graphic_ref ((rl2LineSymbolizerPtr) line);
	  if (ext != NULL)
	    {
		char *value = NULL;
		find_variant_href (var, str, &value);
		if (value != NULL)
		  {
		      int len = strlen (value);
		      ext->xlink_href = malloc (len + 1);
		      strcpy (ext->xlink_href, value);
		      sqlite3_free (value);
		  }
	    }
      }
    if (rl2_line_symbolizer_get_graphic_stroke_recode_count
	((rl2LineSymbolizerPtr) line, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str =
	      rl2_line_symbolizer_get_col_graphic_stroke_recode_color ((rl2LineSymbolizerPtr) line, index, &color_index);
	  if (str != NULL)
	    {
		rl2PrivColorReplacementPtr repl =
		    rl2_line_symbolizer_get_stroke_color_replacement_ref ((rl2LineSymbolizerPtr) line, index, &color_index);
		if (repl != NULL)
		  {
		      unsigned char red = 128;
		      unsigned char green = 128;
		      unsigned char blue = 128;
		      find_variant_color (var, str, &red, &green, &blue);
		      repl->index = color_index;
		      repl->red = red;
		      repl->green = green;
		      repl->blue = blue;
		  }
	    }
      }
    str =
	rl2_line_symbolizer_get_col_stroke_color ((rl2LineSymbolizerPtr) line);
    if (str != NULL)
      {
	  unsigned char red = 0;
	  unsigned char green = 0;
	  unsigned char blue = 0;
	  find_variant_color (var, str, &red, &green, &blue);
	  line->stroke->red = red;
	  line->stroke->green = green;
	  line->stroke->blue = blue;
      }
    str =
	rl2_line_symbolizer_get_col_stroke_opacity ((rl2LineSymbolizerPtr)
						    line);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  line->stroke->opacity = value;
      }
    str =
	rl2_line_symbolizer_get_col_stroke_width ((rl2LineSymbolizerPtr) line);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  line->stroke->width = value;
      }
    str =
	rl2_line_symbolizer_get_col_stroke_linejoin ((rl2LineSymbolizerPtr)
						     line);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  line->stroke->linejoin = RL2_STROKE_LINEJOIN_ROUND;
	  if (value != NULL)
	    {
		if (strcasecmp (value, "mitre") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINEJOIN_MITRE;
		else if (strcasecmp (value, "round") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINEJOIN_ROUND;
		else if (strcasecmp (value, "bevel") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINEJOIN_BEVEL;
	    }
      }
    str =
	rl2_line_symbolizer_get_col_stroke_linecap ((rl2LineSymbolizerPtr)
						    line);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  line->stroke->linejoin = RL2_STROKE_LINECAP_ROUND;
	  if (value != NULL)
	    {
		if (strcasecmp (value, "butt") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINECAP_BUTT;
		else if (strcasecmp (value, "round") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINECAP_ROUND;
		else if (strcasecmp (value, "square") == 0)
		    line->stroke->linejoin = RL2_STROKE_LINECAP_SQUARE;
	    }
      }
    str =
	rl2_line_symbolizer_get_col_stroke_dash_array ((rl2LineSymbolizerPtr)
						       line);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  if (value == NULL)
	    {
		if (line->stroke->dash_list != NULL)
		    free (line->stroke->dash_list);
		line->stroke->dash_list = NULL;
		line->stroke->dash_count = 0;
	    }
	  else
	    {
		int count = 0;
		double *list = NULL;
		if (parse_sld_se_stroke_dasharray (value, &count, &list))
		  {
		      if (line->stroke->dash_list != NULL)
			  free (line->stroke->dash_list);
		      line->stroke->dash_list = list;
		      line->stroke->dash_count = count;
		  }
	    }
      }
    str =
	rl2_line_symbolizer_get_col_stroke_dash_offset ((rl2LineSymbolizerPtr)
							line);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  line->stroke->dash_offset = value;
      }
    str =
	rl2_line_symbolizer_get_col_perpendicular_offset ((rl2LineSymbolizerPtr)
							  line);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  line->perpendicular_offset = value;
      }
}

RL2_PRIVATE void
rl2_set_polygon_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
				       rl2PrivPolygonSymbolizerPtr polyg)
{
/* replacing Line Symbolizer dynamic (column based) values */
    int index;
    int max;
    const char *str =
	rl2_polygon_symbolizer_get_col_graphic_stroke_href ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  rl2PrivExternalGraphicPtr ext =
	      rl2_polygon_symbolizer_get_stroke_external_graphic_ref ((rl2PolygonSymbolizerPtr) polyg);
	  if (ext != NULL)
	    {
		char *value = NULL;
		find_variant_href (var, str, &value);
		if (value != NULL)
		  {
		      int len = strlen (value);
		      ext->xlink_href = malloc (len + 1);
		      strcpy (ext->xlink_href, value);
		      sqlite3_free (value);
		  }
	    }
      }
    if (rl2_polygon_symbolizer_get_graphic_stroke_recode_count
	((rl2PolygonSymbolizerPtr) polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str =
	      rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color ((rl2PolygonSymbolizerPtr) polyg, index, &color_index);
	  if (str != NULL)
	    {
		rl2PrivColorReplacementPtr repl =
		    rl2_polygon_symbolizer_get_stroke_color_replacement_ref ((rl2PolygonSymbolizerPtr) polyg, index, &color_index);
		if (repl != NULL)
		  {
		      unsigned char red = 128;
		      unsigned char green = 128;
		      unsigned char blue = 128;
		      find_variant_color (var, str, &red, &green, &blue);
		      repl->index = color_index;
		      repl->red = red;
		      repl->green = green;
		      repl->blue = blue;
		  }
	    }
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_color ((rl2PolygonSymbolizerPtr)
						     polyg);
    if (str != NULL)
      {
	  unsigned char red = 0;
	  unsigned char green = 0;
	  unsigned char blue = 0;
	  find_variant_color (var, str, &red, &green, &blue);
	  polyg->stroke->red = red;
	  polyg->stroke->green = green;
	  polyg->stroke->blue = blue;
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_opacity ((rl2PolygonSymbolizerPtr)
						       polyg);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  polyg->stroke->opacity = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_width ((rl2PolygonSymbolizerPtr)
						     polyg);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  polyg->stroke->width = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_linejoin ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  polyg->stroke->linejoin = RL2_STROKE_LINEJOIN_ROUND;
	  if (value != NULL)
	    {
		if (strcasecmp (value, "mitre") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINEJOIN_MITRE;
		else if (strcasecmp (value, "round") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINEJOIN_ROUND;
		else if (strcasecmp (value, "bevel") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINEJOIN_BEVEL;
	    }
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_linecap ((rl2PolygonSymbolizerPtr)
						       polyg);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  polyg->stroke->linejoin = RL2_STROKE_LINECAP_ROUND;
	  if (value != NULL)
	    {
		if (strcasecmp (value, "butt") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINECAP_BUTT;
		else if (strcasecmp (value, "round") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINECAP_ROUND;
		else if (strcasecmp (value, "square") == 0)
		    polyg->stroke->linejoin = RL2_STROKE_LINECAP_SQUARE;
	    }
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_dash_array ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  if (value == NULL)
	    {
		if (polyg->stroke->dash_list != NULL)
		    free (polyg->stroke->dash_list);
		polyg->stroke->dash_list = NULL;
		polyg->stroke->dash_count = 0;
	    }
	  else
	    {
		int count = 0;
		double *list = NULL;
		if (parse_sld_se_stroke_dasharray (value, &count, &list))
		  {
		      if (polyg->stroke->dash_list != NULL)
			  free (polyg->stroke->dash_list);
		      polyg->stroke->dash_list = list;
		      polyg->stroke->dash_count = count;
		  }
	    }
      }
    str =
	rl2_polygon_symbolizer_get_col_stroke_dash_offset ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  polyg->stroke->dash_offset = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_graphic_fill_href ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  rl2PrivExternalGraphicPtr ext =
	      rl2_polygon_symbolizer_get_fill_external_graphic_ref ((rl2PolygonSymbolizerPtr) polyg);
	  if (ext != NULL)
	    {
		char *value = NULL;
		find_variant_href (var, str, &value);
		if (value != NULL)
		  {
		      int len = strlen (value);
		      ext->xlink_href = malloc (len + 1);
		      strcpy (ext->xlink_href, value);
		      sqlite3_free (value);
		  }
	    }
      }
    if (rl2_polygon_symbolizer_get_graphic_fill_recode_count
	((rl2PolygonSymbolizerPtr) polyg, &max) != RL2_OK)
	max = 0;
    for (index = 0; index < max; index++)
      {
	  int color_index;
	  str =
	      rl2_polygon_symbolizer_get_col_graphic_fill_recode_color ((rl2PolygonSymbolizerPtr) polyg, index, &color_index);
	  if (str != NULL)
	    {
		rl2PrivColorReplacementPtr repl =
		    rl2_polygon_symbolizer_get_fill_color_replacement_ref ((rl2PolygonSymbolizerPtr) polyg, index, &color_index);
		if (repl != NULL)
		  {
		      unsigned char red = 128;
		      unsigned char green = 128;
		      unsigned char blue = 128;
		      find_variant_color (var, str, &red, &green, &blue);
		      repl->index = color_index;
		      repl->red = red;
		      repl->green = green;
		      repl->blue = blue;
		  }
	    }
      }
    str =
	rl2_polygon_symbolizer_get_col_fill_color ((rl2PolygonSymbolizerPtr)
						   polyg);
    if (str != NULL)
      {
	  unsigned char red = 128;
	  unsigned char green = 128;
	  unsigned char blue = 128;
	  find_variant_color (var, str, &red, &green, &blue);
	  polyg->fill->red = red;
	  polyg->fill->green = green;
	  polyg->fill->blue = blue;
      }
    str =
	rl2_polygon_symbolizer_get_col_fill_opacity ((rl2PolygonSymbolizerPtr)
						     polyg);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  polyg->fill->opacity = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_perpendicular_offset ((rl2PolygonSymbolizerPtr) polyg);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  polyg->perpendicular_offset = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_displacement_x ((rl2PolygonSymbolizerPtr)
						       polyg);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  polyg->displacement_x = value;
      }
    str =
	rl2_polygon_symbolizer_get_col_displacement_y ((rl2PolygonSymbolizerPtr)
						       polyg);
    if (str != NULL)
      {
	  double value = 0.0;
	  find_variant_double_value (var, str, &value);
	  polyg->displacement_y = value;
      }
}

RL2_PRIVATE void
rl2_set_text_symbolizer_dyn_values (rl2PrivVariantArrayPtr var,
				    rl2PrivTextSymbolizerPtr text)
{
/* replacing Text Symbolizer dynamic (column based) values */
    const char *str =
	rl2_text_symbolizer_get_col_label ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  if (value == NULL)
	    {
		double value = 0.0;
		if (!find_variant_double_value (var, str, &value))
		    text->label = NULL;
		else
		  {
		      /* transforming a Double or Int value into a text string */
		      int len;
		      int i;
		      char *txt = sqlite3_mprintf ("%f", value);
		      for (i = strlen (txt) - 1; i >= 0; i--)
			{
			    if (txt[i] == '0')
				txt[i] = '\0';
			    else
				break;
			}
		      i = strlen (txt) - 1;
		      if (txt[i] == '.')
			  txt[i] = '\0';
		      len = strlen (txt);
		      text->label = malloc (len + 1);
		      strcpy (text->label, txt);
		      sqlite3_free (txt);
		  }
	    }
	  else
	    {
		int len = strlen (value);
		text->label = malloc (len + 1);
		strcpy (text->label, value);
	    }
      }
    str = rl2_text_symbolizer_get_col_font ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  int i;
	  int len;
	  const char *value = NULL;
	  find_variant_text_value (var, str, &value);
	  if (value != NULL)
	    {
		for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
		  {
		      if (*(text->font_families + i) != NULL)
			  free (*(text->font_families + i));
		      *(text->font_families + i) = NULL;
		  }
		text->font_families_count = 1;
		len = strlen (value);
		*(text->font_families + 0) = malloc (len + 1);
		strcpy (*(text->font_families + 0), value);
	    }
      }
    str = rl2_text_symbolizer_get_col_style ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  const char *value = "normal";
	  find_variant_text_value (var, str, &value);
	  if (strcasecmp (value, "normal") == 0)
	      text->font_style = RL2_FONT_STYLE_NORMAL;
	  else if (strcasecmp (value, "italic") == 0)
	      text->font_style = RL2_FONT_STYLE_ITALIC;
	  else if (strcasecmp (value, "oblique") == 0)
	      text->font_style = RL2_FONT_STYLE_OBLIQUE;
	  else
	      text->font_style = RL2_FONT_STYLE_NORMAL;
      }
    str = rl2_text_symbolizer_get_col_weight ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  const char *value = "normal";
	  find_variant_text_value (var, str, &value);
	  if (strcasecmp (value, "normal") == 0)
	      text->font_weight = RL2_FONT_WEIGHT_NORMAL;
	  else if (strcasecmp (value, "bold") == 0)
	      text->font_weight = RL2_FONT_WEIGHT_BOLD;
	  else
	      text->font_weight = RL2_FONT_WEIGHT_NORMAL;
      }
    str = rl2_text_symbolizer_get_col_size ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 10.0;
	  find_variant_double_value (var, str, &value);
	  text->font_size = value;
      }
    str =
	rl2_text_symbolizer_get_point_placement_col_anchor_point_x ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.5;
	  rl2PrivPointPlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->anchor_point_x = value;
      }
    str =
	rl2_text_symbolizer_get_point_placement_col_anchor_point_y ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.5;
	  rl2PrivPointPlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->anchor_point_y = value;
      }
    str =
	rl2_text_symbolizer_get_point_placement_col_displacement_x ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivPointPlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->displacement_x = value;
      }
    str =
	rl2_text_symbolizer_get_point_placement_col_displacement_y ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivPointPlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->displacement_y = value;
      }
    str =
	rl2_text_symbolizer_get_point_placement_col_rotation ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivPointPlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->rotation = value;
      }
    str =
	rl2_text_symbolizer_get_line_placement_col_perpendicular_offset ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivLinePlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->perpendicular_offset = value;
      }
    str =
	rl2_text_symbolizer_get_line_placement_col_initial_gap ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivLinePlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->initial_gap = value;
      }
    str =
	rl2_text_symbolizer_get_line_placement_col_gap ((rl2TextSymbolizerPtr)
							text);
    if (str != NULL)
      {
	  double value = 0.0;
	  rl2PrivLinePlacementPtr pl = text->label_placement;
	  find_variant_double_value (var, str, &value);
	  pl->gap = value;
      }
    str = rl2_text_symbolizer_get_col_fill_color ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  unsigned char red = 0;
	  unsigned char green = 0;
	  unsigned char blue = 0;
	  find_variant_color (var, str, &red, &green, &blue);
	  text->fill->red = red;
	  text->fill->green = green;
	  text->fill->blue = blue;
      }
    str =
	rl2_text_symbolizer_get_col_fill_opacity ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 1.0;;
	  find_variant_double_value (var, str, &value);
	  text->fill->opacity = value;
      }
    str = rl2_text_symbolizer_get_halo_col_radius ((rl2TextSymbolizerPtr) text);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  text->halo->radius = value;
      }
    str =
	rl2_text_symbolizer_get_halo_col_fill_color ((rl2TextSymbolizerPtr)
						     text);
    if (str != NULL)
      {
	  unsigned char red = 255;
	  unsigned char green = 255;
	  unsigned char blue = 255;
	  find_variant_color (var, str, &red, &green, &blue);
	  text->halo->fill->red = red;
	  text->halo->fill->green = green;
	  text->halo->fill->blue = blue;
      }
    str =
	rl2_text_symbolizer_get_halo_col_fill_opacity ((rl2TextSymbolizerPtr)
						       text);
    if (str != NULL)
      {
	  double value = 1.0;
	  find_variant_double_value (var, str, &value);
	  text->halo->fill->opacity = value;
      }
}

RL2_PRIVATE rl2PrivPointSymbolizerPtr
rl2_clone_point_symbolizer (rl2PrivPointSymbolizerPtr in)
{
/* cloning a Point Symbolizer */
    int len;
    rl2PrivPointSymbolizerPtr out;
    rl2PrivGraphicItemPtr item_in;

    if (in == NULL)
	return NULL;
    if (in->graphic == NULL)
	return NULL;
    out = malloc (sizeof (rl2PrivPointSymbolizer));
    if (out == NULL)
	return NULL;
    out->graphic = rl2_create_default_graphic ();
    if (out->graphic == NULL)
      {
	  free (out);
	  return NULL;
      }
    out->graphic->first = NULL;
    out->graphic->last = NULL;
    out->graphic->opacity = in->graphic->opacity;
    out->graphic->size = in->graphic->size;
    out->graphic->rotation = in->graphic->rotation;
    out->graphic->anchor_point_x = in->graphic->anchor_point_x;
    out->graphic->anchor_point_y = in->graphic->anchor_point_y;
    out->graphic->displacement_x = in->graphic->displacement_x;
    out->graphic->displacement_y = in->graphic->displacement_y;
    out->graphic->col_opacity = NULL;
    if (in->graphic->col_opacity != NULL)
      {
	  len = strlen (in->graphic->col_opacity);
	  out->graphic->col_opacity = malloc (len + 1);
	  strcpy (out->graphic->col_opacity, in->graphic->col_opacity);
      }
    out->graphic->col_size = NULL;
    if (in->graphic->col_size != NULL)
      {
	  len = strlen (in->graphic->col_size);
	  out->graphic->col_size = malloc (len + 1);
	  strcpy (out->graphic->col_size, in->graphic->col_size);
      }
    out->graphic->col_rotation = NULL;
    if (in->graphic->col_rotation != NULL)
      {
	  len = strlen (in->graphic->col_rotation);
	  out->graphic->col_rotation = malloc (len + 1);
	  strcpy (out->graphic->col_rotation, in->graphic->col_rotation);
      }
    out->graphic->col_point_x = NULL;
    if (in->graphic->col_point_x != NULL)
      {
	  len = strlen (in->graphic->col_point_x);
	  out->graphic->col_point_x = malloc (len + 1);
	  strcpy (out->graphic->col_point_x, in->graphic->col_point_x);
      }
    out->graphic->col_point_y = NULL;
    if (in->graphic->col_point_y != NULL)
      {
	  len = strlen (in->graphic->col_point_y);
	  out->graphic->col_point_y = malloc (len + 1);
	  strcpy (out->graphic->col_point_y, in->graphic->col_point_y);
      }
    out->graphic->col_displ_x = NULL;
    if (in->graphic->col_displ_x != NULL)
      {
	  len = strlen (in->graphic->col_displ_x);
	  out->graphic->col_displ_x = malloc (len + 1);
	  strcpy (out->graphic->col_displ_x, in->graphic->col_displ_x);
      }
    out->graphic->col_displ_y = NULL;
    if (in->graphic->col_displ_y != NULL)
      {
	  len = strlen (in->graphic->col_displ_y);
	  out->graphic->col_displ_y = malloc (len + 1);
	  strcpy (out->graphic->col_displ_y, in->graphic->col_displ_y);
      }
    item_in = in->graphic->first;
    while (item_in != NULL)
      {
	  rl2PrivGraphicItemPtr item_out = NULL;
	  if (item_in->type == RL2_EXTERNAL_GRAPHIC)
	    {
		rl2PrivColorReplacementPtr repl_in;
		rl2PrivColorReplacementPtr repl_out;
		rl2PrivExternalGraphicPtr ext_in = item_in->item;
		rl2PrivExternalGraphicPtr ext_out =
		    malloc (sizeof (rl2PrivExternalGraphic));
		item_out = malloc (sizeof (rl2PrivGraphicItem));
		ext_out->xlink_href = NULL;
		if (ext_in->xlink_href != NULL)
		  {
		      len = strlen (ext_in->xlink_href);
		      ext_out->xlink_href = malloc (len + 1);
		      strcpy (ext_out->xlink_href, ext_in->xlink_href);
		  }
		ext_out->col_href = NULL;
		if (ext_in->col_href != NULL)
		  {
		      len = strlen (ext_in->col_href);
		      ext_out->col_href = malloc (len + 1);
		      strcpy (ext_out->col_href, ext_in->col_href);
		  }
		ext_out->first = NULL;
		ext_out->last = NULL;
		repl_in = ext_in->first;
		while (repl_in != NULL)
		  {
		      repl_out = malloc (sizeof (rl2PrivColorReplacement));
		      repl_out->index = repl_in->index;
		      repl_out->red = repl_in->red;
		      repl_out->green = repl_in->green;
		      repl_out->blue = repl_in->blue;
		      repl_out->col_color = NULL;
		      if (repl_in->col_color != NULL)
			{
			    len = strlen (repl_in->col_color);
			    repl_out->col_color = malloc (len + 1);
			    strcpy (repl_out->col_color, repl_in->col_color);
			}
		      repl_out->next = NULL;
		      if (ext_out->first == NULL)
			  ext_out->first = repl_out;
		      if (ext_out->last != NULL)
			  ext_out->last->next = repl_out;
		      ext_out->last = repl_out;
		      repl_in = repl_in->next;
		  }
		item_out->type = RL2_EXTERNAL_GRAPHIC;
		item_out->item = ext_out;
		item_out->next = NULL;
	    }
	  if (item_in->type == RL2_MARK_GRAPHIC)
	    {
		rl2PrivMarkPtr mark_in = item_in->item;
		rl2PrivMarkPtr mark_out = malloc (sizeof (rl2PrivMark));
		item_out = malloc (sizeof (rl2PrivGraphicItem));
		mark_out->well_known_type = mark_in->well_known_type;
		mark_out->stroke = NULL;
		if (mark_in->stroke != NULL)
		  {
		      rl2PrivStrokePtr stroke_in = mark_in->stroke;
		      rl2PrivStrokePtr stroke_out =
			  malloc (sizeof (rl2PrivStroke));
		      stroke_out->graphic = NULL;
		      stroke_out->red = stroke_in->red;
		      stroke_out->green = stroke_in->green;
		      stroke_out->blue = stroke_in->blue;
		      stroke_out->opacity = stroke_in->opacity;
		      stroke_out->width = stroke_in->width;
		      stroke_out->linejoin = stroke_in->linejoin;
		      stroke_out->linecap = stroke_in->linecap;
		      stroke_out->dash_count = stroke_in->dash_count;
		      stroke_out->dash_list = NULL;
		      if (stroke_in->dash_count > 0)
			{
			    int i;
			    stroke_out->dash_list =
				malloc (sizeof (double) *
					stroke_out->dash_count);
			    for (i = 0; i < stroke_out->dash_count; i++)
				*(stroke_out->dash_list + i) =
				    *(stroke_in->dash_list + i);
			}
		      stroke_out->dash_offset = stroke_in->dash_offset;
		      stroke_out->col_color = NULL;
		      if (stroke_in->col_color != NULL)
			{
			    len = strlen (stroke_in->col_color);
			    stroke_out->col_color = malloc (len + 1);
			    strcpy (stroke_out->col_color,
				    stroke_in->col_color);
			}
		      stroke_out->col_opacity = NULL;
		      if (stroke_in->col_opacity != NULL)
			{
			    len = strlen (stroke_in->col_opacity);
			    stroke_out->col_opacity = malloc (len + 1);
			    strcpy (stroke_out->col_opacity,
				    stroke_in->col_opacity);
			}
		      stroke_out->col_width = NULL;
		      if (stroke_in->col_width != NULL)
			{
			    len = strlen (stroke_in->col_width);
			    stroke_out->col_width = malloc (len + 1);
			    strcpy (stroke_out->col_width,
				    stroke_in->col_width);
			}
		      stroke_out->col_join = NULL;
		      if (stroke_in->col_join != NULL)
			{
			    len = strlen (stroke_in->col_join);
			    stroke_out->col_join = malloc (len + 1);
			    strcpy (stroke_out->col_join, stroke_in->col_join);
			}
		      stroke_out->col_cap = NULL;
		      if (stroke_in->col_cap != NULL)
			{
			    len = strlen (stroke_in->col_cap);
			    stroke_out->col_cap = malloc (len + 1);
			    strcpy (stroke_out->col_cap, stroke_in->col_cap);
			}
		      stroke_out->col_dash = NULL;
		      if (stroke_in->col_dash != NULL)
			{
			    len = strlen (stroke_in->col_dash);
			    stroke_out->col_dash = malloc (len + 1);
			    strcpy (stroke_out->col_dash, stroke_in->col_dash);
			}
		      stroke_out->col_dashoff = NULL;
		      if (stroke_in->col_dashoff != NULL)
			{
			    len = strlen (stroke_in->col_dashoff);
			    stroke_out->col_dashoff = malloc (len + 1);
			    strcpy (stroke_out->col_dashoff,
				    stroke_in->col_dashoff);
			}
		      mark_out->stroke = stroke_out;
		  }
		mark_out->fill = NULL;
		if (mark_in->fill != NULL)
		  {
		      rl2PrivFillPtr fill_in = mark_in->fill;
		      rl2PrivFillPtr fill_out = malloc (sizeof (rl2PrivFill));
		      fill_out->graphic = NULL;
		      fill_out->red = fill_in->red;
		      fill_out->green = fill_in->green;
		      fill_out->blue = fill_in->blue;
		      fill_out->opacity = fill_in->opacity;
		      fill_out->col_color = NULL;
		      if (fill_in->col_color != NULL)
			{
			    len = strlen (fill_in->col_color);
			    fill_out->col_color = malloc (len + 1);
			    strcpy (fill_out->col_color, fill_in->col_color);
			}
		      fill_out->col_opacity = NULL;
		      if (fill_in->col_opacity != NULL)
			{
			    len = strlen (fill_in->col_opacity);
			    fill_out->col_opacity = malloc (len + 1);
			    strcpy (fill_out->col_opacity,
				    fill_in->col_opacity);
			}
		      mark_out->fill = fill_out;
		  }
		mark_out->col_mark_type = NULL;
		if (mark_in->col_mark_type != NULL)
		  {
		      len = strlen (mark_in->col_mark_type);
		      mark_out->col_mark_type = malloc (len + 1);
		      strcpy (mark_out->col_mark_type, mark_in->col_mark_type);
		  }
		item_out->type = RL2_MARK_GRAPHIC;
		item_out->item = mark_out;
		item_out->next = NULL;
	    }
	  if (item_out != NULL)
	    {
		if (out->graphic->first == NULL)
		    out->graphic->first = item_out;
		if (out->graphic->last != NULL)
		    out->graphic->last->next = item_out;
		out->graphic->last = item_out;
	    }
	  item_in = item_in->next;
      }
    return out;
}

RL2_PRIVATE rl2PrivLineSymbolizerPtr
rl2_clone_line_symbolizer (rl2PrivLineSymbolizerPtr in)
{
/* cloning a Line Symbolizer */
    int len;
    rl2PrivLineSymbolizerPtr out;

    if (in == NULL)
	return NULL;
    out = malloc (sizeof (rl2PrivLineSymbolizer));
    if (out == NULL)
	return NULL;

    out->stroke = NULL;
    if (in->stroke != NULL)
      {
	  rl2PrivStrokePtr stroke_in = in->stroke;
	  rl2PrivStrokePtr stroke_out = malloc (sizeof (rl2PrivStroke));
	  stroke_out->graphic = NULL;
	  if (stroke_in->graphic != NULL)
	    {
		rl2PrivGraphicItemPtr gr_in;
		rl2PrivGraphicPtr ext_in = stroke_in->graphic;
		rl2PrivGraphicPtr ext_out = malloc (sizeof (rl2PrivGraphic));
		ext_out->first = NULL;
		ext_out->last = NULL;
		gr_in = ext_in->first;
		while (gr_in != NULL)
		  {
		      if (gr_in->type == RL2_EXTERNAL_GRAPHIC)
			{
			    rl2PrivColorReplacementPtr repl_in;
			    rl2PrivExternalGraphicPtr eg_in = gr_in->item;
			    rl2PrivExternalGraphicPtr eg_out =
				malloc (sizeof (rl2PrivExternalGraphic));
			    rl2PrivGraphicItemPtr gr_out =
				malloc (sizeof (rl2PrivGraphicItem));
			    eg_out->first = NULL;
			    eg_out->last = NULL;
			    repl_in = eg_in->first;
			    while (repl_in != NULL)
			      {
				  rl2PrivColorReplacementPtr repl_out =
				      malloc (sizeof (rl2PrivColorReplacement));
				  repl_out->index = repl_in->index;
				  repl_out->red = repl_in->red;
				  repl_out->green = repl_in->green;
				  repl_out->blue = repl_in->blue;
				  repl_out->col_color = NULL;
				  if (repl_in->col_color != NULL)
				    {
					len = strlen (repl_in->col_color);
					repl_out->col_color = malloc (len + 1);
					strcpy (repl_out->col_color,
						repl_in->col_color);
				    }
				  repl_out->next = NULL;
				  if (eg_out->first == NULL)
				      eg_out->first = repl_out;
				  if (eg_out->last != NULL)
				      eg_out->last->next = repl_out;
				  eg_out->last = repl_out;
				  repl_in = repl_in->next;
			      }
			    eg_out->xlink_href = NULL;
			    if (eg_in->xlink_href != NULL)
			      {
				  len = strlen (eg_in->xlink_href);
				  eg_out->xlink_href = malloc (len + 1);
				  strcpy (eg_out->xlink_href,
					  eg_in->xlink_href);
			      }
			    eg_out->col_href = NULL;
			    if (eg_in->col_href != NULL)
			      {
				  len = strlen (eg_in->col_href);
				  eg_out->col_href = malloc (len + 1);
				  strcpy (eg_out->col_href, eg_in->col_href);
			      }
			    gr_out->type = gr_in->type;
			    gr_out->item = eg_out;
			    gr_out->next = NULL;
			    if (ext_out->first == NULL)
				ext_out->first = gr_out;
			    if (ext_out->last != NULL)
				ext_out->last->next = gr_out;
			    ext_out->last = gr_out;
			}
		      gr_in = gr_in->next;
		  }
		ext_out->opacity = ext_in->opacity;
		ext_out->size = ext_in->size;
		ext_out->rotation = ext_in->rotation;
		ext_out->anchor_point_x = ext_in->anchor_point_x;
		ext_out->anchor_point_y = ext_in->anchor_point_y;
		ext_out->displacement_x = ext_in->displacement_x;
		ext_out->displacement_y = ext_in->displacement_y;
		ext_out->col_opacity = NULL;
		ext_out->col_rotation = NULL;
		ext_out->col_size = NULL;
		ext_out->col_point_x = NULL;
		ext_out->col_point_y = NULL;
		ext_out->col_displ_x = NULL;
		ext_out->col_displ_y = NULL;
		stroke_out->graphic = ext_out;
	    }
	  stroke_out->red = stroke_in->red;
	  stroke_out->green = stroke_in->green;
	  stroke_out->blue = stroke_in->blue;
	  stroke_out->opacity = stroke_in->opacity;
	  stroke_out->width = stroke_in->width;
	  stroke_out->linejoin = stroke_in->linejoin;
	  stroke_out->linecap = stroke_in->linecap;
	  stroke_out->dash_count = stroke_in->dash_count;
	  stroke_out->dash_list = NULL;
	  if (stroke_in->dash_count > 0)
	    {
		int i;
		stroke_out->dash_list =
		    malloc (sizeof (double) * stroke_out->dash_count);
		for (i = 0; i < stroke_out->dash_count; i++)
		    *(stroke_out->dash_list + i) = *(stroke_in->dash_list + i);
	    }
	  stroke_out->dash_offset = stroke_in->dash_offset;
	  stroke_out->col_color = NULL;
	  if (stroke_in->col_color != NULL)
	    {
		len = strlen (stroke_in->col_color);
		stroke_out->col_color = malloc (len + 1);
		strcpy (stroke_out->col_color, stroke_in->col_color);
	    }
	  stroke_out->col_opacity = NULL;
	  if (stroke_in->col_opacity != NULL)
	    {
		len = strlen (stroke_in->col_opacity);
		stroke_out->col_opacity = malloc (len + 1);
		strcpy (stroke_out->col_opacity, stroke_in->col_opacity);
	    }
	  stroke_out->col_width = NULL;
	  if (stroke_in->col_width != NULL)
	    {
		len = strlen (stroke_in->col_width);
		stroke_out->col_width = malloc (len + 1);
		strcpy (stroke_out->col_width, stroke_in->col_width);
	    }
	  stroke_out->col_join = NULL;
	  if (stroke_in->col_join != NULL)
	    {
		len = strlen (stroke_in->col_join);
		stroke_out->col_join = malloc (len + 1);
		strcpy (stroke_out->col_join, stroke_in->col_join);
	    }
	  stroke_out->col_cap = NULL;
	  if (stroke_in->col_cap != NULL)
	    {
		len = strlen (stroke_in->col_cap);
		stroke_out->col_cap = malloc (len + 1);
		strcpy (stroke_out->col_cap, stroke_in->col_cap);
	    }
	  stroke_out->col_dash = NULL;
	  if (stroke_in->col_dash != NULL)
	    {
		len = strlen (stroke_in->col_dash);
		stroke_out->col_dash = malloc (len + 1);
		strcpy (stroke_out->col_dash, stroke_in->col_dash);
	    }
	  stroke_out->col_dashoff = NULL;
	  if (stroke_in->col_dashoff != NULL)
	    {
		len = strlen (stroke_in->col_dashoff);
		stroke_out->col_dashoff = malloc (len + 1);
		strcpy (stroke_out->col_dashoff, stroke_in->col_dashoff);
	    }
	  out->stroke = stroke_out;
      }
    out->perpendicular_offset = in->perpendicular_offset;
    out->col_perpoff = NULL;
    if (in->col_perpoff != NULL)
      {
	  len = strlen (in->col_perpoff);
	  out->col_perpoff = malloc (len + 1);
	  strcpy (out->col_perpoff, in->col_perpoff);
      }

    return out;
}

RL2_PRIVATE rl2PrivPolygonSymbolizerPtr
rl2_clone_polygon_symbolizer (rl2PrivPolygonSymbolizerPtr in)
{
/* cloning a Polygon Symbolizer */
    int len;
    rl2PrivPolygonSymbolizerPtr out;

    if (in == NULL)
	return NULL;
    out = malloc (sizeof (rl2PrivPolygonSymbolizer));
    if (out == NULL)
	return NULL;

    out->stroke = NULL;
    if (in->stroke != NULL)
      {
	  rl2PrivStrokePtr stroke_in = in->stroke;
	  rl2PrivStrokePtr stroke_out = malloc (sizeof (rl2PrivStroke));
	  stroke_out->graphic = NULL;
	  if (stroke_in->graphic != NULL)
	    {
		rl2PrivGraphicItemPtr gr_in;
		rl2PrivGraphicPtr ext_in = stroke_in->graphic;
		rl2PrivGraphicPtr ext_out = malloc (sizeof (rl2PrivGraphic));
		ext_out->first = NULL;
		ext_out->last = NULL;
		gr_in = ext_in->first;
		while (gr_in != NULL)
		  {
		      if (gr_in->type == RL2_EXTERNAL_GRAPHIC)
			{
			    rl2PrivColorReplacementPtr repl_in;
			    rl2PrivExternalGraphicPtr eg_in = gr_in->item;
			    rl2PrivExternalGraphicPtr eg_out =
				malloc (sizeof (rl2PrivExternalGraphic));
			    rl2PrivGraphicItemPtr gr_out =
				malloc (sizeof (rl2PrivGraphicItem));
			    eg_out->first = NULL;
			    eg_out->last = NULL;
			    repl_in = eg_in->first;
			    while (repl_in != NULL)
			      {
				  rl2PrivColorReplacementPtr repl_out =
				      malloc (sizeof (rl2PrivColorReplacement));
				  repl_out->index = repl_in->index;
				  repl_out->red = repl_in->red;
				  repl_out->green = repl_in->green;
				  repl_out->blue = repl_in->blue;
				  repl_out->col_color = NULL;
				  if (repl_in->col_color != NULL)
				    {
					len = strlen (repl_in->col_color);
					repl_out->col_color = malloc (len + 1);
					strcpy (repl_out->col_color,
						repl_in->col_color);
				    }
				  repl_out->next = NULL;
				  if (eg_out->first == NULL)
				      eg_out->first = repl_out;
				  if (eg_out->last != NULL)
				      eg_out->last->next = repl_out;
				  eg_out->last = repl_out;
				  repl_in = repl_in->next;
			      }
			    eg_out->xlink_href = NULL;
			    if (eg_in->xlink_href != NULL)
			      {
				  len = strlen (eg_in->xlink_href);
				  eg_out->xlink_href = malloc (len + 1);
				  strcpy (eg_out->xlink_href,
					  eg_in->xlink_href);
			      }
			    eg_out->col_href = NULL;
			    if (eg_in->col_href != NULL)
			      {
				  len = strlen (eg_in->col_href);
				  eg_out->col_href = malloc (len + 1);
				  strcpy (eg_out->col_href, eg_in->col_href);
			      }
			    gr_out->type = gr_in->type;
			    gr_out->item = eg_out;
			    gr_out->next = NULL;
			    if (ext_out->first == NULL)
				ext_out->first = gr_out;
			    if (ext_out->last != NULL)
				ext_out->last->next = gr_out;
			    ext_out->last = gr_out;
			}
		      gr_in = gr_in->next;
		  }
		ext_out->opacity = ext_in->opacity;
		ext_out->size = ext_in->size;
		ext_out->rotation = ext_in->rotation;
		ext_out->anchor_point_x = ext_in->anchor_point_x;
		ext_out->anchor_point_y = ext_in->anchor_point_y;
		ext_out->displacement_x = ext_in->displacement_x;
		ext_out->displacement_y = ext_in->displacement_y;
		ext_out->col_opacity = NULL;
		ext_out->col_rotation = NULL;
		ext_out->col_size = NULL;
		ext_out->col_point_x = NULL;
		ext_out->col_point_y = NULL;
		ext_out->col_displ_x = NULL;
		ext_out->col_displ_y = NULL;
		stroke_out->graphic = ext_out;
	    }
	  stroke_out->red = stroke_in->red;
	  stroke_out->green = stroke_in->green;
	  stroke_out->blue = stroke_in->blue;
	  stroke_out->opacity = stroke_in->opacity;
	  stroke_out->width = stroke_in->width;
	  stroke_out->linejoin = stroke_in->linejoin;
	  stroke_out->linecap = stroke_in->linecap;
	  stroke_out->dash_count = stroke_in->dash_count;
	  stroke_out->dash_list = NULL;
	  if (stroke_in->dash_count > 0)
	    {
		int i;
		stroke_out->dash_list =
		    malloc (sizeof (double) * stroke_out->dash_count);
		for (i = 0; i < stroke_out->dash_count; i++)
		    *(stroke_out->dash_list + i) = *(stroke_in->dash_list + i);
	    }
	  stroke_out->dash_offset = stroke_in->dash_offset;
	  stroke_out->col_color = NULL;
	  if (stroke_in->col_color != NULL)
	    {
		len = strlen (stroke_in->col_color);
		stroke_out->col_color = malloc (len + 1);
		strcpy (stroke_out->col_color, stroke_in->col_color);
	    }
	  stroke_out->col_opacity = NULL;
	  if (stroke_in->col_opacity != NULL)
	    {
		len = strlen (stroke_in->col_opacity);
		stroke_out->col_opacity = malloc (len + 1);
		strcpy (stroke_out->col_opacity, stroke_in->col_opacity);
	    }
	  stroke_out->col_width = NULL;
	  if (stroke_in->col_width != NULL)
	    {
		len = strlen (stroke_in->col_width);
		stroke_out->col_width = malloc (len + 1);
		strcpy (stroke_out->col_width, stroke_in->col_width);
	    }
	  stroke_out->col_join = NULL;
	  if (stroke_in->col_join != NULL)
	    {
		len = strlen (stroke_in->col_join);
		stroke_out->col_join = malloc (len + 1);
		strcpy (stroke_out->col_join, stroke_in->col_join);
	    }
	  stroke_out->col_cap = NULL;
	  if (stroke_in->col_cap != NULL)
	    {
		len = strlen (stroke_in->col_cap);
		stroke_out->col_cap = malloc (len + 1);
		strcpy (stroke_out->col_cap, stroke_in->col_cap);
	    }
	  stroke_out->col_dash = NULL;
	  if (stroke_in->col_dash != NULL)
	    {
		len = strlen (stroke_in->col_dash);
		stroke_out->col_dash = malloc (len + 1);
		strcpy (stroke_out->col_dash, stroke_in->col_dash);
	    }
	  stroke_out->col_dashoff = NULL;
	  if (stroke_in->col_dashoff != NULL)
	    {
		len = strlen (stroke_in->col_dashoff);
		stroke_out->col_dashoff = malloc (len + 1);
		strcpy (stroke_out->col_dashoff, stroke_in->col_dashoff);
	    }
	  out->stroke = stroke_out;
      }
    out->fill = NULL;
    if (in->fill != NULL)
      {
	  rl2PrivFillPtr fill_in = in->fill;
	  rl2PrivFillPtr fill_out = malloc (sizeof (rl2PrivFill));
	  fill_out->graphic = NULL;
	  if (fill_in->graphic != NULL)
	    {
		rl2PrivGraphicItemPtr gr_in;
		rl2PrivGraphicPtr ext_in = fill_in->graphic;
		rl2PrivGraphicPtr ext_out = malloc (sizeof (rl2PrivGraphic));
		ext_out->first = NULL;
		ext_out->last = NULL;
		gr_in = ext_in->first;
		while (gr_in != NULL)
		  {
		      if (gr_in->type == RL2_EXTERNAL_GRAPHIC)
			{
			    rl2PrivColorReplacementPtr repl_in;
			    rl2PrivExternalGraphicPtr eg_in = gr_in->item;
			    rl2PrivExternalGraphicPtr eg_out =
				malloc (sizeof (rl2PrivExternalGraphic));
			    rl2PrivGraphicItemPtr gr_out =
				malloc (sizeof (rl2PrivGraphicItem));
			    eg_out->first = NULL;
			    eg_out->last = NULL;
			    repl_in = eg_in->first;
			    while (repl_in != NULL)
			      {
				  rl2PrivColorReplacementPtr repl_out =
				      malloc (sizeof (rl2PrivColorReplacement));
				  repl_out->index = repl_in->index;
				  repl_out->red = repl_in->red;
				  repl_out->green = repl_in->green;
				  repl_out->blue = repl_in->blue;
				  repl_out->col_color = NULL;
				  if (repl_in->col_color != NULL)
				    {
					len = strlen (repl_in->col_color);
					repl_out->col_color = malloc (len + 1);
					strcpy (repl_out->col_color,
						repl_in->col_color);
				    }
				  repl_out->next = NULL;
				  if (eg_out->first == NULL)
				      eg_out->first = repl_out;
				  if (eg_out->last != NULL)
				      eg_out->last->next = repl_out;
				  eg_out->last = repl_out;
				  repl_in = repl_in->next;
			      }
			    eg_out->xlink_href = NULL;
			    if (eg_in->xlink_href != NULL)
			      {
				  len = strlen (eg_in->xlink_href);
				  eg_out->xlink_href = malloc (len + 1);
				  strcpy (eg_out->xlink_href,
					  eg_in->xlink_href);
			      }
			    eg_out->col_href = NULL;
			    if (eg_in->col_href != NULL)
			      {
				  len = strlen (eg_in->col_href);
				  eg_out->col_href = malloc (len + 1);
				  strcpy (eg_out->col_href, eg_in->col_href);
			      }
			    gr_out->type = gr_in->type;
			    gr_out->item = eg_out;
			    gr_out->next = NULL;
			    if (ext_out->first == NULL)
				ext_out->first = gr_out;
			    if (ext_out->last != NULL)
				ext_out->last->next = gr_out;
			    ext_out->last = gr_out;
			}
		      gr_in = gr_in->next;
		  }
		ext_out->opacity = ext_in->opacity;
		ext_out->size = ext_in->size;
		ext_out->rotation = ext_in->rotation;
		ext_out->anchor_point_x = ext_in->anchor_point_x;
		ext_out->anchor_point_y = ext_in->anchor_point_y;
		ext_out->displacement_x = ext_in->displacement_x;
		ext_out->displacement_y = ext_in->displacement_y;
		ext_out->col_opacity = NULL;
		ext_out->col_rotation = NULL;
		ext_out->col_size = NULL;
		ext_out->col_point_x = NULL;
		ext_out->col_point_y = NULL;
		ext_out->col_displ_x = NULL;
		ext_out->col_displ_y = NULL;
		fill_out->graphic = ext_out;
	    }
	  fill_out->red = fill_in->red;
	  fill_out->green = fill_in->green;
	  fill_out->blue = fill_in->blue;
	  fill_out->opacity = fill_in->opacity;
	  fill_out->col_color = NULL;
	  if (fill_in->col_color != NULL)
	    {
		len = strlen (fill_in->col_color);
		fill_out->col_color = malloc (len + 1);
		strcpy (fill_out->col_color, fill_in->col_color);
	    }
	  fill_out->col_opacity = NULL;
	  if (fill_in->col_opacity != NULL)
	    {
		len = strlen (fill_in->col_opacity);
		fill_out->col_opacity = malloc (len + 1);
		strcpy (fill_out->col_opacity, fill_in->col_opacity);
	    }
	  out->fill = fill_out;
      }
    out->displacement_x = in->displacement_x;
    out->displacement_y = in->displacement_y;
    out->perpendicular_offset = in->perpendicular_offset;
    out->col_displ_x = NULL;
    if (in->col_displ_x != NULL)
      {
	  len = strlen (in->col_displ_x);
	  out->col_displ_x = malloc (len + 1);
	  strcpy (out->col_displ_x, in->col_displ_x);
      }
    out->col_displ_y = NULL;
    if (in->col_displ_y != NULL)
      {
	  len = strlen (in->col_displ_y);
	  out->col_displ_y = malloc (len + 1);
	  strcpy (out->col_displ_y, in->col_displ_y);
      }
    out->col_perpoff = NULL;
    if (in->col_perpoff != NULL)
      {
	  len = strlen (in->col_perpoff);
	  out->col_perpoff = malloc (len + 1);
	  strcpy (out->col_perpoff, in->col_perpoff);
      }

    return out;
}

RL2_PRIVATE rl2PrivTextSymbolizerPtr
rl2_clone_text_symbolizer (rl2PrivTextSymbolizerPtr in)
{
/* cloning a Text Symbolizer */
    int i;
    int len;
    rl2PrivTextSymbolizerPtr out;

    if (in == NULL)
	return NULL;
    out = malloc (sizeof (rl2PrivTextSymbolizer));
    if (out == NULL)
	return NULL;

    out->label = NULL;
    if (in->label != NULL)
      {
	  len = strlen (in->label);
	  out->label = malloc (len + 1);
	  strcpy (out->label, in->label);
      }
    out->col_label = NULL;
    if (in->col_label != NULL)
      {
	  len = strlen (in->col_label);
	  out->col_label = malloc (len + 1);
	  strcpy (out->col_label, in->col_label);
      }
    out->col_font = NULL;
    if (in->col_font != NULL)
      {
	  len = strlen (in->col_font);
	  out->col_font = malloc (len + 1);
	  strcpy (out->col_font, in->col_font);
      }
    out->col_style = NULL;
    if (in->col_style != NULL)
      {
	  len = strlen (in->col_style);
	  out->col_style = malloc (len + 1);
	  strcpy (out->col_style, in->col_style);
      }
    out->col_weight = NULL;
    if (in->col_weight != NULL)
      {
	  len = strlen (in->col_weight);
	  out->col_weight = malloc (len + 1);
	  strcpy (out->col_weight, in->col_weight);
      }
    out->col_size = NULL;
    if (in->col_size != NULL)
      {
	  len = strlen (in->col_size);
	  out->col_size = malloc (len + 1);
	  strcpy (out->col_size, in->col_size);
      }
    out->font_families_count = in->font_families_count;
    for (i = 0; i < RL2_MAX_FONT_FAMILIES; i++)
      {
	  *(out->font_families + i) = NULL;
	  if (*(in->font_families + i) != NULL)
	    {
		len = strlen (*(in->font_families + i));
		*(out->font_families + i) = malloc (len + 1);
		strcpy (*(out->font_families + i), *(in->font_families + i));
	    }
      }
    out->font_style = in->font_style;
    out->font_weight = in->font_weight;
    out->font_size = in->font_size;
    out->label_placement_type = in->label_placement_type;
    out->label_placement = NULL;
    if (in->label_placement != NULL)
      {
	  if (in->label_placement_type == RL2_LABEL_PLACEMENT_POINT)
	    {
		rl2PrivPointPlacementPtr pl_in = in->label_placement;
		rl2PrivPointPlacementPtr pl_out =
		    malloc (sizeof (rl2PrivPointPlacement));
		pl_out->anchor_point_x = pl_in->anchor_point_x;
		pl_out->anchor_point_y = pl_in->anchor_point_y;
		pl_out->displacement_x = pl_in->displacement_x;
		pl_out->displacement_y = pl_in->displacement_y;
		pl_out->rotation = pl_in->rotation;
		pl_out->col_point_x = NULL;
		if (pl_in->col_point_x != NULL)
		  {
		      len = strlen (pl_in->col_point_x);
		      pl_out->col_point_x = malloc (len + 1);
		      strcpy (pl_out->col_point_x, pl_in->col_point_x);
		  }
		pl_out->col_point_y = NULL;
		if (pl_in->col_point_y != NULL)
		  {
		      len = strlen (pl_in->col_point_y);
		      pl_out->col_point_y = malloc (len + 1);
		      strcpy (pl_out->col_point_y, pl_in->col_point_y);
		  }
		pl_out->col_displ_x = NULL;
		if (pl_in->col_displ_x != NULL)
		  {
		      len = strlen (pl_in->col_displ_x);
		      pl_out->col_displ_x = malloc (len + 1);
		      strcpy (pl_out->col_displ_x, pl_in->col_displ_x);
		  }
		pl_out->col_displ_y = NULL;
		if (pl_in->col_displ_y != NULL)
		  {
		      len = strlen (pl_in->col_displ_x);
		      pl_out->col_displ_y = malloc (len + 1);
		      strcpy (pl_out->col_displ_y, pl_in->col_displ_y);
		  }
		pl_out->col_rotation = NULL;
		if (pl_in->col_rotation != NULL)
		  {
		      len = strlen (pl_in->col_rotation);
		      pl_out->col_rotation = malloc (len + 1);
		      strcpy (pl_out->col_rotation, pl_in->col_rotation);
		  }
		out->label_placement = pl_out;
	    }
	  if (in->label_placement_type == RL2_LABEL_PLACEMENT_LINE)
	    {
		rl2PrivLinePlacementPtr pl_in = in->label_placement;
		rl2PrivLinePlacementPtr pl_out =
		    malloc (sizeof (rl2PrivLinePlacement));
		pl_out->perpendicular_offset = pl_in->perpendicular_offset;
		pl_out->is_repeated = pl_in->is_repeated;
		pl_out->initial_gap = pl_in->initial_gap;
		pl_out->gap = pl_in->gap;
		pl_out->is_aligned = pl_in->is_aligned;
		pl_out->generalize_line = pl_in->generalize_line;
		pl_out->col_perpoff = NULL;
		if (pl_in->col_perpoff != NULL)
		  {
		      len = strlen (pl_in->col_perpoff);
		      pl_out->col_perpoff = malloc (len + 1);
		      strcpy (pl_out->col_perpoff, pl_in->col_perpoff);
		  }
		pl_out->col_inigap = NULL;
		if (pl_in->col_inigap != NULL)
		  {
		      len = strlen (pl_in->col_inigap);
		      pl_out->col_inigap = malloc (len + 1);
		      strcpy (pl_out->col_inigap, pl_in->col_inigap);
		  }
		pl_out->col_gap = NULL;
		if (pl_in->col_gap != NULL)
		  {
		      len = strlen (pl_in->col_gap);
		      pl_out->col_gap = malloc (len + 1);
		      strcpy (pl_out->col_gap, pl_in->col_gap);
		  }
		out->label_placement = pl_out;
	    }
      }
    out->halo = NULL;
    if (in->halo != NULL)
      {
	  rl2PrivHaloPtr halo_in = in->halo;
	  rl2PrivHaloPtr halo_out = malloc (sizeof (rl2PrivHalo));
	  halo_out->radius = halo_in->radius;
	  halo_out->fill = NULL;
	  if (halo_in->fill != NULL)
	    {
		rl2PrivFillPtr fill_in = halo_in->fill;
		rl2PrivFillPtr fill_out = malloc (sizeof (rl2PrivFill));
		fill_out->graphic = NULL;
		fill_out->red = fill_in->red;
		fill_out->green = fill_in->green;
		fill_out->blue = fill_in->blue;
		fill_out->opacity = fill_in->opacity;
		fill_out->col_color = NULL;
		if (fill_in->col_color != NULL)
		  {
		      len = strlen (fill_in->col_color);
		      fill_out->col_color = malloc (len + 1);
		      strcpy (fill_out->col_color, fill_in->col_color);
		  }
		fill_out->col_opacity = NULL;
		if (fill_in->col_opacity != NULL)
		  {
		      len = strlen (fill_in->col_opacity);
		      fill_out->col_opacity = malloc (len + 1);
		      strcpy (fill_out->col_opacity, fill_in->col_opacity);
		  }
		halo_out->fill = fill_out;
	    }
	  halo_out->col_radius = NULL;
	  if (halo_in->col_radius != NULL)
	    {
		len = strlen (halo_in->col_radius);
		halo_out->col_radius = malloc (len + 1);
		strcpy (halo_out->col_radius, halo_in->col_radius);
	    }
	  out->halo = halo_out;
      }
    out->fill = NULL;
    if (in->fill != NULL)
      {
	  rl2PrivFillPtr fill_in = in->fill;
	  rl2PrivFillPtr fill_out = malloc (sizeof (rl2PrivFill));
	  fill_out->graphic = NULL;
	  fill_out->red = fill_in->red;
	  fill_out->green = fill_in->green;
	  fill_out->blue = fill_in->blue;
	  fill_out->opacity = fill_in->opacity;
	  fill_out->col_color = NULL;
	  if (fill_in->col_color != NULL)
	    {
		len = strlen (fill_in->col_color);
		fill_out->col_color = malloc (len + 1);
		strcpy (fill_out->col_color, fill_in->col_color);
	    }
	  fill_out->col_opacity = NULL;
	  if (fill_in->col_opacity != NULL)
	    {
		len = strlen (fill_in->col_opacity);
		fill_out->col_opacity = malloc (len + 1);
		strcpy (fill_out->col_opacity, fill_in->col_opacity);
	    }
	  out->fill = fill_out;
      }

    return out;
}

Changes to test/Makefile.am.

15
16
17
18
19
20
21

22

23
24
25

26
27
28
29
30
31
32
	test_map_rgb test_map_gray \
	test_map_srtm test_map_mono \
	test_map_indiana test_load_wms \
	test_map_noref test_map_trento \
	test_map_trieste test_map_infrared \
	test_map_orbetello test_raster_symbolizer \
	test_svg test_raw test_openjpeg \

	test_line_symbolizer test_polygon_symbolizer \

	test_point_symbolizer test_text_symbolizer \
	test_vectors test_font test_copy_rastercov \
	test_tile_callback test_map_vector


AM_CPPFLAGS = -I@srcdir@/../headers @LIBXML2_CFLAGS@
AM_LDFLAGS = -L../src -lrasterlite2 @LIBCAIRO_LIBS@ @LIBPNG_LIBS@ \
	@LIBWEBP_LIBS@ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ \
	@LIBCURL_LIBS@ @LIBXML2_LIBS@  @LIBFREETYPE2_LIBS@ \
	$(GCOV_FLAGS)








>
|
>
|

|
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
	test_map_rgb test_map_gray \
	test_map_srtm test_map_mono \
	test_map_indiana test_load_wms \
	test_map_noref test_map_trento \
	test_map_trieste test_map_infrared \
	test_map_orbetello test_raster_symbolizer \
	test_svg test_raw test_openjpeg \
	test_line_symbolizer test_line_symbolizer_col \
	test_polygon_symbolizer test_polygon_symbolizer_col \
	test_point_symbolizer test_point_symbolizer_col \
	test_text_symbolizer test_text_symbolizer_col \
	test_vectors test_font test_copy_rastercov \
	test_tile_callback test_map_vector \
	test_col_symbolizers

AM_CPPFLAGS = -I@srcdir@/../headers @LIBXML2_CFLAGS@
AM_LDFLAGS = -L../src -lrasterlite2 @LIBCAIRO_LIBS@ @LIBPNG_LIBS@ \
	@LIBWEBP_LIBS@ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ \
	@LIBCURL_LIBS@ @LIBXML2_LIBS@  @LIBFREETYPE2_LIBS@ \
	$(GCOV_FLAGS)

Changes to test/Makefile.in.

105
106
107
108
109
110
111


112



113
114

115
116

117
118
119
120
121
122
123
...
190
191
192
193
194
195
196



197
198
199
200
201
202
203
...
205
206
207
208
209
210
211



212
213
214
215
216
217
218
...
280
281
282
283
284
285
286




287
288
289




290
291
292
293
294
295
296
...
301
302
303
304
305
306
307



308
309
310
311
312
313
314
...
359
360
361
362
363
364
365
366
367

368
369
370
371
372
373
374
375
376

377
378
379
380
381
382
383
384
385

386
387
388
389
390
391
392
393
394

395
396
397
398
399
400
401
402
403
....
1016
1017
1018
1019
1020
1021
1022




1023
1024
1025
1026
1027
1028
1029
....
1036
1037
1038
1039
1040
1041
1042




1043
1044
1045
1046
1047
1048
1049
....
1136
1137
1138
1139
1140
1141
1142




1143
1144
1145
1146




1147
1148
1149
1150
1151
1152
1153
....
1164
1165
1166
1167
1168
1169
1170




1171
1172
1173
1174
1175
1176
1177
....
1220
1221
1222
1223
1224
1225
1226

1227
1228
1229
1230
1231

1232
1233
1234
1235
1236
1237
1238
....
1250
1251
1252
1253
1254
1255
1256

1257

1258
1259
1260
1261
1262
1263

1264
1265
1266
1267
1268
1269
1270
....
1931
1932
1933
1934
1935
1936
1937







1938
1939
1940







1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951







1952
1953
1954







1955
1956
1957
1958
1959
1960
1961
....
1983
1984
1985
1986
1987
1988
1989







1990
1991
1992
1993
1994
1995
1996
	test_map_rgb$(EXEEXT) test_map_gray$(EXEEXT) \
	test_map_srtm$(EXEEXT) test_map_mono$(EXEEXT) \
	test_map_indiana$(EXEEXT) test_load_wms$(EXEEXT) \
	test_map_noref$(EXEEXT) test_map_trento$(EXEEXT) \
	test_map_trieste$(EXEEXT) test_map_infrared$(EXEEXT) \
	test_map_orbetello$(EXEEXT) test_raster_symbolizer$(EXEEXT) \
	test_svg$(EXEEXT) test_raw$(EXEEXT) test_openjpeg$(EXEEXT) \


	test_line_symbolizer$(EXEEXT) test_polygon_symbolizer$(EXEEXT) \



	test_point_symbolizer$(EXEEXT) test_text_symbolizer$(EXEEXT) \
	test_vectors$(EXEEXT) test_font$(EXEEXT) \

	test_copy_rastercov$(EXEEXT) test_tile_callback$(EXEEXT) \
	test_map_vector$(EXEEXT)

subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
................................................................................
test7_LDADD = $(LDADD)
test8_SOURCES = test8.c
test8_OBJECTS = test8.$(OBJEXT)
test8_LDADD = $(LDADD)
test9_SOURCES = test9.c
test9_OBJECTS = test9.$(OBJEXT)
test9_LDADD = $(LDADD)



test_copy_rastercov_SOURCES = test_copy_rastercov.c
test_copy_rastercov_OBJECTS = test_copy_rastercov.$(OBJEXT)
test_copy_rastercov_LDADD = $(LDADD)
test_coverage_SOURCES = test_coverage.c
test_coverage_OBJECTS = test_coverage.$(OBJEXT)
test_coverage_LDADD = $(LDADD)
test_font_SOURCES = test_font.c
................................................................................
test_font_LDADD = $(LDADD)
test_gif_SOURCES = test_gif.c
test_gif_OBJECTS = test_gif.$(OBJEXT)
test_gif_LDADD = $(LDADD)
test_line_symbolizer_SOURCES = test_line_symbolizer.c
test_line_symbolizer_OBJECTS = test_line_symbolizer.$(OBJEXT)
test_line_symbolizer_LDADD = $(LDADD)



test_load_wms_SOURCES = test_load_wms.c
test_load_wms_OBJECTS = test_load_wms.$(OBJEXT)
test_load_wms_LDADD = $(LDADD)
test_map_ascii_SOURCES = test_map_ascii.c
test_map_ascii_OBJECTS = test_map_ascii.$(OBJEXT)
test_map_ascii_LDADD = $(LDADD)
test_map_gray_SOURCES = test_map_gray.c
................................................................................
test_paint_LDADD = $(LDADD)
test_palette_SOURCES = test_palette.c
test_palette_OBJECTS = test_palette.$(OBJEXT)
test_palette_LDADD = $(LDADD)
test_point_symbolizer_SOURCES = test_point_symbolizer.c
test_point_symbolizer_OBJECTS = test_point_symbolizer.$(OBJEXT)
test_point_symbolizer_LDADD = $(LDADD)




test_polygon_symbolizer_SOURCES = test_polygon_symbolizer.c
test_polygon_symbolizer_OBJECTS = test_polygon_symbolizer.$(OBJEXT)
test_polygon_symbolizer_LDADD = $(LDADD)




test_raster_SOURCES = test_raster.c
test_raster_OBJECTS = test_raster.$(OBJEXT)
test_raster_LDADD = $(LDADD)
test_raster_symbolizer_SOURCES = test_raster_symbolizer.c
test_raster_symbolizer_OBJECTS = test_raster_symbolizer.$(OBJEXT)
test_raster_symbolizer_LDADD = $(LDADD)
test_raw_SOURCES = test_raw.c
................................................................................
test_section_LDADD = $(LDADD)
test_svg_SOURCES = test_svg.c
test_svg_OBJECTS = test_svg.$(OBJEXT)
test_svg_LDADD = $(LDADD)
test_text_symbolizer_SOURCES = test_text_symbolizer.c
test_text_symbolizer_OBJECTS = test_text_symbolizer.$(OBJEXT)
test_text_symbolizer_LDADD = $(LDADD)



test_tifin_SOURCES = test_tifin.c
test_tifin_OBJECTS = test_tifin.$(OBJEXT)
test_tifin_LDADD = $(LDADD)
test_tile_callback_SOURCES = test_tile_callback.c
test_tile_callback_OBJECTS = test_tile_callback.$(OBJEXT)
test_tile_callback_LDADD = $(LDADD)
test_vectors_SOURCES = test_vectors.c
................................................................................
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo "  CCLD    " $@;
am__v_CCLD_1 = 
SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c test13.c \
	test14.c test15.c test16.c test17.c test18.c test19.c test2.c \
	test20.c test3.c test4.c test5.c test6.c test7.c test8.c \
	test9.c test_copy_rastercov.c test_coverage.c test_font.c \
	test_gif.c test_line_symbolizer.c test_load_wms.c \

	test_map_ascii.c test_map_gray.c test_map_indiana.c \
	test_map_infrared.c test_map_mono.c test_map_nile_32.c \
	test_map_nile_8.c test_map_nile_dbl.c test_map_nile_flt.c \
	test_map_nile_u16.c test_map_nile_u32.c test_map_nile_u8.c \
	test_map_noref.c test_map_orbetello.c test_map_rgb.c \
	test_map_srtm.c test_map_trento.c test_map_trieste.c \
	test_map_vector.c test_mask.c test_openjpeg.c test_paint.c \
	test_palette.c test_point_symbolizer.c \
	test_polygon_symbolizer.c test_raster.c \

	test_raster_symbolizer.c test_raw.c test_section.c test_svg.c \
	test_text_symbolizer.c test_tifin.c test_tile_callback.c \
	test_vectors.c test_webp.c test_wms1.c test_wms2.c \
	test_wr_tiff.c
DIST_SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c \
	test13.c test14.c test15.c test16.c test17.c test18.c test19.c \
	test2.c test20.c test3.c test4.c test5.c test6.c test7.c \
	test8.c test9.c test_copy_rastercov.c test_coverage.c \
	test_font.c test_gif.c test_line_symbolizer.c test_load_wms.c \

	test_map_ascii.c test_map_gray.c test_map_indiana.c \
	test_map_infrared.c test_map_mono.c test_map_nile_32.c \
	test_map_nile_8.c test_map_nile_dbl.c test_map_nile_flt.c \
	test_map_nile_u16.c test_map_nile_u32.c test_map_nile_u8.c \
	test_map_noref.c test_map_orbetello.c test_map_rgb.c \
	test_map_srtm.c test_map_trento.c test_map_trieste.c \
	test_map_vector.c test_mask.c test_openjpeg.c test_paint.c \
	test_palette.c test_point_symbolizer.c \
	test_polygon_symbolizer.c test_raster.c \

	test_raster_symbolizer.c test_raw.c test_section.c test_svg.c \
	test_text_symbolizer.c test_tifin.c test_tile_callback.c \
	test_vectors.c test_webp.c test_wms1.c test_wms2.c \
	test_wr_tiff.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
................................................................................
test8$(EXEEXT): $(test8_OBJECTS) $(test8_DEPENDENCIES) $(EXTRA_test8_DEPENDENCIES) 
	@rm -f test8$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test8_OBJECTS) $(test8_LDADD) $(LIBS)

test9$(EXEEXT): $(test9_OBJECTS) $(test9_DEPENDENCIES) $(EXTRA_test9_DEPENDENCIES) 
	@rm -f test9$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test9_OBJECTS) $(test9_LDADD) $(LIBS)





test_copy_rastercov$(EXEEXT): $(test_copy_rastercov_OBJECTS) $(test_copy_rastercov_DEPENDENCIES) $(EXTRA_test_copy_rastercov_DEPENDENCIES) 
	@rm -f test_copy_rastercov$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_copy_rastercov_OBJECTS) $(test_copy_rastercov_LDADD) $(LIBS)

test_coverage$(EXEEXT): $(test_coverage_OBJECTS) $(test_coverage_DEPENDENCIES) $(EXTRA_test_coverage_DEPENDENCIES) 
	@rm -f test_coverage$(EXEEXT)
................................................................................
test_gif$(EXEEXT): $(test_gif_OBJECTS) $(test_gif_DEPENDENCIES) $(EXTRA_test_gif_DEPENDENCIES) 
	@rm -f test_gif$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_gif_OBJECTS) $(test_gif_LDADD) $(LIBS)

test_line_symbolizer$(EXEEXT): $(test_line_symbolizer_OBJECTS) $(test_line_symbolizer_DEPENDENCIES) $(EXTRA_test_line_symbolizer_DEPENDENCIES) 
	@rm -f test_line_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_line_symbolizer_OBJECTS) $(test_line_symbolizer_LDADD) $(LIBS)





test_load_wms$(EXEEXT): $(test_load_wms_OBJECTS) $(test_load_wms_DEPENDENCIES) $(EXTRA_test_load_wms_DEPENDENCIES) 
	@rm -f test_load_wms$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_load_wms_OBJECTS) $(test_load_wms_LDADD) $(LIBS)

test_map_ascii$(EXEEXT): $(test_map_ascii_OBJECTS) $(test_map_ascii_DEPENDENCIES) $(EXTRA_test_map_ascii_DEPENDENCIES) 
	@rm -f test_map_ascii$(EXEEXT)
................................................................................
test_palette$(EXEEXT): $(test_palette_OBJECTS) $(test_palette_DEPENDENCIES) $(EXTRA_test_palette_DEPENDENCIES) 
	@rm -f test_palette$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_palette_OBJECTS) $(test_palette_LDADD) $(LIBS)

test_point_symbolizer$(EXEEXT): $(test_point_symbolizer_OBJECTS) $(test_point_symbolizer_DEPENDENCIES) $(EXTRA_test_point_symbolizer_DEPENDENCIES) 
	@rm -f test_point_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_point_symbolizer_OBJECTS) $(test_point_symbolizer_LDADD) $(LIBS)





test_polygon_symbolizer$(EXEEXT): $(test_polygon_symbolizer_OBJECTS) $(test_polygon_symbolizer_DEPENDENCIES) $(EXTRA_test_polygon_symbolizer_DEPENDENCIES) 
	@rm -f test_polygon_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_polygon_symbolizer_OBJECTS) $(test_polygon_symbolizer_LDADD) $(LIBS)





test_raster$(EXEEXT): $(test_raster_OBJECTS) $(test_raster_DEPENDENCIES) $(EXTRA_test_raster_DEPENDENCIES) 
	@rm -f test_raster$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_raster_OBJECTS) $(test_raster_LDADD) $(LIBS)

test_raster_symbolizer$(EXEEXT): $(test_raster_symbolizer_OBJECTS) $(test_raster_symbolizer_DEPENDENCIES) $(EXTRA_test_raster_symbolizer_DEPENDENCIES) 
	@rm -f test_raster_symbolizer$(EXEEXT)
................................................................................
test_svg$(EXEEXT): $(test_svg_OBJECTS) $(test_svg_DEPENDENCIES) $(EXTRA_test_svg_DEPENDENCIES) 
	@rm -f test_svg$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_svg_OBJECTS) $(test_svg_LDADD) $(LIBS)

test_text_symbolizer$(EXEEXT): $(test_text_symbolizer_OBJECTS) $(test_text_symbolizer_DEPENDENCIES) $(EXTRA_test_text_symbolizer_DEPENDENCIES) 
	@rm -f test_text_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_text_symbolizer_OBJECTS) $(test_text_symbolizer_LDADD) $(LIBS)





test_tifin$(EXEEXT): $(test_tifin_OBJECTS) $(test_tifin_DEPENDENCIES) $(EXTRA_test_tifin_DEPENDENCIES) 
	@rm -f test_tifin$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_tifin_OBJECTS) $(test_tifin_LDADD) $(LIBS)

test_tile_callback$(EXEEXT): $(test_tile_callback_OBJECTS) $(test_tile_callback_DEPENDENCIES) $(EXTRA_test_tile_callback_DEPENDENCIES) 
	@rm -f test_tile_callback$(EXEEXT)
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test4.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test7.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test8.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test9.Po@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_copy_rastercov.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_coverage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_font.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gif.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_line_symbolizer.Po@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_load_wms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_ascii.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_gray.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_indiana.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_infrared.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_mono.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_nile_32.Po@am__quote@
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_trieste.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_vector.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mask.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_openjpeg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_paint.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_palette.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_point_symbolizer.Po@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_polygon_symbolizer.Po@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raster.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raster_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_section.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_svg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_text_symbolizer.Po@am__quote@

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tifin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tile_callback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vectors.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_webp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wms1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wms2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wr_tiff.Po@am__quote@
................................................................................
test_line_symbolizer.log: test_line_symbolizer$(EXEEXT)
	@p='test_line_symbolizer$(EXEEXT)'; \
	b='test_line_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)







test_polygon_symbolizer.log: test_polygon_symbolizer$(EXEEXT)
	@p='test_polygon_symbolizer$(EXEEXT)'; \
	b='test_polygon_symbolizer'; \







	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_point_symbolizer.log: test_point_symbolizer$(EXEEXT)
	@p='test_point_symbolizer$(EXEEXT)'; \
	b='test_point_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)







test_text_symbolizer.log: test_text_symbolizer$(EXEEXT)
	@p='test_text_symbolizer$(EXEEXT)'; \
	b='test_text_symbolizer'; \







	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_vectors.log: test_vectors$(EXEEXT)
	@p='test_vectors$(EXEEXT)'; \
	b='test_vectors'; \
................................................................................
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_map_vector.log: test_map_vector$(EXEEXT)
	@p='test_map_vector$(EXEEXT)'; \
	b='test_map_vector'; \







	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
	@p='$<'; \
	$(am__set_b); \







>
>
|
>
>
>
|
<
>
|
|
>







 







>
>
>







 







>
>
>







 







>
>
>
>



>
>
>
>







 







>
>
>







 







|
|
>
|
|
|
|
|
|
|
|
|
>
|
|





|
|
>
|
|
|
|
|
|
|
|
|
>
|
|







 







>
>
>
>







 







>
>
>
>







 







>
>
>
>




>
>
>
>







 







>
>
>
>







 







>





>







 







>

>






>







 







>
>
>
>
>
>
>



>
>
>
>
>
>
>











>
>
>
>
>
>
>



>
>
>
>
>
>
>







 







>
>
>
>
>
>
>







105
106
107
108
109
110
111
112
113
114
115
116
117
118

119
120
121
122
123
124
125
126
127
128
129
...
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
...
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
...
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
...
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
...
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
....
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
....
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
....
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
....
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
....
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
....
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
....
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
....
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
	test_map_rgb$(EXEEXT) test_map_gray$(EXEEXT) \
	test_map_srtm$(EXEEXT) test_map_mono$(EXEEXT) \
	test_map_indiana$(EXEEXT) test_load_wms$(EXEEXT) \
	test_map_noref$(EXEEXT) test_map_trento$(EXEEXT) \
	test_map_trieste$(EXEEXT) test_map_infrared$(EXEEXT) \
	test_map_orbetello$(EXEEXT) test_raster_symbolizer$(EXEEXT) \
	test_svg$(EXEEXT) test_raw$(EXEEXT) test_openjpeg$(EXEEXT) \
	test_line_symbolizer$(EXEEXT) \
	test_line_symbolizer_col$(EXEEXT) \
	test_polygon_symbolizer$(EXEEXT) \
	test_polygon_symbolizer_col$(EXEEXT) \
	test_point_symbolizer$(EXEEXT) \
	test_point_symbolizer_col$(EXEEXT) \
	test_text_symbolizer$(EXEEXT) \

	test_text_symbolizer_col$(EXEEXT) test_vectors$(EXEEXT) \
	test_font$(EXEEXT) test_copy_rastercov$(EXEEXT) \
	test_tile_callback$(EXEEXT) test_map_vector$(EXEEXT) \
	test_col_symbolizers$(EXEEXT)
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
................................................................................
test7_LDADD = $(LDADD)
test8_SOURCES = test8.c
test8_OBJECTS = test8.$(OBJEXT)
test8_LDADD = $(LDADD)
test9_SOURCES = test9.c
test9_OBJECTS = test9.$(OBJEXT)
test9_LDADD = $(LDADD)
test_col_symbolizers_SOURCES = test_col_symbolizers.c
test_col_symbolizers_OBJECTS = test_col_symbolizers.$(OBJEXT)
test_col_symbolizers_LDADD = $(LDADD)
test_copy_rastercov_SOURCES = test_copy_rastercov.c
test_copy_rastercov_OBJECTS = test_copy_rastercov.$(OBJEXT)
test_copy_rastercov_LDADD = $(LDADD)
test_coverage_SOURCES = test_coverage.c
test_coverage_OBJECTS = test_coverage.$(OBJEXT)
test_coverage_LDADD = $(LDADD)
test_font_SOURCES = test_font.c
................................................................................
test_font_LDADD = $(LDADD)
test_gif_SOURCES = test_gif.c
test_gif_OBJECTS = test_gif.$(OBJEXT)
test_gif_LDADD = $(LDADD)
test_line_symbolizer_SOURCES = test_line_symbolizer.c
test_line_symbolizer_OBJECTS = test_line_symbolizer.$(OBJEXT)
test_line_symbolizer_LDADD = $(LDADD)
test_line_symbolizer_col_SOURCES = test_line_symbolizer_col.c
test_line_symbolizer_col_OBJECTS = test_line_symbolizer_col.$(OBJEXT)
test_line_symbolizer_col_LDADD = $(LDADD)
test_load_wms_SOURCES = test_load_wms.c
test_load_wms_OBJECTS = test_load_wms.$(OBJEXT)
test_load_wms_LDADD = $(LDADD)
test_map_ascii_SOURCES = test_map_ascii.c
test_map_ascii_OBJECTS = test_map_ascii.$(OBJEXT)
test_map_ascii_LDADD = $(LDADD)
test_map_gray_SOURCES = test_map_gray.c
................................................................................
test_paint_LDADD = $(LDADD)
test_palette_SOURCES = test_palette.c
test_palette_OBJECTS = test_palette.$(OBJEXT)
test_palette_LDADD = $(LDADD)
test_point_symbolizer_SOURCES = test_point_symbolizer.c
test_point_symbolizer_OBJECTS = test_point_symbolizer.$(OBJEXT)
test_point_symbolizer_LDADD = $(LDADD)
test_point_symbolizer_col_SOURCES = test_point_symbolizer_col.c
test_point_symbolizer_col_OBJECTS =  \
	test_point_symbolizer_col.$(OBJEXT)
test_point_symbolizer_col_LDADD = $(LDADD)
test_polygon_symbolizer_SOURCES = test_polygon_symbolizer.c
test_polygon_symbolizer_OBJECTS = test_polygon_symbolizer.$(OBJEXT)
test_polygon_symbolizer_LDADD = $(LDADD)
test_polygon_symbolizer_col_SOURCES = test_polygon_symbolizer_col.c
test_polygon_symbolizer_col_OBJECTS =  \
	test_polygon_symbolizer_col.$(OBJEXT)
test_polygon_symbolizer_col_LDADD = $(LDADD)
test_raster_SOURCES = test_raster.c
test_raster_OBJECTS = test_raster.$(OBJEXT)
test_raster_LDADD = $(LDADD)
test_raster_symbolizer_SOURCES = test_raster_symbolizer.c
test_raster_symbolizer_OBJECTS = test_raster_symbolizer.$(OBJEXT)
test_raster_symbolizer_LDADD = $(LDADD)
test_raw_SOURCES = test_raw.c
................................................................................
test_section_LDADD = $(LDADD)
test_svg_SOURCES = test_svg.c
test_svg_OBJECTS = test_svg.$(OBJEXT)
test_svg_LDADD = $(LDADD)
test_text_symbolizer_SOURCES = test_text_symbolizer.c
test_text_symbolizer_OBJECTS = test_text_symbolizer.$(OBJEXT)
test_text_symbolizer_LDADD = $(LDADD)
test_text_symbolizer_col_SOURCES = test_text_symbolizer_col.c
test_text_symbolizer_col_OBJECTS = test_text_symbolizer_col.$(OBJEXT)
test_text_symbolizer_col_LDADD = $(LDADD)
test_tifin_SOURCES = test_tifin.c
test_tifin_OBJECTS = test_tifin.$(OBJEXT)
test_tifin_LDADD = $(LDADD)
test_tile_callback_SOURCES = test_tile_callback.c
test_tile_callback_OBJECTS = test_tile_callback.$(OBJEXT)
test_tile_callback_LDADD = $(LDADD)
test_vectors_SOURCES = test_vectors.c
................................................................................
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo "  CCLD    " $@;
am__v_CCLD_1 = 
SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c test13.c \
	test14.c test15.c test16.c test17.c test18.c test19.c test2.c \
	test20.c test3.c test4.c test5.c test6.c test7.c test8.c \
	test9.c test_col_symbolizers.c test_copy_rastercov.c \
	test_coverage.c test_font.c test_gif.c test_line_symbolizer.c \
	test_line_symbolizer_col.c test_load_wms.c test_map_ascii.c \
	test_map_gray.c test_map_indiana.c test_map_infrared.c \
	test_map_mono.c test_map_nile_32.c test_map_nile_8.c \
	test_map_nile_dbl.c test_map_nile_flt.c test_map_nile_u16.c \
	test_map_nile_u32.c test_map_nile_u8.c test_map_noref.c \
	test_map_orbetello.c test_map_rgb.c test_map_srtm.c \
	test_map_trento.c test_map_trieste.c test_map_vector.c \
	test_mask.c test_openjpeg.c test_paint.c test_palette.c \
	test_point_symbolizer.c test_point_symbolizer_col.c \
	test_polygon_symbolizer.c test_polygon_symbolizer_col.c \
	test_raster.c test_raster_symbolizer.c test_raw.c \
	test_section.c test_svg.c test_text_symbolizer.c \
	test_text_symbolizer_col.c test_tifin.c test_tile_callback.c \
	test_vectors.c test_webp.c test_wms1.c test_wms2.c \
	test_wr_tiff.c
DIST_SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c \
	test13.c test14.c test15.c test16.c test17.c test18.c test19.c \
	test2.c test20.c test3.c test4.c test5.c test6.c test7.c \
	test8.c test9.c test_col_symbolizers.c test_copy_rastercov.c \
	test_coverage.c test_font.c test_gif.c test_line_symbolizer.c \
	test_line_symbolizer_col.c test_load_wms.c test_map_ascii.c \
	test_map_gray.c test_map_indiana.c test_map_infrared.c \
	test_map_mono.c test_map_nile_32.c test_map_nile_8.c \
	test_map_nile_dbl.c test_map_nile_flt.c test_map_nile_u16.c \
	test_map_nile_u32.c test_map_nile_u8.c test_map_noref.c \
	test_map_orbetello.c test_map_rgb.c test_map_srtm.c \
	test_map_trento.c test_map_trieste.c test_map_vector.c \
	test_mask.c test_openjpeg.c test_paint.c test_palette.c \
	test_point_symbolizer.c test_point_symbolizer_col.c \
	test_polygon_symbolizer.c test_polygon_symbolizer_col.c \
	test_raster.c test_raster_symbolizer.c test_raw.c \
	test_section.c test_svg.c test_text_symbolizer.c \
	test_text_symbolizer_col.c test_tifin.c test_tile_callback.c \
	test_vectors.c test_webp.c test_wms1.c test_wms2.c \
	test_wr_tiff.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
................................................................................
test8$(EXEEXT): $(test8_OBJECTS) $(test8_DEPENDENCIES) $(EXTRA_test8_DEPENDENCIES) 
	@rm -f test8$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test8_OBJECTS) $(test8_LDADD) $(LIBS)

test9$(EXEEXT): $(test9_OBJECTS) $(test9_DEPENDENCIES) $(EXTRA_test9_DEPENDENCIES) 
	@rm -f test9$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test9_OBJECTS) $(test9_LDADD) $(LIBS)

test_col_symbolizers$(EXEEXT): $(test_col_symbolizers_OBJECTS) $(test_col_symbolizers_DEPENDENCIES) $(EXTRA_test_col_symbolizers_DEPENDENCIES) 
	@rm -f test_col_symbolizers$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_col_symbolizers_OBJECTS) $(test_col_symbolizers_LDADD) $(LIBS)

test_copy_rastercov$(EXEEXT): $(test_copy_rastercov_OBJECTS) $(test_copy_rastercov_DEPENDENCIES) $(EXTRA_test_copy_rastercov_DEPENDENCIES) 
	@rm -f test_copy_rastercov$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_copy_rastercov_OBJECTS) $(test_copy_rastercov_LDADD) $(LIBS)

test_coverage$(EXEEXT): $(test_coverage_OBJECTS) $(test_coverage_DEPENDENCIES) $(EXTRA_test_coverage_DEPENDENCIES) 
	@rm -f test_coverage$(EXEEXT)
................................................................................
test_gif$(EXEEXT): $(test_gif_OBJECTS) $(test_gif_DEPENDENCIES) $(EXTRA_test_gif_DEPENDENCIES) 
	@rm -f test_gif$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_gif_OBJECTS) $(test_gif_LDADD) $(LIBS)

test_line_symbolizer$(EXEEXT): $(test_line_symbolizer_OBJECTS) $(test_line_symbolizer_DEPENDENCIES) $(EXTRA_test_line_symbolizer_DEPENDENCIES) 
	@rm -f test_line_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_line_symbolizer_OBJECTS) $(test_line_symbolizer_LDADD) $(LIBS)

test_line_symbolizer_col$(EXEEXT): $(test_line_symbolizer_col_OBJECTS) $(test_line_symbolizer_col_DEPENDENCIES) $(EXTRA_test_line_symbolizer_col_DEPENDENCIES) 
	@rm -f test_line_symbolizer_col$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_line_symbolizer_col_OBJECTS) $(test_line_symbolizer_col_LDADD) $(LIBS)

test_load_wms$(EXEEXT): $(test_load_wms_OBJECTS) $(test_load_wms_DEPENDENCIES) $(EXTRA_test_load_wms_DEPENDENCIES) 
	@rm -f test_load_wms$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_load_wms_OBJECTS) $(test_load_wms_LDADD) $(LIBS)

test_map_ascii$(EXEEXT): $(test_map_ascii_OBJECTS) $(test_map_ascii_DEPENDENCIES) $(EXTRA_test_map_ascii_DEPENDENCIES) 
	@rm -f test_map_ascii$(EXEEXT)
................................................................................
test_palette$(EXEEXT): $(test_palette_OBJECTS) $(test_palette_DEPENDENCIES) $(EXTRA_test_palette_DEPENDENCIES) 
	@rm -f test_palette$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_palette_OBJECTS) $(test_palette_LDADD) $(LIBS)

test_point_symbolizer$(EXEEXT): $(test_point_symbolizer_OBJECTS) $(test_point_symbolizer_DEPENDENCIES) $(EXTRA_test_point_symbolizer_DEPENDENCIES) 
	@rm -f test_point_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_point_symbolizer_OBJECTS) $(test_point_symbolizer_LDADD) $(LIBS)

test_point_symbolizer_col$(EXEEXT): $(test_point_symbolizer_col_OBJECTS) $(test_point_symbolizer_col_DEPENDENCIES) $(EXTRA_test_point_symbolizer_col_DEPENDENCIES) 
	@rm -f test_point_symbolizer_col$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_point_symbolizer_col_OBJECTS) $(test_point_symbolizer_col_LDADD) $(LIBS)

test_polygon_symbolizer$(EXEEXT): $(test_polygon_symbolizer_OBJECTS) $(test_polygon_symbolizer_DEPENDENCIES) $(EXTRA_test_polygon_symbolizer_DEPENDENCIES) 
	@rm -f test_polygon_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_polygon_symbolizer_OBJECTS) $(test_polygon_symbolizer_LDADD) $(LIBS)

test_polygon_symbolizer_col$(EXEEXT): $(test_polygon_symbolizer_col_OBJECTS) $(test_polygon_symbolizer_col_DEPENDENCIES) $(EXTRA_test_polygon_symbolizer_col_DEPENDENCIES) 
	@rm -f test_polygon_symbolizer_col$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_polygon_symbolizer_col_OBJECTS) $(test_polygon_symbolizer_col_LDADD) $(LIBS)

test_raster$(EXEEXT): $(test_raster_OBJECTS) $(test_raster_DEPENDENCIES) $(EXTRA_test_raster_DEPENDENCIES) 
	@rm -f test_raster$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_raster_OBJECTS) $(test_raster_LDADD) $(LIBS)

test_raster_symbolizer$(EXEEXT): $(test_raster_symbolizer_OBJECTS) $(test_raster_symbolizer_DEPENDENCIES) $(EXTRA_test_raster_symbolizer_DEPENDENCIES) 
	@rm -f test_raster_symbolizer$(EXEEXT)
................................................................................
test_svg$(EXEEXT): $(test_svg_OBJECTS) $(test_svg_DEPENDENCIES) $(EXTRA_test_svg_DEPENDENCIES) 
	@rm -f test_svg$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_svg_OBJECTS) $(test_svg_LDADD) $(LIBS)

test_text_symbolizer$(EXEEXT): $(test_text_symbolizer_OBJECTS) $(test_text_symbolizer_DEPENDENCIES) $(EXTRA_test_text_symbolizer_DEPENDENCIES) 
	@rm -f test_text_symbolizer$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_text_symbolizer_OBJECTS) $(test_text_symbolizer_LDADD) $(LIBS)

test_text_symbolizer_col$(EXEEXT): $(test_text_symbolizer_col_OBJECTS) $(test_text_symbolizer_col_DEPENDENCIES) $(EXTRA_test_text_symbolizer_col_DEPENDENCIES) 
	@rm -f test_text_symbolizer_col$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_text_symbolizer_col_OBJECTS) $(test_text_symbolizer_col_LDADD) $(LIBS)

test_tifin$(EXEEXT): $(test_tifin_OBJECTS) $(test_tifin_DEPENDENCIES) $(EXTRA_test_tifin_DEPENDENCIES) 
	@rm -f test_tifin$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(test_tifin_OBJECTS) $(test_tifin_LDADD) $(LIBS)

test_tile_callback$(EXEEXT): $(test_tile_callback_OBJECTS) $(test_tile_callback_DEPENDENCIES) $(EXTRA_test_tile_callback_DEPENDENCIES) 
	@rm -f test_tile_callback$(EXEEXT)
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test4.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test7.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test8.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test9.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_col_symbolizers.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_copy_rastercov.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_coverage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_font.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gif.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_line_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_line_symbolizer_col.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_load_wms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_ascii.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_gray.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_indiana.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_infrared.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_mono.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_nile_32.Po@am__quote@
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_trieste.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_map_vector.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mask.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_openjpeg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_paint.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_palette.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_point_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_point_symbolizer_col.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_polygon_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_polygon_symbolizer_col.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raster.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raster_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_raw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_section.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_svg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_text_symbolizer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_text_symbolizer_col.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tifin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tile_callback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vectors.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_webp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wms1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wms2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wr_tiff.Po@am__quote@
................................................................................
test_line_symbolizer.log: test_line_symbolizer$(EXEEXT)
	@p='test_line_symbolizer$(EXEEXT)'; \
	b='test_line_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_line_symbolizer_col.log: test_line_symbolizer_col$(EXEEXT)
	@p='test_line_symbolizer_col$(EXEEXT)'; \
	b='test_line_symbolizer_col'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_polygon_symbolizer.log: test_polygon_symbolizer$(EXEEXT)
	@p='test_polygon_symbolizer$(EXEEXT)'; \
	b='test_polygon_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_polygon_symbolizer_col.log: test_polygon_symbolizer_col$(EXEEXT)
	@p='test_polygon_symbolizer_col$(EXEEXT)'; \
	b='test_polygon_symbolizer_col'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_point_symbolizer.log: test_point_symbolizer$(EXEEXT)
	@p='test_point_symbolizer$(EXEEXT)'; \
	b='test_point_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_point_symbolizer_col.log: test_point_symbolizer_col$(EXEEXT)
	@p='test_point_symbolizer_col$(EXEEXT)'; \
	b='test_point_symbolizer_col'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_text_symbolizer.log: test_text_symbolizer$(EXEEXT)
	@p='test_text_symbolizer$(EXEEXT)'; \
	b='test_text_symbolizer'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_text_symbolizer_col.log: test_text_symbolizer_col$(EXEEXT)
	@p='test_text_symbolizer_col$(EXEEXT)'; \
	b='test_text_symbolizer_col'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_vectors.log: test_vectors$(EXEEXT)
	@p='test_vectors$(EXEEXT)'; \
	b='test_vectors'; \
................................................................................
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_map_vector.log: test_map_vector$(EXEEXT)
	@p='test_map_vector$(EXEEXT)'; \
	b='test_map_vector'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
test_col_symbolizers.log: test_col_symbolizers$(EXEEXT)
	@p='test_col_symbolizers$(EXEEXT)'; \
	b='test_col_symbolizers'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
	@p='$<'; \
	$(am__set_b); \

Changes to test/symbolizers.sqlite.

cannot compute difference between binary files

Added test/test_col_symbolizers.c.





































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*

 test_line_col_symbolizers.c -- RasterLite-2 Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2017
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

#include "sqlite3.h"
#include "spatialite.h"

#include "rasterlite2/rasterlite2.h"

static int
test_symbolizer (sqlite3 * db_handle, const char *coverage,
		 const char *style_name, int *retcode)
{
/* testing a dynamic Symbolizer based on column values */
    const char *sql;
    char *path;
    sqlite3_stmt *stmt;
    int ret;
    int xret = 0;

    path = sqlite3_mprintf ("./%s_map_%s.%s", coverage, style_name, "png");

    sql =
	"SELECT BlobToFile(GetMapImageFromVector(NULL, ?, "
	"ST_GeomFromText('LINESTRING(-180 -90, 180 90)', 4326), "
	"2048, 1024, ?, 'image/png'), ?)";
    ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
	return 0;
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);
    sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
    sqlite3_bind_text (stmt, 2, style_name, strlen (style_name), SQLITE_STATIC);
    sqlite3_bind_text (stmt, 3, path, strlen (path), SQLITE_STATIC);
    ret = sqlite3_step (stmt);
    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
      {
	  if (sqlite3_column_int (stmt, 0) == 1)
	      xret = 1;
      }
    sqlite3_finalize (stmt);
    unlink (path);
    if (!xret)
	fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
    sqlite3_free (path);
    *retcode += xret;
    return xret;
}

int
main (int argc, char *argv[])
{
    int result = 0;
    int ret;
    sqlite3 *db_handle;
    void *cache = spatialite_alloc_connection ();
    void *priv_data = rl2_alloc_private ();
    char *old_SPATIALITE_SECURITY_ENV = NULL;

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

    old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
#ifdef _WIN32
    putenv ("SPATIALITE_SECURITY=relaxed");
#else /* not WIN32 */
    setenv ("SPATIALITE_SECURITY", "relaxed", 1);
#endif

/* opening and initializing the "memory" test DB */
    ret = sqlite3_open_v2 ("symbolizers.sqlite", &db_handle,
			   SQLITE_OPEN_READONLY, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_open_v2() error: %s\n",
		   sqlite3_errmsg (db_handle));
	  return -1;
      }
    spatialite_init_ex (db_handle, cache, 0);
    rl2_init (db_handle, priv_data, 0);

/* tests */
    ret = -10;
    if (!test_symbolizer (db_handle, "styled_line", "styled_line", &ret))
	return ret;
    ret = -20;
    if (!test_symbolizer (db_handle, "styled_pollyg", "styled_polyg", &ret))
	return ret;
    ret = -30;
    if (!test_symbolizer (db_handle, "styled_point", "styled_point", &ret))
	return ret;

/* closing the DB */
    sqlite3_close (db_handle);
    spatialite_cleanup_ex (cache);
    rl2_cleanup_private (priv_data);
    spatialite_shutdown ();
    if (old_SPATIALITE_SECURITY_ENV)
      {
#ifdef _WIN32
	  char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
				       old_SPATIALITE_SECURITY_ENV);
	  putenv (env);
	  sqlite3_free (env);
#else /* not WIN32 */
	  setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
#endif
      }
    else
      {
#ifdef _WIN32
	  putenv ("SPATIALITE_SECURITY=");
#else /* not WIN32 */
	  unsetenv ("SPATIALITE_SECURITY");
#endif
      }
    return result;
}

Added test/test_line_symbolizer_col.c.

























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
/*

 test_line_symbolizer_col.c -- RasterLite-2 Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2017
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

#include "sqlite3.h"
#include "spatialite.h"

#include "rasterlite2/rasterlite2.h"

static int
test_symbolizer (sqlite3 * db_handle, const char *coverage,
		 const char *style_name, int *retcode)
{
/* testing a LineSymbolizer */
    rl2FeatureTypeStylePtr style;
    rl2VectorSymbolizerPtr symbolizer;
    rl2LineSymbolizerPtr line;
    int intval;
    int index;
    double dblval;
    const char *string;
    unsigned char red;
    int scale_forbidden;
    style =
	rl2_create_feature_type_style_from_dbms (db_handle, NULL, coverage,
						 style_name);
    if (style == NULL)
      {
	  fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
	  *retcode += 1;
	  return 0;
      }

    symbolizer =
	rl2_get_symbolizer_from_feature_type_style (style, 1.0, NULL,
						    &scale_forbidden);
    if (symbolizer == NULL)
      {
	  fprintf (stderr, "Unexpected NULL VectorSymbolizer (%s)\n",
		   style_name);
	  *retcode += 2;
	  return 0;
      }

    if (rl2_is_valid_vector_symbolizer (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Validity #1\n",
		   style_name);
	  *retcode += 3;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Validity #1: %d\n",
		   style_name, intval);
	  *retcode += 4;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_count (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Count #1\n",
		   style_name);
	  *retcode += 5;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Count #1: %d\n",
		   style_name, intval);
	  *retcode += 6;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_item_type (symbolizer, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Item Type #1\n",
		   style_name);
	  *retcode += 7;
	  return 0;
      }
    if (intval != RL2_LINE_SYMBOLIZER)
      {
	  fprintf (stderr,
		   "%s: Unexpected Vector Symbolizer Item Type #1: %d\n",
		   style_name, intval);
	  *retcode += 8;
	  return 0;
      }

    line = rl2_get_line_symbolizer (symbolizer, 0);
    if (line == NULL)
      {
	  fprintf (stderr, "%s: Unable to get a Line Symbolizer #1\n",
		   style_name);
	  *retcode += 9;
	  return 0;
      }

    if (rl2_line_symbolizer_has_stroke (line, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Line Symbolizer HasStroke #1\n",
		   style_name);
	  *retcode += 10;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Line Symbolizer HasStroke #1: %d\n",
		   style_name, intval);
	  *retcode += 11;
	  return 0;
      }

    string = rl2_line_symbolizer_get_col_stroke_color (line);
    if (strcmp (style_name, "line_2_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Line Symbolizer GetColStrokeColor #1\n",
			 style_name);
		*retcode += 12;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetColStrokeColor #1\n",
			 style_name);
		*retcode += 13;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetColStrokeColor #11: %s\n",
		   style_name, string);
	  *retcode += 13;
	  return 0;
      }

    string = rl2_line_symbolizer_get_col_stroke_opacity (line);
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Line Symbolizer GetColStrokeOpacity #1\n",
			 style_name);
		*retcode += 14;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetColStrokeOpacity #1\n",
			 style_name);
		*retcode += 14;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "line_2_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (strcmp (string, "opacity") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetColStrokeOpacity #1: %1.4f\n",
		   style_name, dblval);
	  *retcode += 15;
	  return 0;
      }

    string = rl2_line_symbolizer_get_col_stroke_width (line);
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected Success: Line Symbolizer GetColStrokeWidth #1\n",
			 style_name);
		*retcode += 16;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetColStrokeWidth #1\n",
			 style_name);
		*retcode += 17;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (strcmp (string, "width") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetColStrokeWidth #1: %s\n",
		   style_name, string);
	  *retcode += 18;
	  return 0;
      }

    if (rl2_line_symbolizer_get_stroke_linejoin (line, &red) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer GetColStrokeLinejoin #1\n",
		   style_name);
	  *retcode += 19;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_UNKNOWN)
	      intval = 1;
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_ROUND)
	      intval = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_MITRE)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetColStrokeLinejoin #1: %02x\n",
		   style_name, red);
	  *retcode += 20;
	  return 0;
      }

    if (rl2_line_symbolizer_get_stroke_linecap (line, &red) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer GetStrokeLinecap #1\n",
		   style_name);
	  *retcode += 21;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_UNKNOWN)
	      intval = 1;
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_SQUARE)
	      intval = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_ROUND)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetStrokeLinecap #1: %02x\n",
		   style_name, red);
	  *retcode += 22;
	  return 0;
      }

    if (rl2_line_symbolizer_get_stroke_dash_count (line, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer GetStrokeDashCount #1\n",
		   style_name);
	  *retcode += 23;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (intval == 6)
	      red = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetStrokeDashCount #1: %d\n",
		   style_name, intval);
	  *retcode += 24;
	  return 0;
      }

    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 0, &dblval) ==
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Expected failure, got success: Line Symbolizer GetStrokeDashItem #1\n");
		*retcode += 25;
		return 0;
	    }
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 0, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetStrokeDashItem #1\n",
			 style_name);
		*retcode += 26;
		return 0;
	    }
	  if (dblval != 20.0)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #1: %1.4f\n",
			 dblval);
		*retcode += 27;
		return 0;
	    }
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 1, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Line Symbolizer GetStrokeDashItem #2\n");
		*retcode += 28;
		return 0;
	    }
	  if (dblval != 10.1)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #2: %1.4f\n",
			 dblval);
		*retcode += 29;
		return 0;
	    }
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 2, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Line Symbolizer GetStrokeDashItem #3\n");
		*retcode += 30;
		return 0;
	    }
	  if (dblval != 5.5)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #3: %1.4f\n",
			 dblval);
		*retcode += 31;
		return 0;
	    }
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 3, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Line Symbolizer GetStrokeDashItem #4\n");
		*retcode += 32;
		return 0;
	    }
	  if (dblval != 4.0)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #4: %1.4f\n",
			 dblval);
		*retcode += 33;
		return 0;
	    }
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 4, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Line Symbolizer GetStrokeDashItem #5\n");
		*retcode += 34;
		return 0;
	    }
	  if (dblval != 6.0)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #4: %1.4f\n",
			 dblval);
		*retcode += 35;
		return 0;
	    }
	  if (rl2_line_symbolizer_get_stroke_dash_item (line, 5, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Line Symbolizer GetStrokeDashItem #5\n");
		*retcode += 36;
		return 0;
	    }
	  if (dblval != 12.0)
	    {
		fprintf (stderr,
			 "Unexpected Line Symbolizer GetStrokDashItem #5: %1.4f\n",
			 dblval);
		*retcode += 37;
		return 0;
	    }
      }

    if (rl2_line_symbolizer_get_stroke_dash_offset (line, &dblval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer GetStrokeDashOffset #1\n",
		   style_name);
	  *retcode += 38;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (dblval == 0.0)
	      intval = 1;
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (dblval == 10.0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetStrokeDashOffset #1: %1.4f\n",
		   style_name, dblval);
	  *retcode += 39;
	  return 0;
      }

    string = rl2_line_symbolizer_get_col_perpendicular_offset (line);
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Line Symbolizer GetColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 40;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 41;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (strcmp (string, "perpoff") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Line Symbolizer GetColPerpendicularOffset #1: %s\n",
		   style_name, string);
	  *retcode += 42;
	  return 0;
      }

    string = rl2_line_symbolizer_get_col_graphic_stroke_href (line);
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_2_col") == 0)
      {
	  if (string == NULL)
	      intval = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (string != NULL)
	    {
		if (strcmp (string, "pen_href") == 0)
		    intval = 1;
	    }
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Line Symbolizer GetColGraphicStrokeHref #1: %s\n",
		   style_name, string);
	  *retcode += 43;
	  return 0;
      }

    if (rl2_line_symbolizer_get_graphic_stroke_recode_count (line, &intval) !=
	RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer GetGraphicStrokeRecodeCount #1\n",
		   style_name);
	  *retcode += 44;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_2_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Line Symbolizer GetGraphicStrokeRecodeCount #1: %d\n",
		   style_name, intval);
	  *retcode += 45;
	  return 0;
      }

    string =
	rl2_line_symbolizer_get_col_graphic_stroke_recode_color (line, 0,
								 &index);
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Line Symbolizer GetColGraphicStrokeRecodeColor #1\n",
			 style_name);
		*retcode += 46;
		return 0;
	    }
	  intval = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer GetColGraphicStrokeRecodeColor #1\n",
			 style_name);
		*retcode += 47;
		return 0;
	    }
	  intval = 0;
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer GetColGraphicStrokeRecodeColor #1: %s\n",
		   style_name, string);
	  *retcode += 48;
	  return 0;
      }

    intval = rl2_get_feature_type_style_columns_count (style);
    red = 0;
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_2_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (intval == 4)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer StyleColumnsCount #1: %d\n",
		   style_name, intval);
	  *retcode += 49;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 0);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Line Symbolizer StyleColumnName #1\n",
		   style_name);
	  *retcode += 50;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "line_1_col") == 0)
      {
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "line_2_col") == 0)
      {
	  if (strcmp (string, "opacity") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (strcmp (string, "pen_href") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer StyleColumnsName #1: %s\n",
		   style_name, string);
	  *retcode += 51;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 2);
    if (strcmp (style_name, "line_1_col") == 0
	|| strcmp (style_name, "line_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Line Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 52;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Line Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 53;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "line_3_col") == 0)
      {
	  if (strcmp (string, "width") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Line Symbolizer StyleColumnsName #2: %s\n",
		   style_name, string);
	  *retcode += 54;
	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}

int
main (int argc, char *argv[])
{
    int result = 0;
    int ret;
    sqlite3 *db_handle;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

/* opening and initializing the "memory" test DB */
    ret = sqlite3_open_v2 ("symbolizers.sqlite", &db_handle,
			   SQLITE_OPEN_READONLY, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_open_v2() error: %s\n",
		   sqlite3_errmsg (db_handle));
	  return -1;
      }
    spatialite_init_ex (db_handle, cache, 0);

/* tests */
    ret = -100;
    if (!test_symbolizer (db_handle, "line1", "line_1_col", &ret))
	return ret;
    ret = -200;
    if (!test_symbolizer (db_handle, "line2", "line_2_col", &ret))
	return ret;
    ret = -300;
    if (!test_symbolizer (db_handle, "line2", "line_3_col", &ret))
	return ret;

/* closing the DB */
    sqlite3_close (db_handle);
    spatialite_shutdown ();
    return result;
}

Added test/test_point_symbolizer_col.c.





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
/*

 test_point_symbolizer_col.c -- RasterLite-2 Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2015
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

#include "sqlite3.h"
#include "spatialite.h"

#include "rasterlite2/rasterlite2.h"

static int
test_symbolizer (sqlite3 * db_handle, const char *coverage,
		 const char *style_name, int *retcode)
{
/* testing a PointSymbolizer */
    rl2FeatureTypeStylePtr style;
    rl2VectorSymbolizerPtr symbolizer;
    rl2PointSymbolizerPtr point;
    int intval;
    int index;
    int ret;
    double dblval;
    const char *string;
    unsigned char red;
    int scale_forbidden;
    style =
	rl2_create_feature_type_style_from_dbms (db_handle, NULL, coverage,
						 style_name);
    if (style == NULL)
      {
	  fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
	  *retcode += 1;
	  return 0;
      }

    symbolizer =
	rl2_get_symbolizer_from_feature_type_style (style, 1.0, NULL,
						    &scale_forbidden);
    if (symbolizer == NULL)
      {
	  fprintf (stderr, "Unexpected NULL VectorSymbolizer (%s)\n",
		   style_name);
	  *retcode += 2;
	  return 0;
      }

    if (rl2_is_valid_vector_symbolizer (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Validity #1\n",
		   style_name);
	  *retcode += 3;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Validity #1: %d\n",
		   style_name, intval);
	  *retcode += 4;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_count (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Count #1\n",
		   style_name);
	  *retcode += 5;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Count #1: %d\n",
		   style_name, intval);
	  *retcode += 6;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_item_type (symbolizer, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Item Type #1\n",
		   style_name);
	  *retcode += 7;
	  return 0;
      }
    if (intval != RL2_POINT_SYMBOLIZER)
      {
	  fprintf (stderr,
		   "%s: Unexpected Vector Symbolizer Item Type #1: %d\n",
		   style_name, intval);
	  *retcode += 8;
	  return 0;
      }

    point = rl2_get_point_symbolizer (symbolizer, 0);
    if (point == NULL)
      {
	  fprintf (stderr, "%s: Unable to get a Point Symbolizer #1\n",
		   style_name);
	  *retcode += 9;
	  return 0;
      }

    if (rl2_point_symbolizer_get_count (point, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Point Symbolizer Count #1\n",
		   style_name);
	  *retcode += 10;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Point Symbolizer Count #1: %d\n",
		   style_name, intval);
	  *retcode += 11;
	  return 0;
      }

    if (rl2_point_symbolizer_is_graphic (point, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Point Symbolizer IsGraphic #1\n",
		   style_name);
	  *retcode += 12;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer IsGraphic #1: %d\n",
		   style_name, intval);
	  *retcode += 13;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_graphic_href (point, 0);
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (string == NULL)
	      intval = 1;
      }
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (string != NULL)
	    {
		if (strcmp (string, "symbol_href") == 0)
		    intval = 1;
	    }
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Point Symbolizer GetColGraphicHref #1: %s\n",
		   style_name, string);
	  *retcode += 14;
	  return 0;
      }

    if (rl2_point_symbolizer_is_mark (point, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Point Symbolizer IsMark #1\n",
		   style_name);
	  *retcode += 15;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer IsMark #1: %d\n",
		   style_name, intval);
	  *retcode += 16;
	  return 0;
      }

    ret = rl2_point_symbolizer_mark_has_stroke (point, 0, &intval);
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark HasStroke #1\n",
			 style_name);
		*retcode += 17;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark HasStroke #1\n",
			 style_name);
		*retcode += 18;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark HasStroke #1: %d\n",
		   style_name, intval);
	  *retcode += 19;
	  return 0;
      }

    string = rl2_point_symbolizer_mark_get_col_stroke_color (point, 0);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetColStrokeColor #1\n",
			 style_name);
		*retcode += 20;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetColStrokeColor #1\n",
			 style_name);
		*retcode += 21;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0
	&& strcmp (style_name, "point_2_col") == 0)
      {
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetColStrokeColor #1: %s\n",
		   style_name, string);
	  *retcode += 22;
	  return 0;
      }

    string = rl2_point_symbolizer_mark_get_col_stroke_width (point, 0);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetStrokeColWidth #1\n",
			 style_name);
		*retcode += 23;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetStrokeColWidth #1\n",
			 style_name);
		*retcode += 24;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (strcmp (string, "width") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetStrokeColWidth #1: %s\n",
		   style_name, string);
	  *retcode += 25;
	  return 0;
      }

    ret = rl2_point_symbolizer_mark_get_stroke_linejoin (point, 0, &red);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetStrokeLinejoin #1\n",
			 style_name);
		*retcode += 26;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetStrokeLinejoin #1\n",
			 style_name);
		*retcode += 27;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_UNKNOWN)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetStrokeLinejoin #1: %02x\n",
		   style_name, red);
	  *retcode += 28;
	  return 0;
      }

    ret = rl2_point_symbolizer_mark_get_stroke_linecap (point, 0, &red);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetStrokeLinecap #1\n",
			 style_name);
		*retcode += 29;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetStrokeLinecap #1\n",
			 style_name);
		*retcode += 30;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_UNKNOWN)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetStrokeLinecap #1: %02x\n",
		   style_name, red);
	  *retcode += 31;
	  return 0;
      }

    ret = rl2_point_symbolizer_mark_get_stroke_dash_count (point, 0, &intval);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetStrokeDashCount #1\n",
			 style_name);
		*retcode += 32;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetStrokeDashCount #1\n",
			 style_name);
		*retcode += 33;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    else
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetStrokeDashCount #1: %d\n",
		   style_name, intval);
	  *retcode += 34;
	  return 0;
      }


    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (rl2_point_symbolizer_mark_get_stroke_dash_item
	      (point, 0, 0, &dblval) == RL2_OK)
	    {
		fprintf (stderr,
			 "Expected failure, got success: Point Symbolizer Mark GetStrokeDashItem #1\n");
		*retcode += 35;
		return 0;
	    }
      }
    else
      {
	  if (rl2_point_symbolizer_mark_get_stroke_dash_item
	      (point, 0, 0, &dblval) != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetStrokeDashItem #1\n",
			 style_name);
		*retcode += 36;
		return 0;
	    }
	  if (dblval != 20.0)
	    {
		fprintf (stderr,
			 "Unexpected Point Symbolizer Mark GetStrokDashItem #1: %1.4f\n",
			 dblval);
		*retcode += 37;
		return 0;
	    }
	  if (rl2_point_symbolizer_mark_get_stroke_dash_item
	      (point, 0, 1, &dblval) != RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Point Symbolizer Mark GetStrokeDashItem #2\n");
		*retcode += 38;
		return 0;
	    }
	  if (dblval != 10)
	    {
		fprintf (stderr,
			 "Unexpected Point Symbolizer Mark GetStrokDashItem #2: %1.4f\n",
			 dblval);
		*retcode += 39;
		return 0;
	    }
      }

    ret = rl2_point_symbolizer_mark_get_stroke_dash_offset (point, 0, &dblval);
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetStrokeDashOffset #1\n",
			 style_name);
		*retcode += 40;
		return 0;
	    }
	  dblval = 0.0;
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetStrokeDashOffset #1\n",
			 style_name);
		*retcode += 41;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (dblval == 0.0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetStrokeDashOffset #1: %1.4f\n",
		   style_name, dblval);
	  *retcode += 42;
	  return 0;
      }

    ret = rl2_point_symbolizer_mark_has_fill (point, 0, &intval);
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark HasFill #1\n",
			 style_name);
		*retcode += 43;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark HasFill #1\n",
			 style_name);
		*retcode += 44;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    else
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark HasFill #1: %d\n",
		   style_name, intval);
	  *retcode += 45;
	  return 0;
      }

    string = rl2_point_symbolizer_mark_get_col_fill_color (point, 0);
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer Mark GetColFillColor #1\n",
			 style_name);
		*retcode += 46;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer Mark GetColFillColor #1\n",
			 style_name);
		*retcode += 47;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer Mark GetColFillColor #1: %s\n",
		   style_name, string);
	  *retcode += 48;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_opacity (point);
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColOpacity #1\n",
			 style_name);
		*retcode += 49;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColOpacity #1\n",
			 style_name);
		*retcode += 49;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "opacity") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColOpacity #1: %s\n",
		   style_name, string);
	  *retcode += 50;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_size (point);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Point Symbolizer GetColSize #1\n",
		   style_name);
	  *retcode += 51;
	  return 0;
      }
    intval = 0;
    if (strcmp (string, "size") == 0)
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColSize #1: %sn",
		   style_name, string);
	  *retcode += 52;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_rotation (point);
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColRotation #1\n",
			 style_name);
		*retcode += 53;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColRotation #1\n",
			 style_name);
		*retcode += 53;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "rotation") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColRotation #1: %s\n",
		   style_name, string);
	  *retcode += 54;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_anchor_point_x (point);
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColAnchorPoint X #1\n",
			 style_name);
		*retcode += 55;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColAnchorPoint X #1\n",
			 style_name);
		*retcode += 55;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "point_x") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColAnchorPoint X #1: %s\n",
		   style_name, string);
	  *retcode += 56;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_anchor_point_y (point);
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColAnchorPoint Y #1\n",
			 style_name);
		*retcode += 57;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColAnchorPoint Y #1\n",
			 style_name);
		*retcode += 58;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "point_y") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColAnchorPoint Y #1: %s\n",
		   style_name, string);
	  *retcode += 59;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_displacement_x (point);
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColDisplacement X #1\n",
			 style_name);
		*retcode += 60;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColDisplacement X #1\n",
			 style_name);
		*retcode += 60;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "displ_x") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColDisplacement X #1: %s\n",
		   style_name, string);
	  *retcode += 61;
	  return 0;
      }

    string = rl2_point_symbolizer_get_col_displacement_y (point);
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer GetColDisplacement Y #1\n",
			 style_name);
		*retcode += 62;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColDisplacement Y #1\n",
			 style_name);
		*retcode += 63;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "displ_y") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColDisplacement Y #1: %s\n",
		   style_name, string);
	  *retcode += 64;
	  return 0;
      }

    string =
	rl2_point_symbolizer_get_col_graphic_recode_color (point, 0, 0, &index);
    if (strcmp (style_name, "point_1_col") == 0
	|| strcmp (style_name, "point_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Point Symbolizer GetColGraphicRecodeColor #1\n",
			 style_name);
		*retcode += 65;
		return 0;
	    }
	  intval = 1;
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer GetColGraphicRecodeColor #1\n",
			 style_name);
		*retcode += 63;
		return 0;
	    }
	  intval = 0;
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer GetColGraphicRecodeColor #1: %s\n",
		   style_name, string);
	  *retcode += 66;
	  return 0;
      }

    intval = rl2_get_feature_type_style_columns_count (style);
    red = 0;
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (intval == 4)
	      red = 1;
      }
    if (strcmp (style_name, "point_2_col") == 0)
      {
	  if (intval == 7)
	      red = 1;
      }
    if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (intval == 9)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer StyleColumnsCount #1: %d\n",
		   style_name, intval);
	  *retcode += 67;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 0);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Point Symbolizer StyleColumnName #1\n",
		   style_name);
	  *retcode += 68;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0
	|| strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "opacity") == 0)
	      intval = 1;
      }
    else
      {
	  if (strcmp (string, "size") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer StyleColumnsName #1: %s\n",
		   style_name, string);
	  *retcode += 69;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 5);
    if (strcmp (style_name, "point_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Point Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 70;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Point Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 71;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "point_2_col") == 0)
      {
	  if (strcmp (string, "mark") == 0)
	      intval = 1;
      }
    else if (strcmp (style_name, "point_3_col") == 0)
      {
	  if (strcmp (string, "displ_x") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Point Symbolizer StyleColumnsName #2: %s\n",
		   style_name, string);
	  *retcode += 72;
	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}

int
main (int argc, char *argv[])
{
    int result = 0;
    int ret;
    sqlite3 *db_handle;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

/* opening and initializing the "memory" test DB */
    ret = sqlite3_open_v2 ("symbolizers.sqlite", &db_handle,
			   SQLITE_OPEN_READONLY, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_open_v2() error: %s\n",
		   sqlite3_errmsg (db_handle));
	  return -1;
      }
    spatialite_init_ex (db_handle, cache, 0);

/* tests */
    ret = -100;
    if (!test_symbolizer (db_handle, "point1", "point_1_col", &ret))
	return ret;
    ret = -200;
    if (!test_symbolizer (db_handle, "point2", "point_2_col", &ret))
	return ret;
    ret = -300;
    if (!test_symbolizer (db_handle, "point2", "point_3_col", &ret))
	return ret;

/* closing the DB */
    sqlite3_close (db_handle);
    spatialite_shutdown ();
    return result;
}

Added test/test_polygon_symbolizer_col.c.









































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
/*

 test_polygon_symbolizer.c -- RasterLite-2 Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2017
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

#include "sqlite3.h"
#include "spatialite.h"

#include "rasterlite2/rasterlite2.h"

static int
test_symbolizer (sqlite3 * db_handle, const char *coverage,
		 const char *style_name, int *retcode)
{
/* testing a PolygonSymbolizer */
    rl2FeatureTypeStylePtr style;
    rl2VectorSymbolizerPtr symbolizer;
    rl2PolygonSymbolizerPtr polyg;
    int intval;
    int index;
    int ret;
    double dblval;
    const char *string;
    unsigned char red;
    int scale_forbidden;
    style =
	rl2_create_feature_type_style_from_dbms (db_handle, NULL, coverage,
						 style_name);
    if (style == NULL)
      {
	  fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
	  *retcode += 1;
	  return 0;
      }

    symbolizer =
	rl2_get_symbolizer_from_feature_type_style (style, 1.0, NULL,
						    &scale_forbidden);
    if (symbolizer == NULL)
      {
	  fprintf (stderr, "Unexpected NULL VectorSymbolizer (%s)\n",
		   style_name);
	  *retcode += 2;
	  return 0;
      }

    if (rl2_is_valid_vector_symbolizer (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Validity #1\n",
		   style_name);
	  *retcode += 3;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Validity #1: %d\n",
		   style_name, intval);
	  *retcode += 4;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_count (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Count #1\n",
		   style_name);
	  *retcode += 5;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Count #1: %d\n",
		   style_name, intval);
	  *retcode += 6;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_item_type (symbolizer, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Item Type #1\n",
		   style_name);
	  *retcode += 7;
	  return 0;
      }
    if (intval != RL2_POLYGON_SYMBOLIZER)
      {
	  fprintf (stderr,
		   "%s: Unexpected Vector Symbolizer Item Type #1: %d\n",
		   style_name, intval);
	  *retcode += 8;
	  return 0;
      }

    polyg = rl2_get_polygon_symbolizer (symbolizer, 0);
    if (polyg == NULL)
      {
	  fprintf (stderr, "%s: Unable to get a Polygon Symbolizer #1\n",
		   style_name);
	  *retcode += 9;
	  return 0;
      }

    if (rl2_polygon_symbolizer_has_stroke (polyg, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Polygon Symbolizer HasStroke #1\n",
		   style_name);
	  *retcode += 10;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer HasStroke #1: %d\n",
		   style_name, intval);
	  *retcode += 11;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_stroke_color (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColStrokeColor #1\n",
			 style_name);
		*retcode += 12;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColStrokeColor #1\n",
			 style_name);
		*retcode += 13;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "stroke_color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColStrokeColor #1: %s\n",
		   style_name, string);
	  *retcode += 14;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_stroke_opacity (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColStrokeOpacity #1\n",
			 style_name);
		*retcode += 15;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColStrokeOpacity #1\n",
			 style_name);
		*retcode += 16;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "stroke_opacity") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "stroke_opacity") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColStrokeOpacity #1: %s\n",
		   style_name, string);
	  *retcode += 17;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_stroke_width (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColStrokeWidth #1\n",
			 style_name);
		*retcode += 15;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColStrokeWidth #1\n",
			 style_name);
		*retcode += 16;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "width") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "width") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColStrokeWidth #1: %s\n",
		   style_name, string);
	  *retcode += 17;
	  return 0;
      }

    ret = rl2_polygon_symbolizer_get_stroke_linejoin (polyg, &red);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetStrokeLinejoin #1\n",
			 style_name);
		*retcode += 16;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetStrokeLinejoin #1\n",
			 style_name);
		*retcode += 17;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_UNKNOWN)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (red == RL2_STROKE_LINEJOIN_BEVEL)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetStrokeLinejoin #1: %02x\n",
		   style_name, red);
	  *retcode += 18;
	  return 0;
      }

    ret = rl2_polygon_symbolizer_get_stroke_linecap (polyg, &red);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetStrokeLinecap #1\n",
			 style_name);
		*retcode += 19;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetStrokeLinecap #1\n",
			 style_name);
		*retcode += 20;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_UNKNOWN)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (red == RL2_STROKE_LINECAP_BUTT)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetStrokeLinecap #1: %02x\n",
		   style_name, red);
	  *retcode += 21;
	  return 0;
      }

    ret = rl2_polygon_symbolizer_get_stroke_dash_count (polyg, &intval);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetStrokeDashCount #1\n",
			 style_name);
		*retcode += 22;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetStrokeDashCount #1\n",
			 style_name);
		*retcode += 23;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
	red = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (intval == 6)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetStrokeDashCount #1: %d\n",
		   style_name, intval);
	  *retcode += 24;
	  return 0;
      }

    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 0, &dblval) ==
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Expected failure, got success: Polygon Symbolizer GetStrokeDashItem #1\n");
		*retcode += 25;
		return 0;
	    }
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 0, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetStrokeDashItem #1\n",
			 style_name);
		*retcode += 26;
		return 0;
	    }
	  if (dblval != 20.0)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #1: %1.4f\n",
			 dblval);
		*retcode += 27;
		return 0;
	    }
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 1, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Polygon Symbolizer GetStrokeDashItem #2\n");
		*retcode += 28;
		return 0;
	    }
	  if (dblval != 10.1)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #2: %1.4f\n",
			 dblval);
		*retcode += 29;
		return 0;
	    }
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 2, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Polygon Symbolizer GetStrokeDashItem #3\n");
		*retcode += 30;
		return 0;
	    }
	  if (dblval != 5.5)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #3: %1.4f\n",
			 dblval);
		*retcode += 31;
		return 0;
	    }
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 3, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Polygon Symbolizer GetStrokeDashItem #4\n");
		*retcode += 32;
		return 0;
	    }
	  if (dblval != 4.0)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #4: %1.4f\n",
			 dblval);
		*retcode += 33;
		return 0;
	    }
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 4, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Polygon Symbolizer GetStrokeDashItem #5\n");
		*retcode += 34;
		return 0;
	    }
	  if (dblval != 6.0)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #4: %1.4f\n",
			 dblval);
		*retcode += 35;
		return 0;
	    }
	  if (rl2_polygon_symbolizer_get_stroke_dash_item (polyg, 5, &dblval) !=
	      RL2_OK)
	    {
		fprintf (stderr,
			 "Unable to get Polygon Symbolizer GetStrokeDashItem #5\n");
		*retcode += 36;
		return 0;
	    }
	  if (dblval != 12.0)
	    {
		fprintf (stderr,
			 "Unexpected Polygon Symbolizer GetStrokDashItem #5: %1.4f\n",
			 dblval);
		*retcode += 37;
		return 0;
	    }
      }

    ret = rl2_polygon_symbolizer_get_stroke_dash_offset (polyg, &dblval);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetStrokeDashOffset #1\n",
			 style_name);
		*retcode += 38;
		return 0;
	    }
	  dblval = 0.0;
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetStrokeDashOffset #1\n",
			 style_name);
		*retcode += 39;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (dblval == 0.0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (dblval == 10.0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetStrokeDashOffset #1: %1.4f\n",
		   style_name, dblval);
	  *retcode += 40;
	  return 0;
      }

    if (rl2_polygon_symbolizer_has_fill (polyg, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Polygon Symbolizer HasFill #1\n",
		   style_name);
	  *retcode += 41;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr, "%s: Unexpected Polygon Symbolizer HasFill #1: %d\n",
		   style_name, intval);
	  *retcode += 42;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_fill_color (polyg);
    if (strcmp (style_name, "polygon_2_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColFillColor #1\n",
			 style_name);
		*retcode += 43;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColFillColor #1\n",
			 style_name);
		*retcode += 44;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (strcmp (string, "fill_color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColFillColor #1: %s\n",
		   style_name, string);
	  *retcode += 45;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_fill_opacity (polyg);
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColFillOpacity #1\n",
			 style_name);
		*retcode += 46;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColFillOpacity #1\n",
			 style_name);
		*retcode += 47;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (strcmp (string, "fill_opacity") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "fill_opacity") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColFillOpacity #1: %s\n",
		   style_name, string);
	  *retcode += 48;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_displacement_x (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: nexpected success Polygon Symbolizer GetColDisplacementX #1\n",
			 style_name);
		*retcode += 49;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColDisplacementX #1\n",
			 style_name);
		*retcode += 50;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "displ_x") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected polygon Symbolizer GetColDisplacementX #1: %s\n",
		   style_name, string);
	  *retcode += 51;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_displacement_y (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColDisplacementX #1\n",
			 style_name);
		*retcode += 51;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColDisplacementY #1\n",
			 style_name);
		*retcode += 52;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
	intval = 1;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "displ_y") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected polygon Symbolizer GetColDisplacementY #1: %s\n",
		   style_name, string);
	  *retcode += 53;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_perpendicular_offset (polyg);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 54;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 55;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "perpoff") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected polygon Symbolizer GetColPerpendicularOffset #1: %s\n",
		   style_name, string);
	  *retcode += 56;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_graphic_stroke_href (polyg);
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string == NULL)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string != NULL)
	    {
		if (strcmp (string, "pen_href") == 0)
		    intval = 1;
	    }
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Polygon Symbolizer GetColGraphicStrokeHref #1: %s\n",
		   style_name, string);
	  *retcode += 57;
	  return 0;
      }

    if (rl2_polygon_symbolizer_get_graphic_stroke_recode_count (polyg, &intval)
	!= RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Polygon Symbolizer GetGraphicStrokeRecodeCount #1\n",
		   style_name);
	  *retcode += 58;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Polygon Symbolizer GetColGraphicStrokeRecodeCount #1: %d\n",
		   style_name, intval);
	  *retcode += 59;
	  return 0;
      }

    string =
	rl2_polygon_symbolizer_get_col_graphic_stroke_recode_color (polyg, 0,
								    &index);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColGraphicStrokeRecodeColor #1\n",
			 style_name);
		*retcode += 60;
		return 0;
	    }
	  intval = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColGraphicStrokeRecodeColor #1\n",
			 style_name);
		*retcode += 61;
		return 0;
	    }
	  intval = 0;
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColGraphicStrokeRecodeColor #1: %s\n",
		   style_name, string);
	  *retcode += 62;
	  return 0;
      }

    string = rl2_polygon_symbolizer_get_col_graphic_fill_href (polyg);
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string == NULL)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string != NULL)
	    {
		if (strcmp (string, "brush_href") == 0)
		    intval = 1;
	    }
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Polygon Symbolizer GetColGraphicFillHref #1: %s\n",
		   style_name, string);
	  *retcode += 63;
	  return 0;
      }

    if (rl2_polygon_symbolizer_get_graphic_fill_recode_count (polyg, &intval) !=
	RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Polygon Symbolizer GetGraphicFillRecodeCount #1\n",
		   style_name);
	  *retcode += 64;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s; Unexpected Polygon Symbolizer GetGraphicFillRecodeCount #1: %d\n",
		   style_name, intval);
	  *retcode += 65;
	  return 0;
      }

    string =
	rl2_polygon_symbolizer_get_col_graphic_fill_recode_color (polyg, 0,
								  &index);
    if (strcmp (style_name, "polygon_1_col") == 0
	|| strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Polygon Symbolizer GetColGraphicFillRecodeColor #1\n",
			 style_name);
		*retcode += 66;
		return 0;
	    }
	  intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer GetColGraphicFillRecodeColor #1\n",
			 style_name);
		*retcode += 67;
		return 0;
	    }
	  intval = 0;
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer GetColGraphicFillRecodeColor #1: %s\n",
		   style_name, string);
	  *retcode += 68;
	  return 0;
      }

    intval = rl2_get_feature_type_style_columns_count (style);
    red = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (intval == 7)
	      red = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (intval == 6)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer StyleColumnsCount #1: %d\n",
		   style_name, intval);
	  *retcode += 69;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 0);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Polygon Symbolizer StyleColumnName #1\n",
		   style_name);
	  *retcode += 70;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (strcmp (string, "fill_color") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "pen_href") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "stroke_color") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer StyleColumnsName #1: %s\n",
		   style_name, string);
	  *retcode += 71;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 5);
    if (strcmp (style_name, "polygon_1_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Polygon Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 72;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Polygon Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 73;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "polygon_2_col") == 0)
      {
	  if (strcmp (string, "perpoff") == 0)
	      intval = 1;
      }
    else if (strcmp (style_name, "polygon_3_col") == 0)
      {
	  if (strcmp (string, "color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Polygon Symbolizer StyleColumnsName #2: %s\n",
		   style_name, string);
	  *retcode += 74;
	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}

int
main (int argc, char *argv[])
{
    int result = 0;
    int ret;
    sqlite3 *db_handle;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

/* opening and initializing the "memory" test DB */
    ret = sqlite3_open_v2 ("symbolizers.sqlite", &db_handle,
			   SQLITE_OPEN_READONLY, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_open_v2() error: %s\n",
		   sqlite3_errmsg (db_handle));
	  return -1;
      }
    spatialite_init_ex (db_handle, cache, 0);

/* tests */
    ret = -100;
    if (!test_symbolizer (db_handle, "polyg1", "polygon_1_col", &ret))
	return ret;
    ret = -200;
    if (!test_symbolizer (db_handle, "polyg2", "polygon_2_col", &ret))
	return ret;
    ret = -300;
    if (!test_symbolizer (db_handle, "polyg2", "polygon_3_col", &ret))
	return ret;

/* closing the DB */
    sqlite3_close (db_handle);
    spatialite_shutdown ();
    return result;
}

Changes to test/test_text_symbolizer.c.

932
933
934
935
936
937
938













































939
940
941
942
943
944
945
946
947
948
949
950
951
952
...
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
....
1007
1008
1009
1010
1011
1012
1013
1014













































1015
1016
1017
1018
1019
1020
1021
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HaloFillColor #1: #%02x%02x%02x\n",
		   style_name, red, green, blue);
	  *retcode += 63;
	  return 0;
      }














































    if (rl2_text_symbolizer_has_fill (text, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer HasFill #1\n",
		   style_name);
	  *retcode += 64;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (intval == 1)
	      red = 1;
................................................................................
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HasFill #1: %d\n",
		   style_name, intval);
	  *retcode += 65;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_fill_color (text, &red, &green, &blue);
    if (strcmp (style_name, "label_3") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer FillColor #1\n",
			 style_name);
		*retcode += 66;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer FillColor #1\n",
			 style_name);
		*retcode += 67;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (red == 0x06 && green == 0x0a && blue == 0x0f)
................................................................................
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer FillColor #1: #%02x%02x%02x\n",
		   style_name, red, green, blue);
	  *retcode += 69;













































	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






|







 







|











|










|







 







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
....
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
....
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HaloFillColor #1: #%02x%02x%02x\n",
		   style_name, red, green, blue);
	  *retcode += 63;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_halo_fill_opacity (text, &dblval);
    if (strcmp (style_name, "label_3") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer HaloFillOpacity #1\n",
			 style_name);
		*retcode += 64;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer HaloFillOpacity #1\n",
			 style_name);
		*retcode += 65;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (dblval == 1.0)
	      intval = 1;
      }
    else if (strcmp (style_name, "label_2") == 0)
      {
	  if (dblval == 0.8)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HaloFillOpacity #1: %1.2f\n",
		   style_name, dblval);
	  *retcode += 66;
	  return 0;
      }

    if (rl2_text_symbolizer_has_fill (text, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer HasFill #1\n",
		   style_name);
	  *retcode += 67;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (intval == 1)
	      red = 1;
................................................................................
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HasFill #1: %d\n",
		   style_name, intval);
	  *retcode += 68;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_fill_color (text, &red, &green, &blue);
    if (strcmp (style_name, "label_3") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer FillColor #1\n",
			 style_name);
		*retcode += 69;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer FillColor #1\n",
			 style_name);
		*retcode += 70;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (red == 0x06 && green == 0x0a && blue == 0x0f)
................................................................................
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer FillColor #1: #%02x%02x%02x\n",
		   style_name, red, green, blue);
	  *retcode += 71;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_fill_opacity (text, &dblval);
    if (strcmp (style_name, "label_3") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer FillOpacity #1\n",
			 style_name);
		*retcode += 72;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer FillOpacity #1\n",
			 style_name);
		*retcode += 73;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1") == 0)
      {
	  if (dblval == 1.0)
	      intval = 1;
      }
    else if (strcmp (style_name, "label_2") == 0)
      {
	  if (dblval == 0.5)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer FillOpacity #1: %1.2f\n",
		   style_name, dblval);
	  *retcode += 74;
	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}

Added test/test_text_symbolizer_col.c.























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
/*

 test_text_symbolizer_col.c -- RasterLite-2 Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the RasterLite2 library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2017
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>

#include "sqlite3.h"
#include "spatialite.h"

#include "rasterlite2/rasterlite2.h"

static int
test_symbolizer (sqlite3 * db_handle, const char *coverage,
		 const char *style_name, int *retcode)
{
/* testing a TextSymbolizer */
    rl2FeatureTypeStylePtr style;
    rl2VectorSymbolizerPtr symbolizer;
    rl2TextSymbolizerPtr text;
    int intval;
    int ret;
    const char *string;
    unsigned char red;
    int scale_forbidden;
    style =
	rl2_create_feature_type_style_from_dbms (db_handle, NULL, coverage,
						 style_name);
    if (style == NULL)
      {
	  fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
	  *retcode += 1;
	  return 0;
      }

    symbolizer =
	rl2_get_symbolizer_from_feature_type_style (style, 1.0, NULL,
						    &scale_forbidden);
    if (symbolizer == NULL)
      {
	  fprintf (stderr, "Unexpected NULL VectorSymbolizer (%s)\n",
		   style_name);
	  *retcode += 2;
	  return 0;
      }

    if (rl2_is_valid_vector_symbolizer (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Validity #1\n",
		   style_name);
	  *retcode += 3;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Validity #1: %d\n",
		   style_name, intval);
	  *retcode += 4;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_count (symbolizer, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Count #1\n",
		   style_name);
	  *retcode += 5;
	  return 0;
      }
    if (intval != 1)
      {
	  fprintf (stderr, "%s: Unexpected Vector Symbolizer Count #1: %d\n",
		   style_name, intval);
	  *retcode += 6;
	  return 0;
      }

    if (rl2_get_vector_symbolizer_item_type (symbolizer, 0, &intval) != RL2_OK)
      {
	  fprintf (stderr, "%s: Unable to get Vector Symbolizer Item Type #1\n",
		   style_name);
	  *retcode += 7;
	  return 0;
      }
    if (intval != RL2_TEXT_SYMBOLIZER)
      {
	  fprintf (stderr,
		   "%s: Unexpected Vector Symbolizer Item Type #1: %d\n",
		   style_name, intval);
	  *retcode += 8;
	  return 0;
      }

    text = rl2_get_text_symbolizer (symbolizer, 0);
    if (text == NULL)
      {
	  fprintf (stderr, "%s: Unable to get a Text Symbolizer #1\n",
		   style_name);
	  *retcode += 9;
	  return 0;
      }

    string = rl2_text_symbolizer_get_label (text);
    intval = 0;
    if (string != NULL)
      {
	  fprintf (stderr,
		   "%s; Unexpected Text Symbolizer GetLabel #1: %s\n",
		   style_name, string);
	  *retcode += 10;
	  return 0;
      }

    if (rl2_text_symbolizer_get_font_families_count (text, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer GetFontFamiliesCount #1\n",
		   style_name);
	  *retcode += 11;
	  return 0;
      }
    red = 0;
    if (intval == 0)
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetFontFamiliesCount #1: %d\n",
		   style_name, intval);
	  *retcode += 12;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_label (text);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer GetColLabel #1\n",
		   style_name);
	  *retcode += 13;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "some_column") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (strcmp (string, "label_column") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetColLabel #1: %s\n",
		   style_name, string);
	  *retcode += 14;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_font (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetColFontName #1\n",
			 style_name);
		*retcode += 15;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetColFontName #1\n",
			 style_name);
		*retcode += 15;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "font") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetColFontName #1: %s\n",
		   style_name, string);
	  *retcode += 16;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_style (text);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer GetColFontStyle #1\n",
		   style_name);
	  *retcode += 17;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "style") == 0)
	      intval = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (strcmp (string, "col_style") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetColFontStyle #1: %s\n",
		   style_name, string);
	  *retcode += 18;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_weight (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetColFontWeight #1\n",
			 style_name);
		*retcode += 19;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetColFontWeight #1\n",
			 style_name);
		*retcode += 19;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "weight") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetColFontWeight #1: %s\n",
		   style_name, string);
	  *retcode += 20;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_size (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetColFontSize #1\n",
			 style_name);
		*retcode += 21;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetColFontSize #1\n",
			 style_name);
		*retcode += 21;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "size") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetColFontSize #1: %s\n",
		   style_name, string);
	  *retcode += 22;
	  return 0;
      }

    if (rl2_text_symbolizer_get_label_placement_mode (text, &red) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer GetLabelPlacementMode #1\n",
		   style_name);
	  *retcode += 23;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (red == RL2_LABEL_PLACEMENT_POINT)
	      intval = 1;
      }
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (red == RL2_LABEL_PLACEMENT_LINE)
	      intval = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (red == RL2_LABEL_PLACEMENT_UNKNOWN)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLabelPlacementMode #1: %02x\n",
		   style_name, red);
	  *retcode += 24;
	  return 0;
      }

    string = rl2_text_symbolizer_get_point_placement_col_anchor_point_x (text);
    if (strcmp (style_name, "label_2_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetPointPlacementAnchorPointX #1\n",
			 style_name);
		*retcode += 25;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetPointPlacementColAnchorPointX #1\n",
			 style_name);
		*retcode += 25;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "point_x") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetPointPlacementColAnchorPointX #1: %s\n",
		   style_name, string);
	  *retcode += 26;
	  return 0;
      }

    string = rl2_text_symbolizer_get_point_placement_col_anchor_point_y (text);
    if (strcmp (style_name, "label_2_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetPointPlacementColAnchorPointY #1\n",
			 style_name);
		*retcode += 27;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetPointPlacementColAnchorPointY #1\n",
			 style_name);
		*retcode += 27;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "point_y") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetPointPlacementColAnchorPointY #1: %s\n",
		   style_name, string);
	  *retcode += 28;
	  return 0;
      }

    string = rl2_text_symbolizer_get_point_placement_col_displacement_x (text);
    if (strcmp (style_name, "label_2_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetPointPlacementColDisplacemenX #1\n",
			 style_name);
		*retcode += 29;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetPointPlacementColDisplacementX #1\n",
			 style_name);
		*retcode += 29;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "displ_x") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetPointPlacementColDisplacementX #1: %s\n",
		   style_name, string);
	  *retcode += 30;
	  return 0;
      }

    string = rl2_text_symbolizer_get_point_placement_col_displacement_y (text);
    if (strcmp (style_name, "label_2_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetPointPlacementColDisplacemenY #1\n",
			 style_name);
		*retcode += 31;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetPointPlacementColDisplacementY #1\n",
			 style_name);
		*retcode += 31;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "displ_y") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetPointPlacementColDisplacementY #1: %s\n",
		   style_name, string);
	  *retcode += 32;
	  return 0;
      }

    string = rl2_text_symbolizer_get_point_placement_col_rotation (text);
    if (strcmp (style_name, "label_2_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetPointPlacementColRotation #1\n",
			 style_name);
		*retcode += 33;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetPointPlacementColRotation #1\n",
			 style_name);
		*retcode += 33;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "rotation") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetPointPlacementColRotation #1: %s\n",
		   style_name, string);
	  *retcode += 34;
	  return 0;
      }

    string =
	rl2_text_symbolizer_get_line_placement_col_perpendicular_offset (text);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 35;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementColPerpendicularOffset #1\n",
			 style_name);
		*retcode += 36;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "perpoff") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementColPerpendicularOffset #1: %s\n",
		   style_name, string);
	  *retcode += 37;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_line_placement_is_repeated (text, &intval);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementIsRepeated #1\n",
			 style_name);
		*retcode += 38;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementIsRepeated #1\n",
			 style_name);
		*retcode += 39;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    else
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementIsRepeated #1: %d\n",
		   style_name, intval);
	  *retcode += 40;
	  return 0;
      }

    string = rl2_text_symbolizer_get_line_placement_col_initial_gap (text);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementColInitialGap #1\n",
			 style_name);
		*retcode += 41;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementColInitialGap #1\n",
			 style_name);
		*retcode += 42;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "inigap") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementColInitialGap #1: %s\n",
		   style_name, string);
	  *retcode += 43;
	  return 0;
      }

    string = rl2_text_symbolizer_get_line_placement_col_gap (text);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementColGap #1\n",
			 style_name);
		*retcode += 44;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementColGap #1\n",
			 style_name);
		*retcode += 45;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "gap") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementColGap #1: %s\n",
		   style_name, string);
	  *retcode += 46;
	  return 0;
      }

    ret = rl2_text_symbolizer_get_line_placement_is_aligned (text, &intval);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementIsAligned #1\n",
			 style_name);
		*retcode += 47;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementIsAligned #1\n",
			 style_name);
		*retcode += 48;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    else
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementIsAligned #1: %d\n",
		   style_name, intval);
	  *retcode += 49;
	  return 0;
      }

    ret =
	rl2_text_symbolizer_get_line_placement_generalize_line (text, &intval);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetLinePlacementGeneralizeLine #1\n",
			 style_name);
		*retcode += 50;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetLinePlacementGeneralizeLine #1\n",
			 style_name);
		*retcode += 51;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    else
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetLinePlacementGeneralizeLine #1: %d\n",
		   style_name, intval);
	  *retcode += 52;
	  return 0;
      }

    if (rl2_text_symbolizer_has_halo (text, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer HasHalo #1\n",
		   style_name);
	  *retcode += 54;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HasHalo #1: %d\n",
		   style_name, intval);
	  *retcode += 55;
	  return 0;
      }

    string = rl2_text_symbolizer_get_halo_col_radius (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer GetHaloColRadius #1\n",
			 style_name);
		*retcode += 56;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer GetHaloColRadius #1\n",
			 style_name);
		*retcode += 57;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "halo_radius") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer GetHaloColRadius #1: %s\n",
		   style_name, string);
	  *retcode += 58;
	  return 0;
      }

    ret = rl2_text_symbolizer_has_halo_fill (text, &intval);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (ret == RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer HasHaloFill #1\n",
			 style_name);
		*retcode += 59;
		return 0;
	    }
      }
    else
      {
	  if (ret != RL2_OK)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer HasHaloFill #1\n",
			 style_name);
		*retcode += 60;
		return 0;
	    }
      }
    red = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
	red = 1;
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HasHaloFill #1: %d\n",
		   style_name, intval);
	  *retcode += 61;
	  return 0;
      }

    string = rl2_text_symbolizer_get_halo_col_fill_color (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer HaloColFillColor #1\n",
			 style_name);
		*retcode += 62;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer HaloColFillColor #1\n",
			 style_name);
		*retcode += 63;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "halo_color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HaloColFillColor #1: %s\n",
		   style_name, string);
	  *retcode += 64;
	  return 0;
      }

    string = rl2_text_symbolizer_get_halo_col_fill_opacity (text);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer HaloColFillOpacity #1\n",
			 style_name);
		*retcode += 65;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer HaloColFillOpacity #1\n",
			 style_name);
		*retcode += 66;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "halo_opacity") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HaloColFillOpacity #1: %s\n",
		   style_name, string);
	  *retcode += 67;
	  return 0;
      }

    if (rl2_text_symbolizer_has_fill (text, &intval) != RL2_OK)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer HasFill #1\n",
		   style_name);
	  *retcode += 68;
	  return 0;
      }
    red = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 1)
	      red = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (intval == 0)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer HasFill #1: %d\n",
		   style_name, intval);
	  *retcode += 69;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_fill_color (text);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer ColFillColor #1\n",
			 style_name);
		*retcode += 70;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer ColFillColor #1\n",
			 style_name);
		*retcode += 71;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "fill_color") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer ColFillColor #1: %s\n",
		   style_name, string);
	  *retcode += 72;
	  return 0;
      }

    string = rl2_text_symbolizer_get_col_fill_opacity (text);
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success Text Symbolizer ColFillOpacity #1\n",
			 style_name);
		*retcode += 73;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer ColFillOpacity #1\n",
			 style_name);
		*retcode += 74;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "fill_opacity") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer ColFillOpacity #1: %s\n",
		   style_name, string);
	  *retcode += 75;
	  return 0;
      }

    intval = rl2_get_feature_type_style_columns_count (style);
    red = 0;
    if (strcmp (style_name, "label_1_col") == 0
	|| strcmp (style_name, "label_2_col") == 0)
      {
	  if (intval == 13)
	      red = 1;
      }
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (intval == 2)
	      red = 1;
      }
    if (red != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer StyleColumnsCount #1: %d\n",
		   style_name, intval);
	  *retcode += 76;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 0);
    if (string == NULL)
      {
	  fprintf (stderr,
		   "%s: Unable to get Text Symbolizer StyleColumnName #1\n",
		   style_name);
	  *retcode += 77;
	  return 0;
      }
    intval = 0;
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (strcmp (string, "label_column") == 0)
	      intval = 1;
      }
    else
      {
	  if (strcmp (string, "some_column") == 0)
	      intval = 1;
      }
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer StyleColumnsName #1: %s\n",
		   style_name, string);
	  *retcode += 78;
	  return 0;
      }

    string = rl2_get_feature_type_style_column_name (style, 7);
    if (strcmp (style_name, "label_3_col") == 0)
      {
	  if (string != NULL)
	    {
		fprintf (stderr,
			 "%s: Unexpected success: Text Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 79;
		return 0;
	    }
      }
    else
      {
	  if (string == NULL)
	    {
		fprintf (stderr,
			 "%s: Unable to get Text Symbolizer StyleColumnName #2\n",
			 style_name);
		*retcode += 80;
		return 0;
	    }
      }
    intval = 0;
    if (strcmp (style_name, "label_1_col") == 0)
      {
	  if (strcmp (string, "displ_x") == 0)
	      intval = 1;
      }
    else if (strcmp (style_name, "label_2_col") == 0)
      {
	  if (strcmp (string, "gap") == 0)
	      intval = 1;
      }
    else
	intval = 1;
    if (intval != 1)
      {
	  fprintf (stderr,
		   "%s: Unexpected Text Symbolizer StyleColumnsName #2: %s\n",
		   style_name, string);
	  *retcode += 81;
	  return 0;
      }

    rl2_destroy_feature_type_style (style);
    return 1;
}

int
main (int argc, char *argv[])
{
    int result = 0;
    int ret;
    sqlite3 *db_handle;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

/* opening and initializing the "memory" test DB */
    ret = sqlite3_open_v2 ("symbolizers.sqlite", &db_handle,
			   SQLITE_OPEN_READONLY, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_open_v2() error: %s\n",
		   sqlite3_errmsg (db_handle));
	  return -1;
      }
    spatialite_init_ex (db_handle, cache, 0);

/* tests */
    ret = -100;
    if (!test_symbolizer (db_handle, "points", "label_1_col", &ret))
	return ret;
    ret = -200;
    if (!test_symbolizer (db_handle, "lines", "label_2_col", &ret))
	return ret;
    ret = -300;
    if (!test_symbolizer (db_handle, "points", "label_3_col", &ret))
	return ret;

/* closing the DB */
    sqlite3_close (db_handle);
    spatialite_shutdown ();
    return result;
}