lineObj = multipointObj */
| 804 | |
| 805 | /* lineObj = multipointObj */ |
| 806 | static int loadFeaturePoints(lineObj *points) |
| 807 | { |
| 808 | int buffer_size=0; |
| 809 | |
| 810 | points->point = (pointObj *)malloc(sizeof(pointObj)*MS_FEATUREINITSIZE); |
| 811 | MS_CHECK_ALLOC(points->point, sizeof(pointObj)*MS_FEATUREINITSIZE, MS_FAILURE); |
| 812 | points->numpoints = 0; |
| 813 | buffer_size = MS_FEATUREINITSIZE; |
| 814 | |
| 815 | for(;;) { |
| 816 | switch(msyylex()) { |
| 817 | case(EOF): |
| 818 | msSetError(MS_EOFERR, NULL, "loadFeaturePoints()"); |
| 819 | return(MS_FAILURE); |
| 820 | case(END): |
| 821 | return(MS_SUCCESS); |
| 822 | case(MS_NUMBER): |
| 823 | if(points->numpoints == buffer_size) { /* just add it to the end */ |
| 824 | points->point = (pointObj *) realloc(points->point, sizeof(pointObj)*(buffer_size+MS_FEATUREINCREMENT)); |
| 825 | MS_CHECK_ALLOC(points->point, sizeof(pointObj)*(buffer_size+MS_FEATUREINCREMENT), MS_FAILURE); |
| 826 | buffer_size+=MS_FEATUREINCREMENT; |
| 827 | } |
| 828 | |
| 829 | points->point[points->numpoints].x = atof(msyystring_buffer); |
| 830 | if(getDouble(&(points->point[points->numpoints].y)) == -1) return(MS_FAILURE); |
| 831 | |
| 832 | points->numpoints++; |
| 833 | break; |
| 834 | default: |
| 835 | msSetError(MS_IDENTERR, "Parsing error near (%s):(line %d)", "loadFeaturePoints()", msyystring_buffer, msyylineno ); |
| 836 | return(MS_FAILURE); |
| 837 | } |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | static int loadFeature(layerObj *player, int type) |
| 842 | { |
no test coverage detected