/** * swap.c - A generic definition of the legendary swap function. To * make this work with a particular type, define a TYPE constant * and a PREFIX macro. The TYPE constant gives the type (e.g., int) * and the PREFIX macro adds a prefix (e.g., PREFIX(swap) -> iswap). */ // +--------------------+--------------------------------------------- // | Exported Functions | // +--------------------+ void PREFIX(swap) (TYPE *px, TYPE *py) { TYPE temp; temp = *px; *px = *py; *py = temp; } // PREFIX(swap)