Ignore:
Timestamp:
Mar 31, 2018, 1:27:52 AM (7 years ago)
Author:
bird
Message:

kmk_cp: use getopt_r and stop using global and static variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/cp_extern.h

    r3192 r3221  
    3939} PATH_T;
    4040
    41 #define argv0   cp_argv0
    42 #define to      cp_to
    43 #define fflag   cp_fflag
    44 #define iflag   cp_iflag
    45 #define nflag   cp_nflag
    46 #define pflag   cp_pflag
    47 #define vflag   cp_vflag
    48 #define info    cp_info
    49 #define usage   cp_usage
    50 #define setfile cp_setfile
     41typedef struct CPUTILSINSTANCE {
     42    PKMKBUILTINCTX pCtx;
     43    /*extern*/ PATH_T to;
     44    /*extern*/ int fflag, iflag, nflag, pflag, vflag;
     45} CPUTILSINSTANCE;
    5146
    52 extern const char *argv0;
    53 extern PATH_T to;
    54 extern int fflag, iflag, nflag, pflag, vflag;
     47#if defined(SIGINFO) && defined(KMK_BUILTIN_STANDALONE)
    5548extern volatile sig_atomic_t info;
     49#endif
    5650
    57 int     copy_fifo(PKMKBUILTINCTX pCtx, struct stat *, int);
    58 int     copy_file(PKMKBUILTINCTX pCtx, const FTSENT *, int, int, int *);
    59 int     copy_link(PKMKBUILTINCTX pCtx, const FTSENT *, int);
    60 int     copy_special(PKMKBUILTINCTX pCtx, struct stat *, int);
    61 int     setfile(PKMKBUILTINCTX pCtx, struct stat *, int);
     51int     copy_fifo(CPUTILSINSTANCE *pThis, struct stat *, int);
     52int     copy_file(CPUTILSINSTANCE *pThis, const FTSENT *, int, int, int *);
     53int     copy_link(CPUTILSINSTANCE *pThis, const FTSENT *, int);
     54int     copy_special(CPUTILSINSTANCE *pThis, struct stat *, int);
     55int     copy_file_attribs(CPUTILSINSTANCE *pThis, struct stat *, int);
Note: See TracChangeset for help on using the changeset viewer.