/* file.c - file I/O functions */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2006,2007,2009 Free Software Foundation, Inc.
*
* 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.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#define SUPPORT_PROGRESS
#ifdef SUPPORT_PROGRESS
#endif
void (*EXPORT_VAR (grub_grubnet_fini)) (void);
int grub_print_progress;
/* Get the device part of the filename NAME. It is enclosed by parentheses. */
char *
{
if (name[0] == '(')
{
char *ret;
if (! p)
{
return 0;
}
if (! ret)
return 0;
return ret;
}
return 0;
}
{
char *device_name;
char *file_name;
if (grub_errno)
goto fail;
/* Get the file part of NAME. */
if (file_name)
file_name++;
else
if (! device)
goto fail;
if (! file)
goto fail;
/* This is a block list. */
else
{
goto fail;
}
{
}
grub_print_progress = 0;
goto fail;
filter++)
{
}
if (!file)
sizeof (grub_file_filters_enabled));
return file;
fail:
if (device)
/* if (net) grub_net_close (net); */
sizeof (grub_file_filters_enabled));
return 0;
}
void
{
return;
if (done)
{
file->enable_progress = 0;
grub_printf("done.\n");
grub_refresh();
return;
}
curtime = grub_get_time_ms();
if (file->progress_last == 0 ||
{
(unsigned long long) file->progress_counter,
(unsigned long long) file->progress_last);
grub_printf("...");
else
{
filesz, 0);
}
grub_refresh();
}
}
{
#ifdef SUPPORT_PROGRESS
#endif
if (!file->is_size_approximate)
{
{
"attempt to read past the end of file");
return -1;
}
/* Prevent an overflow. */
if ((grub_ssize_t) len < 0)
len >>= 1;
if (len == 0)
return 0;
}
#ifdef SUPPORT_PROGRESS
{
#endif
if (res > 0)
#ifdef SUPPORT_PROGRESS
}
else
{
res = 0;
do
{
if (readsz > PROGRESS_BLOCKSIZE)
if (amt_read < 0)
{
break;
}
}
#endif
return res;
}
{
#ifdef SUPPORT_PROGRESS
#endif
return grub_errno;
}
{
{
"attempt to seek outside of the file");
return -1;
}
return old;
}