/*************************************************************************** * * * TSHXXX.C (PSEUDO-CODE -- DO NOT COMPILE) * * * * Copyright (C) 1994 GALACTICOMM, Inc. All Rights Reserved. * * * * Use this pseudo-code as a template to write your own tagspec handler * * routine for file downloading. This way you're reminded of what's * * possible and expected at each exit point, and roughly how to code * * it. Refer to the Developer's Guide. * * * * - R. Stein 12/30/93 * * * ***************************************************************************/ int tshxxx( /* Handle the application-specific */ int tshcod) /* aspects of your downloads */ { /* (tshcod=code for each aspect) */ int rc=0; setmbk(whatever your application uses); (be sure to set any other appropriate globals) switch(tshcod) { case TSHDSC: /* Describe the file(s) in English */ sprintf(tshmsg,"app-specific description of file",ftgptr->tagspc); break; case TSHVIS: /* Visible to this user? */ if (file exists, or user is allowed to know it doesn't) { open & read first TSHLEN bytes into tshmsg, as in: if ((fp=fopen("",FOPRB)) != NULL) { fread(tshmsg,1,TSHLEN,fp); rc=1; } } break; case TSHSCN: /* Break down multiple filespec */ if (there's at least one file in this multi-file tagspec) { store tagspec for the individual file in tshmsg rc=1; } break; case TSHNXT: /* Next file in multi-file spec */ if (there are more subfiles) { store tagspec for the individual file in tshmsg rc=1; } break; case TSHBEG: /* Begin downloading this file */ if (file can't be downloaded by this user) { sprintf(tshmsg,"You can't download the file because..."); } else { reserve it sprintf(tshmsg,"",ftgptr->tagspc); strcpy(ftfscb->fname,""); rc=1; } break; case TSHEND: /* File download was successful */ unreserve it record a completed download break; case TSHSKP: /* This file download aborted */ unreserve it record an aborted download break; case TSHFIN: /* End of downloading session */ usrptr->state=your state usrptr->substt=your substate prompt (you don't need to call outprf here) rc=1; break; case TSHHUP: /* Channel hanging up */ the TSHFIN exit point never got called, clean up as req'd break; } return(rc); }