X-Git-Url: https://wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fio.h;fp=src%2Fio.h;h=b06709f3d65d15ca773681531076c663b852c6b6;hb=6b077ee78bd064474b576e076383503e682a1dd2;hp=0000000000000000000000000000000000000000;hpb=73d3e7f2451b8e30d39185529fd69bf2765a6d8f;p=ppastats.git diff --git a/src/io.h b/src/io.h new file mode 100644 index 0000000..b06709f --- /dev/null +++ b/src/io.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 jeanfi@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef _PPASTATS_IO_H_ +#define _PPASTATS_IO_H_ + +/* + * Convenience functions for copying files. + */ + + +enum file_copy_code { + FILE_COPY_OK = 0, + FILE_COPY_ERROR_OPEN_SRC = 1, + FILE_COPY_ERROR_OPEN_DST, + FILE_COPY_ERROR_READ, + FILE_COPY_ERROR_WRITE, + FILE_COPY_ERROR_ALLOC_BUFFER +}; + +/* + * Copies file 'src' to 'dst'. + * + * Returns FILE_COPY_OK on success otherwise error code. + */ +int fcopy(const char *src, const char *dst); + +#endif