Sponsored Content
The Lounge What is on Your Mind? Port VPM Decompression Algorithm to PHP and then to Dive Computer Post 302635733 by Neo on Sunday 6th of May 2012 04:46:11 AM
Old 05-06-2012
Guess I'll start first by porting these functions, one-at-a-time, from C to PHP:

Blue means "First Cut Done" in this thread/project (update each time a function is ported to PHP)

Code:
extern /* Subroutine */ int calc_barometric_pressure();
extern /* Subroutine */ int calc_deco_ceiling();
extern /* Subroutine */ int onset_of_impermeability();
extern /* Subroutine */ int radius_root_finder();
extern /* Subroutine */ int nuclear_regeneration(), clock_();
extern /* Subroutine */ int vpm_repetitive_algorithm();
extern /* Subroutine */ int gas_loadings_surface_interval();
extern /* Subroutine */ int critical_volume();	    ;
extern /* Subroutine */ int calc_crushing_pressure(), 
                            calc_surface_phase_volume_time(), 
                            decompression_stop();
extern /* Subroutine */ int calc_start_of_deco_zone();
extern /* Subroutine */ int calc_initial_allowable_gradient(), 
                            gas_loadings_ascent_descen();
extern /* Subroutine */ int gas_loadings_constant_depth();
extern /* Subroutine */ int vpm_altitude_dive_algorithm();
extern /* Subroutine */ int calc_max_actual_gradient(), 
                            projected_ascent();

extern /* Subroutine */ doublereal schreiner_equation__();
extern /* Subroutine */ doublereal haldane_equation__();

Quote:
WARNING: Breathing compressed gas underwater, whether with conventional open-circuit scuba or closed-circuit rebreathers, is a potentially dangerous activity that requires specialized training. Breathing gas mixtures other than air underwater and especially using rebreather technology underwater, are activities which require considerable specialized training and certification. No one should ever attempt these activities without professional training. The information and software related to scuba diving, decompression theory and software code in this forum is provided for informational purposes only; and this information does not constitute adequate or proper training!
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Decompression utility

I am looking for an unzip application that can handle Unix .z files, but from a Windows environment AND has a command-line prompt. Anybody know of anything? TIA, H2M3 (2 Replies)
Discussion started by: H2M3
2 Replies

2. Windows & DOS: Issues & Discussions

Decompression with Cygwin

I am having some trouble decompressing a tar.bz2 with Cygwin. Is it even possible to do this? I am new to Unix so I have no idea. I downloaded GCC on my Windows machine (gcc-3.4.4.tar.bz2) and I've been trying to decompress and install it. Is cygwin this best way to decompress on a windows... (3 Replies)
Discussion started by: noob1021
3 Replies

3. UNIX for Dummies Questions & Answers

Compression and decompression in the same script

Hi Guys, I'm just wondering how to compress and decompress a file in the same script using multiple programs, and can it be done in one line? e.g gzip file && gunzip file bzip2 file && bunzip file I tried this and a few other combinations but it doesn't seem to work. Any... (6 Replies)
Discussion started by: Spaulds
6 Replies

4. Ubuntu

SSH and VPM Doubt

hI MY Nerd folks...i have ubuntu 10.4 in my machine...i want to use open shh in my latop for the sake of being complete anonymous...but am just a noob anyont got any tips for me for the complete steps or for How to LInks ...watever..thanks in advance (4 Replies)
Discussion started by: surensach
4 Replies

5. What is on Your Mind?

Port VPM Decompression Algorithm to PHP (Main Loop) - Part 2

Continued from here. Port the main loop C code to PHP. Here is the C code for the main loop: /* =============================================================================== */ /* Begin MAIN proc (see endofpgm for alternate entry) */ /*... (2 Replies)
Discussion started by: Neo
2 Replies

6. Post Here to Contact Site Administrators and Moderators

VPM decompression algorithm +++for NEO+++

Hi Neo, i have followed your porting of the VPM algorithm to C+. Did you ever finish this exercise? I am playing around with some ARM chips and would love to run the algorithm on them... would you care to share the final results? Thanks for your help. Greetings Carsten (0 Replies)
Discussion started by: carsten
0 Replies
CC_MD5(3cc)							       LOCAL							       CC_MD5(3cc)

NAME
CC_MD2_Init CC_MD2_Update CC_MD2_Final CC_MD2 CC_MD4_Init CC_MD4_Update CC_MD4_Final CC_MD4 CC_MD5_Init CC_MD5_Update CC_MD5_Final CC_MD5 -- MD2, MD4, and MD5 hash functions SYNOPSIS
#include <CommonCrypto/CommonDigest.h> extern int CC_MD2_Init(CC_MD2_CTX *c); extern int CC_MD2_Update(CC_MD2_CTX *c, const void *data, CC_LONG len); extern int CC_MD2_Final(unsigned char *md, CC_MD2_CTX *c); extern unsigned char * CC_MD2(const void *data, CC_LONG len, unsigned char *md); extern int CC_MD4_Init(CC_MD4_CTX *c); extern int CC_MD4_Update(CC_MD4_CTX *c, const void *data, CC_LONG len); extern int CC_MD4_Final(unsigned char *md, CC_MD4_CTX *c); extern unsigned char * CC_MD4(const void *data, CC_LONG len, unsigned char *md); extern int CC_MD5_Init(CC_MD5_CTX *c); extern int CC_MD5_Update(CC_MD5_CTX *c, const void *data, CC_LONG len); extern int CC_MD5_Final(unsigned char *md, CC_MD5_CTX *c); extern unsigned char * CC_MD5(const void *data, CC_LONG len, unsigned char *md); DESCRIPTION
The following functions are used to produce an hash from data: CC_MD2_Init() initializes a CC_MD2_CTX structure. CC_MD2_Update() can be called repeatedly with chunks of the message to be hashed (len bytes at data). CC_MD2_Final() places the MD2 message digest in md, which must have space for CC_MD2_DIGEST_LENGTH == 16 bytes of output, and erases the CC_MD2_CTX. CC_MD2() computes the MD2 message digest of the len bytes at data and places it in md (which must have space for CC_MD2_DIGEST_LENGTH == 16 bytes of output). It returns the md pointer. CC_MD4_Init(), CC_MD4_Update(), CC_MD4_Final(), CC_MD4(), CC_MD5_Init(), CC_MD5_Update(), CC_MD5_Final(), and CC_MD5() are analogous using an CC_MD4_CTX and CC_MD5_CTX structure. NOTE
MD2, MD4, and MD5 are recommended only for compatibility with existing applications. In new applications, SHA-256(or greater) should be pre- ferred. RETURN VALUES
All routines return 1 except for the one-shot routines ( CC_MD2() , etc.), which return the pointer passed in via the md parameter. CONFORMING TO
RFC 1319, RFC 1320, RFC 1321 SEE ALSO
CC_crypto(3cc), CC_SHA(3cc), CCHmac(3cc), CCCryptor(3cc) HISTORY
These functions are available in OS X 10.4 and later. These functions provide similar functionality to the routines found in OpenSSL 0.9.6 and may use the same implementation. BSD
April 5, 2007 BSD
All times are GMT -4. The time now is 06:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy