60
EINVAL,EBADF
Description:
Returns a configuration limit for an open file. The
fildes
argument is an open file descriptor.
The possible values for name are:
Name
Description
_PC_LINK_MAX
Maximum value of a file's link count. If
fildes
refers to a directory then this
value applies to the entire directory.
_PC_MAX_CANON
Maximum length of a formatted input line.
fildes
must refer to a terminal.
_PC_MAX_INPUT
Maxi
mum length of an input line.
fildes
must refer to a terminal.
_PC_NAME_MAX
Maximum length of a filename for this directory.
_PC_PATH_MAX
The maximum length of a relative pathname when this directory is the working
directory.
_PC_PIPE_BUF
Size of the pipe b
uffer.
fildes
must refer to a pipe or FIFO.
_PC_CHOWN_RESTRICTED
The
chown()
system call may not be used on this file. If
path
or
fildes
refer to a directory, then this applies to all files in that directory.
P
age 288
Name
Description
_PC_NO_TRUNC
Attempting to create a file in the named directory will fail with
ENAMETOOLONG
if the filename would be truncated.
_PC_VDISABLE
Allow special character processing to be disabled.
fildes
must refer to a
terminal.
Reference:
P 5.7.1.1
Conversions:
This function is new to POSIX. It allows a portable application to determine the quantity of a
resource, or the presence of an option, at execution time.
Older applications either use a fixed amount of a resource or attempt to deduce the amount of
resource available using the error returns from various functions.
VB.NET Imaging - Generate Barcode Image in VB.NET as common image files such as png and jpg. quality PLANET postal barcode images in PDF, Word and VB.NET barcode generator component for adding POSTNET barcode
add photo to pdf file; how to add an image to a pdf in reader C# Word - Insert Image to Word Page in C#.NET VB.NET How-to, VB.NET PDF, VB.NET Word, VB It's a demo code for adding image to word page using C# 0); REImage image = new REImage(@"C:\logo2.jpg"); page.AddImage
add photo to pdf in preview; add image pdf
68
Notes:
The value returned by
_PC_PATH_MAX
is not useful for allocating storage. Files with paths
longer than
_PC_PATH_MAX
may exist.
P
age 289
fprintf()
—Writes formatted text to a stream.
Synopsis:
#include <stdio.h>
inf fprintf(FILE *stream, const char *format, ...);
Arguments:
stream
File to be written.
format
Format string.
...
Additional arguments.
Returns:
Number of characters written. Negative value if an error occurred.
Description:
The
fprintf()
function converts its arguments to a character string and writes that string to
stream.
The format is a character string that contains zero or more directives. Each directive fetches
zero or more arguments to
fprintf
. Each directive starts with the
%
character. After the
%
,
the following appear in sequence:
flags
Zero or more of the following flags (in any order):
-
Will cause this conversion to be left-justified. If the
-
flag is not used, the result
will be right-justified.
+
The result of a signed conversion will always begin with a sign. If the
+
flag i
used, the result will begin with a sign only when negative values are converted.
space
This is the same as
+
except a space is printed instead of a plus sign. If both the
space
and the
+
flags are used, the
+
wins.
#
The result is converted to an a
lternate form. The details are given below for each
conversion.
width
An optional
width
field. The exact meaning depends on the conversion being performed. See
the table on the next page.
119
P
age 290
prec
An optional
precision
. The
precision
indicates how many digits will be printed to the right
of the decimal point. If the precision is present, it is preceded by a decimal point (.). If the
decimal point is given with no precision, the precision is ass
umed to be zero. A precision
argument may be used only with the
e, E, f, g
, and
G
conversions.
type
An optional
h, l,
or
L
. The
h
causes the argument to be converted to
short
prior to
printing. The
l
specifies that the argument is a
long
int
. The
L
specifi
es that the
argument is a
long
double
.
format
A character that specifies the conversion to be performed.
The conversions are given by the following table:
Description
Meaning of
width
Meaning of # flag
i
or
d
An
int
argument is
converted to a signed
decimal string.
Specifies the minimum
number of characters to
appear. If the value is
smaller, padding is used.
The default is
1
.
The result of printing zero
wi
th a width of zero is no
characters.
UNDEFINED
.
o
An
unsigned int
argument is converted to
unsigned octal.
Same as
i
.
Increase the precision to
force the first digit to be a
zero.
u
An
unsigned
int
argument is converted o
unsigned decimal.
Same as
i
.
UNDEF
INED
.
x
An
unsigned
int
argument is converted to
unsigned hexadecimal.
The letters
abcdef
are
used.
Same as
i
.
Prefix non-zero results with
0x
.
X
Same as
x
except the
letters
ABCDEF
are used.
Same as
i
.
Prefix non-zero results with
0X
.
92
P
age 291
Description
Meaning of
width
Meaning of # flag
f
A double argument is
converted to decimal
notation in the
[-]ddd.ddd
format.
Minimum number of
characters to appear. May be
followed by a period and the
number of digits to print after
the decimal point.
If
a decimal point is printed,
at least one digit will appear
to the left of the decimal.
Print a decimal point even
if no digits follow.
e
A double argument is
converted in the style
[-]d.ddd
e
dd.
The exponent will always
contain at least two digits.
If the
value is zero, the
exponent is zero.
Same as
f.
Same as
f.
E
Same as
e
except
E
is
used instead of
e.
Same as
f.
Same as
f.
g
Same as f or
e
, depending
on the value to be
converted. The e style is
used only if the exponent
is less than -4 or greater
than
the precision.
Same as
f.
Same as
f.
G
Same as g except an
E
is
printed instead of
e.
Same as
f.
Same as
f.
c
An
int
argument is
converted to an
unsigned
char
and
the resulting character is
written.
UNDEFINED.
UNDEFINED.
P
age 292
Description
Meaning of
width
Meaning of # flag
59
s
An argument is assumed
to be
char *.
Characters up to (but not
including) a terminating
null are written.
Specifies the maximum
number of characters to be
written.
UNDEFINED.
p
An argument must be a
pointer
to
void
. The
pointer is converted to a
sequence of printable
characters in an
implementation-defined
manner. This is not very
useful for a portable
program.
UNDEFINED.
UNDEFINED.
n
An argument should be a
pointer to an integer
which is
written
with the
nu
mber of characters
written to. Nothing is
written to the output
stream by this directive.
UNDEFINED.
UNDEFINED.
Reference:
C 4.9.7.3
Conversions:
Change
\07
in format to
\a
.
Notes:
See ''Pitfalls'' on Page 42.
P
age 293
fputc()
—Writes a character to a stream.
Synopsis:
#include <stdio.h>
int fputc(int c, FILE *stream);
Arguments:
c
Character to write.
45
stream
Pointer to file to write into.
Returns:
The character written or
EOF
on error.
Description:
Write the character
c
(converted to
unsigned
char
) to stream and update the file position.
If
stream
was opened in append mode, the character is appended to the file.
Reference:
C 4.9.7.3 & P 8.2.3.6
Notes:
P
age 294
fputs()
—Writes a string to a stream.
Synopsis:
#include <stdio.h>
int fputs(const char *s, FILE *stream);
Arguments:
s
String to write.
stream
Pointer to file to write.
Returns:
EOF
on error or a non-negative value.
Description:
The character string pointed to by
s
is written to
stream
. The terminating null is not written.
Reference:
C 4.9.7.4 & P 8.2.3.6
Notes:
P
age 295
56
fread()
—Reads an array from a stream.
Synopsis:
#include <stdio.h>
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
Arguments:
ptr
Pointer to array to read into.
size
Size of one array member.
nmemb
Number of array members to read.
stream
Pointer to file to read from.
Returns:
Number of elements read or
EOF
on error.
Description:
Reads in the array pointed to by
ptr
, up to
nmemb
elements whose size is specified by
size
,
from
stream
. The file position of the stream is advanced by the number of characters read. If
an error occurs, the file position is indeterminate. If a partial elem
ent is read, its value is
indeterminate.
Reference:
C 4.9.8.1 & P 8.2.3.5
Conversions:
BSD and SVR1-2 use int for
size
and
nmemb
.
Notes:
If
size
or
nmemb
is zero,
fread()
returns zero without reading anything.
P
age 296
free()
—Deallocates dynamic memory.
Synopsis:
#include <stdlib.h>
void free(void *ptr);
Arguments:
58
ptr
Pointer returned by a previous call to
calloc
(),
malloc
(),
realloc
().
Returns:
No value is returned.
Description:
The
free()
function causes the space pointed to by
ptr
to be made available for allocation.
If
ptr
is
NULL
, nothing happens.
Reference:
C 4.10.3.2
Conversions:
Add to the list of headers:
#include <stdlib.h>
Notes:
If
ptr
is not a value returned by
calloc()
,
malloc()
,
realloc()
, or if multiple
attempts are made to free the same block, the program is not portable.
P
age 297
freopen()
—Closes and then opens a stream.
Synopsis:
#include <stdio.h>
FILE *freopen(const char *filename, const char *mode, FILE *stream);
Arguments:
filename
Pointer to path of the file to open.
mode
Pointer to file mode string.
stream
Pointer to stream to use.
Returns:
stream
, unless the operation failed. In that case,
NULL
is returned.
Description:
The call:
Documents you may be interested
Documents you may be interested