Applied slightly reworked and updated patch from ticket #1576

by "jarz" to rewrite the last remaining (?) headers in order
to get rid of the Be copyright. Thanks a lot and sorry for the
long delay.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42958 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2011-10-29 15:38:20 +00:00
parent f1d67b39de
commit 7749d0bb0c
4 changed files with 483 additions and 694 deletions
+16 -32
View File
@@ -1,51 +1,35 @@
/******************************************************************************* /*
/ * Copyright 2011, Haiku Inc. All Rights Reserved.
/ File: NetPositive.h * Distributed under the terms of the MIT License.
/ */
/ Description: Defines all public APIs for communicating with NetPositive
/
/ Copyright 1998-1999, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#ifndef _NETPOSITIVE_H #ifndef _NETPOSITIVE_H
#define _NETPOSITIVE_H #define _NETPOSITIVE_H
/*----------------------------------------------------------------*/
/*----- message command constants -------------------------------*/
// Message command constants
// These are not supported by WebPositive at this time and only exists for
// compile time backwards compatibility.
enum { enum {
/* Can be sent to the NetPositive application, a window, or a replicant */ // This message could be sent to the NetPositive application, a window, or a
/* view. Put the URL in a String field named be:url */ // replicant view. The receiver expected the URL in a "be:url" string field.
B_NETPOSITIVE_OPEN_URL = 'NPOP', B_NETPOSITIVE_OPEN_URL = 'NPOP',
/* Can be sent to a window or replicant view */ // These commands could be sent to a window or replicant view.
B_NETPOSITIVE_BACK = 'NPBK', B_NETPOSITIVE_BACK = 'NPBK',
B_NETPOSITIVE_FORWARD = 'NPFW', B_NETPOSITIVE_FORWARD = 'NPFW',
B_NETPOSITIVE_HOME = 'NPHM', B_NETPOSITIVE_HOME = 'NPHM',
B_NETPOSITIVE_RELOAD = 'NPRL', B_NETPOSITIVE_RELOAD = 'NPRL',
B_NETPOSITIVE_STOP = 'NPST', B_NETPOSITIVE_STOP = 'NPST',
B_NETPOSITIVE_DOWN = 'NPDN', B_NETPOSITIVE_DOWN = 'NPDN',
B_NETPOSITIVE_UP = 'NPUP' B_NETPOSITIVE_UP = 'NPUP'
}; };
/*----------------------------------------------------------------*/
/*----- NetPositive-related MIME types --------------------------*/
/* The MIME types for the NetPositive application and its bookmark files */
// NetPositive related MIME types
// The first one is useless on Haiku, unless NetPositive was manually installed,
// the second one is still used for URL files saved by WebPositive.
#define B_NETPOSITIVE_APP_SIGNATURE "application/x-vnd.Be-NPOS" #define B_NETPOSITIVE_APP_SIGNATURE "application/x-vnd.Be-NPOS"
#define B_NETPOSITIVE_BOOKMARK_SIGNATURE "application/x-vnd.Be-bookmark" #define B_NETPOSITIVE_BOOKMARK_SIGNATURE "application/x-vnd.Be-bookmark"
/* To set up your application to receive notification when the user */
/* clicks on a specific type of URL (telnet URL's, for example), see the */
/* details in TypeConstants.h. NetPositive will use external handlers */
/* for all URL types except for http, https, file, netpositive, and */
/* javascript, which it always handles internally. To maintain */
/* compatibility with its previous behavior, if NetPositive does not */
/* find a handler for mailto URL's, it will instead launch the handler */
/* for "text/x-email". */
/*----------------------------------------------------------------*/ #endif // _NETPOSITIVE_H
/*----------------------------------------------------------------*/
#endif /* _NETPOSITIVE_H */
+48 -47
View File
@@ -1,84 +1,85 @@
/******************************************************************************* /*
/ * Copyright 2010-2011, Haiku Inc. All Rights Reserved.
/ File: ISA.h * Distributed under the terms of the MIT License.
/ */
/ Description: Interface to ISA module
/
/ Copyright 1998, Be Incorporated, All Rights Reserved.
/
*******************************************************************************/
#ifndef _ISA_H #ifndef _ISA_H
#define _ISA_H #define _ISA_H
//#include <SupportDefs.h>
#include <SupportDefs.h>
#include <bus_manager.h> #include <bus_manager.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* ---
ISA scatter/gather dma support.
--- */
typedef struct { typedef struct isa_dma_entry {
ulong address; /* memory address (little endian!) 4 bytes */ uint32 address;
ushort transfer_count; /* # transfers minus one (little endian!) 2 bytes*/ uint16 transfer_count;
uchar reserved; /* filler, 1byte*/ uchar reserved;
uchar flag; /* end of link flag, 1byte */ uchar flag;
} isa_dma_entry; } isa_dma_entry;
#define B_LAST_ISA_DMA_ENTRY 0x80 /* sets end of link flag in isa_dma_entry */
#define B_LAST_ISA_DMA_ENTRY 0x80
enum { enum {
B_8_BIT_TRANSFER, B_8_BIT_TRANSFER,
B_16_BIT_TRANSFER B_16_BIT_TRANSFER
}; };
#define B_MAX_ISA_DMA_COUNT 0x10000 #define B_MAX_ISA_DMA_COUNT 0x10000
typedef struct isa_module_info isa_module_info; typedef struct isa_module_info isa_module_info;
struct isa_module_info { struct isa_module_info {
bus_manager_info binfo; bus_manager_info binfo;
uint8 (*read_io_8) (int mapped_io_addr); uint8 (*read_io_8) (int32 mapped_io_addr);
void (*write_io_8) (int mapped_io_addr, uint8 value); void (*write_io_8) (int32 mapped_io_addr, uint8 value);
uint16 (*read_io_16) (int mapped_io_addr); uint16 (*read_io_16) (int32 mapped_io_addr);
void (*write_io_16) (int mapped_io_addr, uint16 value); void (*write_io_16) (int32 mapped_io_addr, uint16 value);
uint32 (*read_io_32) (int mapped_io_addr); uint32 (*read_io_32) (int32 mapped_io_addr);
void (*write_io_32) (int mapped_io_addr, uint32 value); void (*write_io_32) (int32 mapped_io_addr, uint32 value);
void * (*ram_address) (const void *physical_address_in_system_memory); void* (*ram_address)
(const void * physical_address_in_system_memory);
long (*make_isa_dma_table) ( int32 (*make_isa_dma_table) (
const void *buffer, /* buffer to make a table for */ const void *buffer,
long buffer_size, /* buffer size */ int32 buffer_size,
ulong num_bits, /* dma transfer size that will be used */ uint32 num_bits,
isa_dma_entry *table, /* -> caller-supplied scatter/gather table */ isa_dma_entry *table,
long num_entries /* max # entries in table */ int32 num_entries
); );
long (*start_isa_dma) ( int32 (*start_isa_dma) (
long channel, /* dma channel to use */ int32 channel,
void *buf, /* buffer to transfer */ void *buf,
long transfer_count, /* # transfers */ int32 transfer_count,
uchar mode, /* mode flags */ uchar mode,
uchar e_mode /* extended mode flags */ uchar e_mode
); );
long (*start_scattered_isa_dma) ( int32 (*start_scattered_isa_dma) (
long channel, /* channel # to use */ int32 channel,
const isa_dma_entry *table, /* physical address of scatter/gather table */ const isa_dma_entry* table,
uchar mode, /* mode flags */ uchar mode,
uchar emode /* extended mode flags */ uchar emode
); );
long (*lock_isa_dma_channel) (long channel); int32 (*lock_isa_dma_channel) (int32 channel);
long (*unlock_isa_dma_channel) (long channel); int32 (*unlock_isa_dma_channel) (int32 channel);
}; };
#define B_ISA_MODULE_NAME "bus_managers/isa/v1" #define B_ISA_MODULE_NAME "bus_managers/isa/v1"
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _ISA_H */ #endif /* _ISA_H */
+392 -538
View File
File diff suppressed because it is too large Load Diff
+27 -77
View File
@@ -1,97 +1,47 @@
/******************************************************************************* /*
/ * Copyright 2010, Haiku Inc. All Rights Reserved.
/ File: atomizer.h * Distributed under the terms of the MIT License.
/ */
/ Description: Kernel atomizer module API #ifndef _ATOMIZER_H
/ #define _ATOMIZER_H
/ Copyright 1999, Be Incorporated, All Rights Reserved.
/
*******************************************************************************/
#ifndef _ATOMIZER_MODULE_H_
#define _ATOMIZER_MODULE_H_
#include <SupportDefs.h>
#include <module.h> #include <module.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*
An atomizer is a software device that returns a unique token for a
null-terminated UTF8 string.
Each atomizer comprises a separate token space. The same string interned #define B_ATOMIZER_MODULE_NAME "generic/atomizer/v1"
in two different atomizers will generate two distinct tokens. #define B_SYSTEM_ATOMIZER_NAME "Haiku System Atomizer"
Atomizers and the tokens they generate are only guaranteed valid between
matched calls to get_module/put_module.
void * find_or_make_atomizer(const char *string)
Returns a token that identifies the named atomizer, creating a new
atomizer if the named atomizer does not exist. Pass null, a zero
length string, or the value B_SYSTEM_ATOMIZER_NAME for string will
return a pointer to the system atomizer. Returns (void *)(0)
if the atomizer could not be created (for whatever reason). A return
value of (void *)(-1) refers to the system atomizer.
status_t delete_atomizer(void *atomizer) typedef struct atomizer_info {
Delete the atomizer specified. Returns B_OK if successfull, B_ERROR void* atomizer;
otherwise. An error return usually means that a race condition was char name[B_OS_NAME_LENGTH];
detected while destroying the atomizer. uint32 atom_count;
void * atomize(void *atomizer, const char *string, int create)
Return the unique token for the specified string, creating a new token
if the string was not previously atomized and create is non-zero. If
atomizer is (void *)(-1), use the system atomizer (saving the step of
looking it up with find_or_make_atomizer(). Returns (const char *)(0)
if there were any errors detected: insufficient memory or a race
condition with someone deleting the atomizer.
const char * string_for_token(void *atomizer, void *atom)
Return a pointer to the string described by atom in the provided atomizer.
Returns (const char *)(0) if either the atomizer or the atom were invalid.
status_t get_next_atomizer_info(void **cookie, atomizer_info *info)
Returns info about the next atomizer in the list of atomizers by modifying
the contents of info. The pointer specified by *cookie should be set to
(void *)(0) to retrieve the first atomizer, and should not be modified
thereafter. Returns B_ERROR when there are no more atomizers.
Adding or deleting atomizers between calls to get_next_atomizer() results
in a safe but undefined behavior.
void * get_next_atom(void *atomizer, uint32 *cookie)
Returns the next atom interned in specified atomizer, *cookie
should be set to (uint32)(0) to get the first atom. Returns
(void *)(0) when there are no more atoms. Adding atoms between
calls to get_next_atom() may cause atoms to be skipped.
Atomizers are SMP-safe. Check return codes for errors!
*/
#define B_ATOMIZER_MODULE_NAME "generic/atomizer/v1"
#define B_SYSTEM_ATOMIZER_NAME "BeOS System Atomizer"
typedef struct {
void *atomizer; /* An opaque token representing the atomizer. */
char name[B_OS_NAME_LENGTH]; /* The first B_OS_NAME_LENGTH bytes of the atomizer name, null terminated. */
uint32 atom_count; /* The number of atoms currently interned in this atomizer. */
} atomizer_info; } atomizer_info;
typedef struct {
typedef struct atomizer_module_info {
module_info minfo; module_info minfo;
const void * (*find_or_make_atomizer)(const char *string); const void* (*find_or_make_atomizer)(const char* string);
status_t (*delete_atomizer)(const void *atomizer); status_t (*delete_atomizer)(const void* atomizer);
const void * (*atomize)(const void *atomizer, const char *string, int create); const void* (*atomize)
const char * (*string_for_token)(const void * atomizer, const void *atom); (const void* atomizer, const char* string, int create);
status_t (*get_next_atomizer_info)(void **cookie, atomizer_info *info); const char* (*string_for_token)
const void * (*get_next_atom)(const void *atomizer, uint32 *cookie); (const void* atomizer, const void* atom);
status_t (*get_next_atomizer_info)
(void** cookie, atomizer_info* info);
const void* (*get_next_atom)(const void* atomizer, uint32* cookie);
} atomizer_module_info; } atomizer_module_info;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
#endif /* _ATOMIZER_H */