TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: andrew clarke
from: Paul Edwards
date: 1995-02-14 22:28:50
subject: gensmsg.c

/*********************************************************************/
/*                                                                   */
/*  This Program Written by Paul Edwards, 3:711/934{at}fidonet.         */
/*  Released to the Public Domain                                    */
/*                                                                   */
/*********************************************************************/
/*********************************************************************/
/*                                                                   */
/*  gensmsg - generate a squish message                              */
/*                                                                   */
/*********************************************************************/

#include 
#include 
#include 
#include 
#include 

#include "makesmsg.h"
#include "strinl.h"
#include "faddr.h"
#include "error.h"
#include "exists.h"
#include "striupr.h"

#define SQPREFIX "e:\\max\\msg\\"
#define EDITOR "e"
#define MYADDR "3:711/934.9"

#define GENSMSG_SUCCESS "GEN001 Message sent successfully\n"
#define GENSMSG_INVALID_AREA "GEN002 Invalid area %s\n"

int main(void)
{
    char from[72] = "Paul Edwards";
    char to[72];
    char subject[72];
    char areaName[72];
    char fnm[FILENAME_MAX];
    char fnm2[FILENAME_MAX];
    char fnm3[FILENAME_MAX];
    char toaddr[50] = "0:0/0";
    int  ret = EXIT_FAILURE;
    int  fin;
#if 0    
    char answer[50];
#endif    
    
    errorDefaults();
    errorInit();
    if (ALLOK)
    {
        printf("what is the area\n");
        gets(areaName);
        striupr(areaName);
        strcpy(fnm2, areaName);
        sprintf(fnm, SQPREFIX "%s", fnm2);
        sprintf(fnm3, "%s.SQD", fnm);
        if (!exists(fnm3))
        {
            errorSet(GENSMSG_INVALID_AREA, fnm2);
        }
        if (ALLOK)
        {
            fin = 0;
            while (!fin)
            {
                if (strcmp(areaName, "NETMAIL") == 0)
                {
                    printf("What is the destination address?\n");
                    gets(toaddr);
                }
                printf("Who is the message to?\n");
                gets(to);
                printf("What is the subject?\n");
                gets(subject);
                system(EDITOR " gensmsg.txt");
                printf("\n");
                makesmsg(from, to, subject,
                         fnm, areaName, 
                         "gensmsg.txt", MYADDR, toaddr);
                fin = 1;
#if 0                
                if (ALLOK)
                {
                    printf("Want another message in %s?\n", areaName);
                    gets(answer);
                    if (toupper(*answer) == 'Y') 
                    {
                        fin = 0;
                    }
                }
#endif                
            }
        }
        if (ALLOK)
        {
            errorSet(GENSMSG_SUCCESS);
            ret = EXIT_SUCCESS;
        }
    }
    errorTerm();             
    return (ret);
}

@EOT:

--- Mksmsg
* Origin: none (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.