# Organization

Netscape Plug-ins communicate with Navigator via an Application Programming Interface (API). Two types of functions make up the Plug-in API: plug-in methods and Netscape methods. Plug-in methods are functions that you implement in your plug-in and are called by Netscape; Netscape methods are functions implemented by Netscape that your plug-in may call. For clarity, the names of all plug-in functions begin with "NPP_", while all Netscape functions begin with "NPN_".

In general, all API functions operate identically on all platforms. However, there are several functions, notably `NPP_HandleEvent` and `NPN_MemFlush`, whose operation is platform-specific. All platform-specific differences are described in the documentation for the individual functions.

Unless otherwise stated, ownership for all API function parameters remains with the caller and values are valid only for the duration of each call. For example, if Netscape passes your plug-in a string, your plug-in should make its own copy of the string if you need to reference the string after returning from that function. If you pass Netscape a string or buffer, you are responsible for freeing the memory allocated for the data; Netscape will make its own private copy of the data if necessary.

Declarations for all API functions as well as definitions of all types and structures used in the API functions are found in the file `npapi.h`. Since most functions return an error value of type `NPError`, definitions for error code values are included in `npapi.h` as well.

The plug-in API is organized by type of method. Within each section, the functions are listed alphabetically.