home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 266.lha / SetKey_v2.0 / src / get_name.c < prev    next >
C/C++ Source or Header  |  1989-07-10  |  893b  |  43 lines

  1. #include <stdio.h>
  2. #include <exec/types.h>
  3. #include <exec/io.h>
  4. #include <exec/memory.h>
  5.  
  6. #include <graphics/gfxbase.h>
  7. #include <graphics/text.h>
  8. #include <graphics/gfxmacros.h>
  9. #include <devices/console.h>
  10. #include <devices/keymap.h>
  11. #include <libraries/dos.h>
  12. #include <libraries/dosextens.h>
  13. #include <intuition/intuition.h>
  14. #include <functions.h>
  15.  
  16. extern UBYTE filestring[];
  17. extern UBYTE dirstring[];
  18. extern UBYTE the_name[];
  19. extern char *get_fname();
  20.  
  21. char *get_name(w)
  22. struct Window *w;
  23. {
  24.  
  25. SHORT quit_sig;
  26. char *go_code;
  27.  
  28.     go_code = get_fname(w,NULL,"Select a File",filestring,dirstring);
  29.  
  30.     if(go_code) {
  31.     strcpy(the_name, dirstring);
  32.     if(strlen(the_name)) {
  33.         if((!(the_name[strlen(the_name)-1] == '/'))
  34.             && (!(the_name[strlen(the_name)-1] == ':')))
  35.                 strcat(the_name,"/");
  36.         }
  37.     strcat(the_name, filestring);
  38.     }
  39.  
  40.     return go_code;
  41. }
  42.  
  43.