www.delorie.com/djgpp/doc/libc/libc_626.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_put_path

Syntax

 
#include <libc/dosio.h>

int _put_path(const char *path);
int _put_path2(const char *path, int offset);

Description

These functions are used internally by all low-level library functions that need to pass file names to DOS. _put_path copies its argument path to the transfer buffer (see section _go32_info_block) starting at the beginning of the transfer buffer; _put_path2 does the same except that it puts the file name starting at offset bytes from the beginning of the transfer buffer.

These functions are meant to be called by low-level library functions, not by applications. You should only call them if you know what you are doing. In particular, if you call any library function between a call to _put_path or _put_path2 and the call to a DOS function that uses the file name, the file name in the transfer buffer could be wiped out, corrupted or otherwise changed. You have been warned!

Some constructs in file names are transformed while copying them, to allow transparent support for nifty features. Here's the list of these transformations:

Return Value

Both functions return the offset into the transfer buffer of the terminating null character that ends the file name.

ANSI/ISO C No
POSIX No

Example

These functions are meant to be called by low-level library functions, not by applications. You should only call them if you know what you are doing. In particular, if you call any library function between a call to _put_path or _put_path2 and the call to a DOS function that uses the file name, the file name in the transfer buffer could be wiped out, corrupted and otherwise changed. You have been warned!

 
 __dpmi_regs r;

 _put_path("/dev/c/djgpp/bin/");
 r.x.ax = 0x4300;  /* get file attributes */
 r.x.ds = __tb >> 4;
 r.x.dx = __tb & 0x0f;
 __dpmi_int(0x21, &r);


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004