Changeset 17965
- Timestamp:
- 09/19/12 17:15:47 (12 years ago)
- Location:
- titan/titan
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/global.h
r17963 r17965 1 1 #ifndef GLOBAL_H 2 2 #define GLOBAL_H 3 4 char* readfromlinetoline(char* str, int start, int end, int flag) 5 { 6 if(str == NULL) return str; 7 8 char* tmpstr = NULL; 9 int count = 0; 10 int i = 0; 11 struct splitstr* ret = NULL; 12 ret = strsplit(str, "\n", &count); 13 14 for(i = 0; i < count; i++) 15 { 16 if(i >= start && i <= end) 17 { 18 tmpstr = ostrcat(tmpstr, (&ret[i])->part, 1, 0); 19 tmpstr = ostrcat(tmpstr, "\n", 1, 0); 20 } 21 } 22 free(ret), ret = NULL; 23 24 if(flag == 1) 25 { 26 free(str), str = NULL; 27 } 28 return tmpstr; 29 } 3 30 4 31 char* ltostr(char* str, long val, unsigned base) -
titan/titan/header.h
r17945 r17965 8 8 #ifndef HEADER_H 9 9 #define HEADER_H 10 11 char* gethttpreal(char* host, char* page, int port, char* filename, char* auth, struct download* dnode, int redirect, char* header, long* clen); 12 int sockreceive(int *fd, unsigned char* data, int count, int timeout); 10 13 11 14 //rc4.h … … 641 644 void htmldecode3(char* to, char* from); 642 645 char* string_deltags(char* str); 646 char* readfromlinetoline(char* str, int start, int end, int flag); 643 647 644 648 //rcconfig.h -
titan/titan/info.h
r17951 r17965 65 65 char* boxversion = string_tolower(readsys("/etc/model", 1)); 66 66 char* path = NULL; 67 char* out = NULL; 67 68 path = ostrcat(path, "/svn/image-beta/changelog.", 1, 0); 68 69 path = ostrcat(path, boxversion, 1, 0); … … 71 72 free(path), path = NULL; 72 73 free(boxversion), boxversion = NULL; 73 changetext(info, tmpstr); 74 out = readfromlinetoline(tmpstr, 37, 537, 1); 75 changetext(info, out); 74 76 } 75 77 else if(mode == 2) 76 78 { 77 79 char* path = NULL; 80 char* out = NULL; 78 81 path = ostrcat(path, "/svn/image-beta/changelog.git", 1, 0); 79 82 tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, NULL, 0); 80 83 free(path), path = NULL; 81 changetext(info, tmpstr); 84 out = readfromlinetoline(tmpstr, 0, 500, 1); 85 changetext(info, out); 82 86 } 83 87
Note: See TracChangeset
for help on using the changeset viewer.