opennet man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

OPENNET(3)							    OPENNET(3)

NAME
       opennet - URL handling library.

SYNOPSIS
       #include <opennet.h>

       int open_net(const char *pathname, int flags, mode_t mode);
       off_t lseek_net(int filedes, off_t offset, int whence);
       ssize_t read_net(int fd, void *buf, size_t count);
       NETFILE *fopen_net(const char *path, const char *mode);
       int fseek_net(NETFILE *stream, long offset, int whence);
       int fgets_net(char *s, int size, NETFILE *stream);
       int fread_net(void *ptr, size_t size, size_t nmemb, NETFILE *stream);

DESCRIPTION
       Opennet	is  a  library to provide an easy mechanism to open and handle
       URLs in the same way you would open and handle a regular file.

EXAMPLE
       #include <opennet.h>
       #include <stdlib.h>
       #include <unistd.h>
       #include <stdio.h>

       int main(int argc, char **argv) {
	    NETFILE *fp = NULL;
	    char *filename = NULL, *fg_ret = NULL;
	    char buf[512] = {0};

	    filename = "http://www.rkeene.org/robots.txt";

	    fp = fopen_net(filename, "r");

	    if (fp == NULL) {
		 fprintf(stder, "fopen: Error0);
		 return(EXIT_FAILURE);
	    }

	    fg_ret = fgets_net(buf, sizeof(buf) - 1, fp);

	    if (fg_ret == NULL) {
		 fprintf(stder, "fgets: Error0);
		 return(EXIT_FAILURE);
	    }

	    printf("read: %s", buf);

	    return(EXIT_SUCCESS);
       }

SEE ALSO
       fopen_net(3), fseek_net(3), lseek_net(3), open_net(3), read_net(3)

libconfig 0.9.9			   25 Nov 04			    OPENNET(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net