GithubHelp home page GithubHelp logo

layerfsd / libcox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from symisc/libcox

0.0 0.0 0.0 126 KB

Cross Platform UNIX commands & System Calls

Home Page: http://libcox.symisc.net

License: Other

C 100.00%

libcox's Introduction

Symisc Libcox - Cross Platform System Calls & Utilities

libcox.symisc.net Version 1.7.0

Note: For production build, please rely only on the amalgamation build-release available at the libcox download page here.

Libcox is an ANSI-C Library which permit cross platform system calls and standard utilities among different operating systems via a system of commands similar to the standard UNIX one and backed by the native OS API (Refer to Libcox architecture).

Think of Libcox as an embedded shell to your application (without any external process execution) where you can perform your traditional system tasks such as listing directory entries, gathering file informations, interacting with the OS regardless of the underlying operating system.

Libcox features includes:

  • Cross platform system calls & utilities backed by native host OS API.
  • Built with over 145 commands similar to the standard UNIX one.
  • Libcox is built-up on layers using a VFS approach.
  • Libcox is a Self-Contained ANSI C library without dependency.
  • Thread safe and full re-entrant.
  • Simple, Clean and easy to use API.
  • Highly available online support.

###Libcox Programming Interfaces

Here is what you do to start experimenting with Libcox without having to do a lot of tedious reading and configuration. Get a copy of the last public release of Libcox. Visit the download page for additional information. The following are Some C/C++ samples to start experimenting with:

####Usefull Links to start with

Below is a simple C program that demonstrates how to use the Command Execution C/C++ interface to Libcox.

#include "libcox.h"
int main(int argc, char **argv){
		
		libcox *pHandle;            /* Libcox handle */
		libcox_value *pResult;     /* Return value of the last executed command */
		
		const char *zValue;           /* Cast the 'libcox_value' to a string */
		int rc;
	
		/* Obtain a new libcox handle*/
		rc = libcox_init(&pHandle);
		if( rc != LIBCOX_OK ){
			/* Handle error */
			return -1;
		}

		/* Execute the simplest command - uname: Get the underlying OS info (name, version, etc.) */
		rc = libcox_exec(pHandle,&pResult,"uname",-1);
		if( rc != LIBCOX_OK ){ /* Handle error */	}
		
		
		/* Get as a string representation and output the result */
		zValue = libcox_value_to_string(pResult,0);
		/* Output */
		printf("OS Info: %s\n\n",zValue); /* Should output something similar to: Windows 8.1 x64 localhost Build 85746... */

		/* Destroy the libcox_value */
		libcox_exec_result_destroy(pHandle,pResult);
		
		/* Finally, release the libcox handle */
		libcox_release(pHandle);
	}

libcox's People

Contributors

symisc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.