Post-Prefixed Acronym (P-PA) Generation Algorithm

//
//  ppa_gen()
//
//  this comment intentionally left blank
//
static int letter (const char c)
{
    return (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')));
}
void ppa_gen (const char* name, char* ppa)
{
    //  Post-Prefix Acronym (P-PA)

    *ppa++ = '(';
    *ppa++ = name [0];

    int in_word = 0;		//	our "state machine"

    while (*name)
    {
        //  cheerful waving of the hands...

	if (!letter (*name))
        {
            in_word = 0;
	    if (*name != ' ')
		*ppa++ = *name;
	}
	else
 	{
	    in_word = 1;
	    if (!in_word)
		*ppa++ = *name;
    	}
        name++;
    }
    *ppa++ = ')';
    *ppa++ = 0;
}

#if 1   //  yer obligatory test harness
#include "stdio.h"
void main()
{
    static char name [1024];
    static char ppa  [1024];
   
    strcpy (name, "Post-Prefixed Acronym");
    ppa_gen (input, ppa) 
    printf ("Name: %s\nP-PA%s\n, input, ppa);

    strcpy (name, "Ambulatory Robot Team");
    ppa_gen (input, ppa) 
    printf ("Name: %s\nP-PA%s\n, input, ppa);

    strcpy (name, "Automatic Beating Machine for the Robot Galley Slaves in the Pimento Stuffing Division");
    ppa_gen (input, ppa) 
    printf ("Name: %s\nP-PA%s\n, input, ppa);

    strcpy (name, "Human Intervention Request Communique");
    ppa_gen (input, ppa) 
    printf ("Name: %s\nP-PA%s\n, input, ppa);
}
#endif