bookmark.cpp 507 B

12345678910111213141516171819202122232425
  1. #include "main.h"
  2. #include "api.h"
  3. #include <stdio.h>
  4. void Bookmark_additem(char *fn, char *ft)
  5. {
  6. FILE *fp;
  7. fp=fopen(BOOKMARKFILE,"a+t");
  8. if (fp)
  9. {
  10. char *buf=(char*)malloc(lstrlen(fn)+lstrlen(ft)+3);
  11. fprintf(fp,"%s\n%s\n",fn,ft);
  12. fclose(fp);
  13. if (buf)
  14. {
  15. lstrcpy(buf,fn);
  16. lstrcpy(buf+lstrlen(buf)+1,ft);
  17. SendMessage(hMainWindow,WM_WA_IPC,(WPARAM)buf,IPC_ADDBOOKMARK);
  18. free(buf);
  19. AGAVE_API_STATS->IncrementStat(api_stats::BOOKMARK_COUNT);
  20. }
  21. }
  22. }