The present paper describes an ANSI C library which has been developed to facilitate the implementation and simulation of P systems on a computer. Simple data structures are proposed which permit the representation of membranes and their associated objects, and facilities are provided for implementing both "active" and "non-active" membrane systems, including actions for dissolving a membrane, dividing an existing membrane and creating a new membrane.