net: data reception system, fixed bugs in rtl8139
[quarnos.git] / hydra / uapi.h
blob6485f719454dd4f04c1471924e09217db82d4e33
1 /* Quarn OS / Hydra
3 * Universal Application Programming Interface
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef _UAPI_H_
24 #define _UAPI_H_
26 #include "libs/string.h"
27 #include "libs/list.h"
29 namespace hydra {
30 /**
31 * @brief Universal Application Programming Interface
32 * @details This is the layer that separates high level Hydra interface
33 * with low level operating system specific APIs.
35 namespace uapi {
36 class _output {
37 public:
38 void write(const char*);
41 extern _output *output;
43 class _input {
44 public:
45 void read(char *, int);
48 extern _input *input;
50 /**
51 * @brief File operations
52 * @details This class provides implementation of all actions
53 * that can be done on files (including directories). This inteface
54 * is independent from both os and file system.
56 class _file {
57 private:
58 void *data;
59 public:
60 /**
61 * Opens files
62 * @param name file name
64 void open(const char *name);
65 void close();
67 /**
68 * Reads file (unrecommended)
69 * @return All data present in the file
71 const char *readall();
73 /**
74 * Returns list of files present in directory.
76 const list<string> subfiles();
81 #endif