File: Util.h

package info (click to toggle)
pymol 1.8.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,248 kB
  • ctags: 24,095
  • sloc: cpp: 474,635; python: 75,034; ansic: 22,888; sh: 236; makefile: 78; csh: 21
file content (61 lines) | stat: -rw-r--r-- 2,396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61


/* 
A* -------------------------------------------------------------------
B* This file contains source code for the PyMOL computer program
C* Copyright (c) Schrodinger, LLC. 
D* -------------------------------------------------------------------
E* It is unlawful to modify or remove this copyright notice.
F* -------------------------------------------------------------------
G* Please see the accompanying LICENSE file for further information. 
H* -------------------------------------------------------------------
I* Additional authors of this source file include:
-* 
-* 
-*
Z* -------------------------------------------------------------------
*/
#ifndef _H_Util
#define _H_Util

#include "os_predef.h"

#include "PyMOLGlobals.h"
#include "Base.h"

void UtilZeroMem(void *ptr, ov_size howMuch);
void UtilCopyMem(void *dst, const void *src, ov_size howMuch);
void *UtilArrayCalloc(unsigned int *dim, ov_size ndim, ov_size atom_size);
char *UtilConcat(char *where,const char *what);
void UtilNConcat(char *dst, const char *str, ov_size n);
void UtilConcatVLA(char **vla, ov_size * cc, const char *str);
void UtilNPadVLA(char **vla, ov_size * cc, const char *str, ov_size len);
void UtilFillVLA(char **vla, ov_size * cc, char what, ov_size len);
void UtilNCopy(char *dst, const char *src, ov_size n);        /* up to N-1 chars */
void UtilNCopyToLower(char *dst, const char *src, ov_size n); /* up to N-1 chars */
void UtilCleanStr(char *s);
int UtilCountStringVLA(char *vla);

double UtilGetSeconds(PyMOLGlobals * G);
int UtilInit(PyMOLGlobals * G);
void UtilFree(PyMOLGlobals * G);

typedef int UtilOrderFn(void *array, int l, int r);
void UtilSortIndex(int n, void *array, int *x, UtilOrderFn * fOrdered);

int UtilSemiSortFloatIndex(int n, float *array, int *x, int forward);

void UtilApplySortedIndices(int n, int *x, int rec_size, void *src, void *dst);

void UtilSortInPlace(PyMOLGlobals * G, void *array, int nItem, unsigned int itemSize,
                     UtilOrderFn * fOrdered);

void UtilExpandArrayElements(void *src, void *dst, int n_entries, int old_rec_size,
                             int new_rec_size);
typedef int UtilOrderFnGlobals(PyMOLGlobals * G, void *array, int l, int r);
void UtilSortIndexGlobals(PyMOLGlobals * G, int n, void *array, int *x,
                          UtilOrderFnGlobals * fOrdered);

int UtilShouldWePrintQuantity(int quantity);

#endif