/*
    lsnet is a light weight computer resource/stats monitor.
    Copyright (C) 2009  Sterling Pickens

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#include "image_sizes.h"


int image_width[5], image_height[5];
//int memarray1[9];



void image_sizes(int selection) {

/*
	FILE* fp;
        if( ( fp = fopen( global_strs.conf_file, "r" ) ) == NULL ) {
                fprintf( stderr, "Error opening file %s\n", global_strs.conf_file );
                exit( 1 );
        }
	//image_width = 0;
	//image_height = 0;

### image sizes
0 CPU SIZE: 1620x955
1 MEM SIZE: 1620x255
2 SWAP SIZE: 1620x155
3 NET1 SIZE: 1620x255
4 NET2 SIZE: 1620x255

        char compstr[11];
        char buf[50];
	char temp[2];
	char outstr[15];

	int count1;
	int calc1 = 0;
*/


	//memset ((void*) compstr, '\0', sizeof (compstr));
	if(selection == 0){
		image_width[selection] = 1620;
		image_height[selection] = 955;
		return;
		//strcpy(compstr, "CPU SIZE:");
	}else if(selection == 1){
                image_width[selection] = 1620;
                image_height[selection] = 255;
		return;
		//strcpy(compstr, "MEM SIZE:");
	}else if(selection == 2){
                image_width[selection] = 1620;
                image_height[selection] = 155;
		return;
		//strcpy(compstr, "SWAP SIZE:");
	}else if(selection == 3){
                image_width[selection] = 1620;
                image_height[selection] = 255;
		return;
		//strcpy(compstr, "NET1 SIZE:");
	}else if(selection == 4){
                image_width[selection] = 1620;
                image_height[selection] = 255;
		return;
		//strcpy(compstr, "NET2 SIZE:");
	}else{
		printf("lsgd: FATAL: invalid selection in image_sizes(int selection): %d\n", selection);
		exit(1);
	}


/*
                while( fgets(buf, sizeof(buf), fp) != NULL)
                {
			//count1 = 0;
                        if (buf[0] == compstr[0]){
                                if (buf[1] == compstr[1]){
                                        if (buf[2] == compstr[2]){
                                                if (buf[3] == compstr[3]){
                                                        if (buf[4] == compstr[4]){
								if (buf[5] == compstr[5]){
									if (buf[6] == compstr[6]){
										if (buf[7] == compstr[7]){

								calc1 = strlen(compstr);
								calc1++;	
                                                                temp[0]=buf[calc1];
                                                                strcpy(outstr, temp);
								calc1++;
								for (count1 = calc1; count1 != '\n' && buf[count1] != 'x';count1++)
								{
									temp[0]=buf[count1];
									temp[1]=0;
									strcat(outstr,temp);
									//image_width[selection] = atoi(outstr);
									//printf("width: %d\n", image_width[selection]);
								}
								image_width[selection] = atoi(outstr);
								printf("width: %d\n", image_width[selection]);
								count1++;
								temp[0]=buf[count1];								
								strcpy(outstr, temp);
								count1++;

                                                                for (count1 = count1; count1 <= strlen(buf) && buf[count1] != '\n'; count1++)
                                                                {
                                                                        temp[0]=buf[count1];
                                                                        temp[1]=0;
                                                                        strcat(outstr,temp);
									//image_height[selection] = atoi(outstr);
									//printf("height: %d\n", image_height[selection]);
                                                                }
								image_height[selection] = atoi(outstr);
								printf("height: %d\n", image_height[selection]);

										}
									}
								}

                                                        }  
                                                }
                                        }
                                }
                        }
                }

*/

	return;
}

