GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
xt_strlupper(3) FreeBSD Library Functions Manual xt_strlupper(3)

xt_redirect() - Redirect stdin, stdout and stderr if corresponding argument isn't NULL xt_strlupper() - Copy string and convert lower case to uppper

#include <xtend/string.h>
-lxtend

size_t  xt_strlupper(char *dest, const char *src, size_t dest_size)

src         Pointer to null-terminated string to be copied
dest        Pointer to a character array to receive the copy
dest_size   Size of the destination array

This function redirects the stdin, stdout, and stderr of the current process to the files named by the corresponding arguments. The original file streams are not preserved. If you need to restore any of these streams to their original state, they must be saved (e.g. using dup(), dup2(), or ttyname()) prior to calling xt_redirect().

Author: Jason W. Bacon ***************************************************************************/

void xt_redirect( char *infile, /* If not NULL, stdin is redirected from this file */ char *outfile, /* If not NULL, stdout is redirected to this file */ char *errfile /* If not NULL, stderr is redirected to this file */ )

{ if (infile != NULL) { close(0); if ( open(infile, O_RDONLY) == -1 ) fprintf(stderr,"xt_redirect(): Cannot open infile: %s.n",infile); } if (outfile != NULL) { close(1); if ( open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0600) == -1 ) fprintf(stderr,"xt_redirect(): Cannot open outfile: %s.n",outfile); } if (errfile != NULL) { close(2); if ( strcmp(errfile,outfile) == 0 ) { if ( dup(1) == -1 ) fprintf(stderr,"xt_redirect(): Cannot open errfile: %s.n",errfile); } else { if ( open(errfile, O_WRONLY | O_CREAT | O_TRUNC, 0600) == -1 ) fprintf(stderr,"xt_redirect(): Cannot open errfile: %s.n",errfile); } } }

xt_strlupper(3) copies a string from src to dest, up to a maximum of dest_size - 1 characters. It behaves exactly like strlcpy(3), except that any lower case characters in the string are converted to upper case.

Size of the src string. If this differs from dest_size, then we knoiw the copy is truncated.

char    src[] = "Some text",
dest    [DEST_SIZE + 1];
if ( xt_strlupper(dest, src, DEST_SIZE + 1) != DEST_SIZE + 1 )

fputs("Warning: String truncated.n", stderr);

xt_strllower(3), strlcpy(3), strlcat(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.