KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Typedefs | Functions
nmmgr.h File Reference

Name manager. More...

#include <sys/cdefs.h>
#include <arch/types.h>
#include <kos/limits.h>
#include <sys/queue.h>

Go to the source code of this file.

Data Structures

struct  nmmgr_handler
 Name handler interface. More...
 

Macros

#define NMMGR_LIST_INIT   { NULL }
 List entry initializer for static structs. More...
 
#define NMMGR_FLAGS_NEEDSFREE   0x00000001
 This structure must be freed when removed. More...
 
#define NMMGR_TYPE_UNKNOWN   0x0000 /* ? */
 Unknown nmmgr type. More...
 
#define NMMGR_TYPE_VFS   0x0010 /* Mounted file system */
 A mounted filesystem. More...
 
#define NMMGR_TYPE_BLOCKDEV   0x0020 /* Block device */
 A block device. More...
 
#define NMMGR_TYPE_SINGLETON   0x0030 /* Singleton service (e.g., /dev/irq) */
 A singleton service (e.g., /dev/irq) More...
 
#define NMMGR_TYPE_SYMTAB   0x0040 /* Symbol table */
 A symbol table. More...
 
#define NMMGR_SYS_MAX   0x10000 /* Here and above are user types */
 Everything this and above is a user type. More...
 

Typedefs

typedef struct nmmgr_handler nmmgr_handler_t
 Name handler interface. More...
 

Functions

typedef LIST_HEAD (nmmgr_list, nmmgr_handler) nmmgr_list_t
 Name handler list type. More...
 
nmmgr_handler_tnmmgr_lookup (const char *name)
 Retrieve a name handler by name. More...
 
nmmgr_list_t * nmmgr_get_list ()
 Get the head element of the name list. More...
 
int nmmgr_handler_add (nmmgr_handler_t *hnd)
 Add a name handler. More...
 
int nmmgr_handler_remove (nmmgr_handler_t *hnd)
 Remove a name handler. More...
 

Detailed Description

Name manager.

This file contains the definitions of KOS' name manager. A "name" is a generic identifier for some kind of module. These modules may include services provided by the kernel (such as VFS handlers).

Author
Dan Potter

Macro Definition Documentation

#define NMMGR_FLAGS_NEEDSFREE   0x00000001

This structure must be freed when removed.

#define NMMGR_LIST_INIT   { NULL }

List entry initializer for static structs.

If you are creating nmmgr handlers, this is what you should initialize the list_ent member with.

Typedef Documentation

Name handler interface.

Every name handler must begin its information structures with this header. If the handler conforms to some well-defined interface (such as a VFS), then the struct must more specifically be of that type.

Function Documentation

typedef LIST_HEAD ( nmmgr_list  ,
nmmgr_handler   
)

Name handler list type.

Contrary to what doxygen may think, this is not a function.

nmmgr_list_t* nmmgr_get_list ( )

Get the head element of the name list.

DO NOT MODIFY THE VALUE RETURNED BY THIS FUNCTION! In fact, don't ever call this function.

Returns
The head of the name handler list
int nmmgr_handler_add ( nmmgr_handler_t hnd)

Add a name handler.

This function adds a new name handler to the list in the kernel.

Parameters
hndThe handler to add
Return values
0On success
int nmmgr_handler_remove ( nmmgr_handler_t hnd)

Remove a name handler.

This function removes a name handler from the list in the kernel.

Parameters
hndThe handler to remove
Return values
0On success
-1If the handler wasn't found
nmmgr_handler_t* nmmgr_lookup ( const char *  name)

Retrieve a name handler by name.

This function will retrieve a name handler by its pathname.

Parameters
nameThe handler to look up
Returns
The handler, or NULL on failure.