linklist.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author:
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. #if 0
  10. void ll_update(HWND hwndDlg)
  11. {
  12. char TEMPFILE2[MAX_PATH] = {0};
  13. char buf[1024] = {0};
  14. int success=0;
  15. lstrcpyn(TEMPFILE2,TEMP_FILE, MAX_PATH-1); // -1 because we strcat a "0"
  16. lstrcat(TEMPFILE2,"0");
  17. {
  18. char url[512] = {0};
  19. int c='y',r='n';
  20. {
  21. FILE *fp = fopen(LINKFILE,"rt");
  22. if (fp)
  23. {
  24. fclose(fp);
  25. c='n';
  26. }
  27. }
  28. wsprintf(url,"http://client.winamp.com/update/updatelinks.jhtml?i=%c&v=%s&r=%c",
  29. c,
  30. app_version,r);
  31. if (!httpRetrieveFile(hwndDlg,url,TEMPFILE2,getString(IDS_DLINK_GETTING,NULL,0)))
  32. {
  33. int st=0;
  34. FILE *fp = fopen(TEMPFILE2,"rt");
  35. char bnav[1024]="";
  36. char d_bloc[128]="DefBrowseLoc";
  37. if (*config_browserbrand)
  38. {
  39. lstrcat(d_bloc,"_");
  40. lstrcat(d_bloc,config_browserbrand);
  41. }
  42. lstrcat(d_bloc," ");
  43. if (fp)
  44. {
  45. while (!feof(fp))
  46. {
  47. fgets(buf,sizeof(buf),fp);
  48. if (!strcmp(buf,"Winamp Links File v1.0\n")) st|=1;
  49. if (!strncmp(buf,"EndFile",7)) st|=2;
  50. if (!_strnicmp(buf,d_bloc,lstrlen(d_bloc)))
  51. {
  52. lstrcpyn(bnav, buf+lstrlen(d_bloc), 1024);
  53. }
  54. }
  55. fclose(fp);
  56. }
  57. if (st==3)
  58. {
  59. DeleteFile(LINKFILE);
  60. MoveFile(TEMPFILE2,LINKFILE);
  61. success=1;
  62. }
  63. if (success)
  64. {
  65. char str[256]="";
  66. char *s="http://client.winamp.com/update/mb.html";
  67. GetPrivateProfileString("Winamp","MBDefLoc",s,str,sizeof(str),INI_FILE);
  68. if (_strnicmp(str,"http://",7)) lstrcpy(str,s);
  69. httpRetrieveFile(hwndDlg,str,MBFILE,getString(IDS_DLINK_GETTING,NULL,0));
  70. if (strcmp(str,s)) mbctl_navigate(str,str);
  71. else if (isInetAvailable())
  72. {
  73. char *t;
  74. if (bnav[0] && (t=strstr(bnav," ")))
  75. {
  76. *t++=0;
  77. mbctl_navigate(bnav,t);
  78. }
  79. else mbctl_navigate("http://client.winamp.com/browser/","Winamp Minibrowser");
  80. }
  81. else mbctl_navigate(MBFILE,"Winamp Minibrowser");
  82. }
  83. }
  84. DeleteFile(TEMPFILE2);
  85. }
  86. }
  87. #endif