Functions in the mysys Library MySQL

Functions in mysys: (For flags see my_sys.h)

  • int my_copy _A((const char *from, const char *to, myf MyFlags));
  • Copy file from from to to.
  • int my_rename _A((const char *from, const char *to, myf MyFlags));
  • Rename file from from to to.
  • int my_delete _A((const char *name, myf MyFlags));
  • Delete file name.
  • int my_redel _A((const char *from, const char *to, int MyFlags));
  • Delete from before rename of to to from. Copies state from old file to new file. If MY_COPY_TIME is set, sets old time.
  • int my_getwd _A((string buf, uint size, myf MyFlags)); , int my_setwd_A((const char *dir, myf MyFlags));
  • Get and set working directory.
  • string my_tempnam _A((const char *dir,const char*pfx,myf My- Flags));
  • Make a unique temporary file name by using dir and adding something after pfx to make the name unique. The file name is made by adding a unique six character string and TMP_EXT after pfx. Returns pointer to malloc()'ed area for filename. Should be freed by free().
  • File my_open_A((const char*FileName,int Flags,myf MyFlags));,File
  • my_create_A((const char *FileName, int CreateFlags,int Accses-Flags,myf MyFlags)); , int my_close_A((File Filedes,myf MyFlags));,uint my_read_A((File Filedes,byte *Buffer,uint Count,myf My- Flags));,uint my_write_A((File Filedes,const byte *Buffer, uint Count,myf MyFlags));,ulong my_seek_A((File fd,ulong pos,int whence,myf MyFlags)); ,ulong my_tell_A((File fd,myf MyFlags));Use instead of open, open-with-create-flag, close,read,and write to get automatic error messages(flag MYF_WME)and only have to test for != 0 if error(flag MY_NABP).
  • FILE *my_fopen_A((const char *FileName,int Flags,myf MyFlags)); ,
  • FILE *my_fdopen_A((File Filedes,int Flags,myf MyFlags));,int my_fclose_A((FILE *fd,myf MyFlags));,uint my_fread _A((FILE*stream,byte*Buffer,uint Count,myf MyFlags)); , uint my_fwrite_A((FILE*stream,const byte *Buffer,uint Count,myf MyFlags));,ulong my_fseek_A((FILE *stream,ulong pos, int whence,myf MyFlags));, ulong my_ftell_A((FILE *stream,myf MyFlags));Same read-interface for streams as for files.
  • gptr _mymalloc _A((uint uSize,const char *sFile,uint uLine, myf My-Flag));,
    gptr_myrealloc_A((string pPtr,uint uSize,const char*sFile,uint uLine, myf My Flag));,
    void_myfree _A((gptr pPtr,const char*sFile,uint uLine));,
    int_sanity_A((const char *sFile,unsigned int uLine));,
    gptr_myget_copy_of_memory_A((const byte *from,uint length,const char *sFile,uint uLine,myf MyFlag));
    malloc(size,myflag)is mapped to these functions if not compiled with -DSAFEMALLOC.
  • void TERMINATE _A((void));
  • Writes malloc() info on stdout if compiled with -DSAFEMALLOC.
  • int my_chsize_A((File fd,ulong newlength,myf MyFlags));
  • Change size of file fd to newlength.
  • void my_error_D((int nr, myf MyFlags, ...));
  • Writes message using error number (see mysys/errors.h) on stdout, or using curses, ifMYSYS_PROGRAM_USES_CURSES() has been called.
  • void my_message _A((const char *str, myf MyFlags));
  • Writes str on stdout, or using curses,if MYSYS_PROGRAM_USES_CURSES() has been called.
  • void my_init _A((void ));
  • Start each program (in main()) with this.
  • void my_end _A((int infoflag));
  • Gives info about program. If infoflag & MY_CHECK_ERROR, prints if some files are left open. If infoflag & MY_GIVE_INFO, prints timing info and malloc() info about program.
  • int my_copystat _A((const char *from, const char *to, int My-Flags));
  • Copy state from old file to new file. If MY_COPY_TIME is set, sets old time.
  • string my_filename _A((File fd));
  • Returns filename of open file.
  • int dirname _A((string to, const char *name));
  • Copy name of directory from filename.
  • int test_if_hard_path _A((const char *dir_name));
  • Test if dir_name is a hard path (starts from root).
  • void convert_dirname _A((string name));
  • Convert dirname according to system. On Windows, changes all characters to capitals and changes
    '/' to '\'.
  • string fn_ext _A((const char *name));
  • Returns pointer to extension in filename.
  • string fn_format _A((string to,const char *name,const char *dsk,const char *form,int flag));
  • Format a filename with replacement of library and extension and convert between different systems. The to and name parameters may be identical. Function doesn't change name if name != to. flag may be:All open requests should always use at least open(fn_format(temp_buffer, name, "","", 4), ...) to unpack home and convert filename to system-form.
  • string fn_same _A((string toname, const char *name, int flag));
  • Copies directory and extension from name to toname if needed. Copying can be forced by same flags used in fn_format().
  • int wild_compare _A((const char *str, const char *wildstr));
  • Compare if str matches wildstr. wildstr can contain '*' and '?' as wildcard characters. Returns 0 if str and wildstr match.
  • void get_date _A((string to, int timeflag));
  • Get current date in a form ready for printing.
  • void soundex _A((string out_pntr, string in_pntr))
  • Makes in_pntr to a 5 char long string. All words that sound alike have the same string.
  • int init_key_cache _A((ulong use_mem, ulong leave_this_much_mem));
  • Use caching of keys in MISAM, PISAM, and ISAM. KEY_CACHE_SIZE is a good size. Remember to lock databases for optimal caching.
  • void end_key_cache _A((void));

End key caching.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

MySQL Topics