Advertisement
Guest User

Goldiller

a guest
May 1st, 2009
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. stock INI_Create(const filename[])
  2. {
  3.     new File:h;
  4.     h=fopen(filename,io_write);
  5.     if (h) {
  6.         fclose(h);
  7.         return true;
  8.     }
  9.     return false;
  10. }
  11. //
  12. stock bool:INI_ReadBool(const key[])
  13. {
  14.     new dest[11];
  15.     if (INI_ReadString(dest, key)) return bool:strval(dest);
  16.     return false;
  17. }
  18. //
  19. stock INI_IsSet(const key[]) {
  20.     if ((!gFile[E_OPEN]) || (!key[0])) return false;
  21.     new ln = -1;
  22.     while (((ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
  23.     {
  24.         ln ++;
  25.         if (gCache[ln][E_VALUE][0] == ';') continue;
  26.         if (!strcmp(gCache[ln][E_KEY], key, false))
  27.         {
  28.             return true;
  29.         }
  30.     }
  31.     return false;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement