gimme-alpha 0.1

nanostructures.h File Reference

#include <glib.h>
#include "matdb.h"
Include dependency graph for nanostructures.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  doping_region_1d
struct  region_1d
struct  nanostructure
struct  nanostructure_1d

Enumerations

enum  doping_type { NONE, CONST, LAST_TYPE }
enum  nanostructure_type { NS_D1 }

Functions

struct nanostructurenanostructure_new (enum nanostructure_type type)
void structure_free (struct nanostructure *s)
struct doping_region_1ddoping_region_1d_new (enum doping_type dt)
struct region_1dregion_1d_new ()

Enumeration Type Documentation

Enumerator:
NONE 
CONST 
LAST_TYPE 

Definition at line 33 of file nanostructures.h.

Enumerator:
NS_D1 

Definition at line 39 of file nanostructures.h.

                        {
  NS_D1
};

Function Documentation

struct doping_region_1d* doping_region_1d_new ( enum doping_type  dt) [read]

Definition at line 76 of file nanostructures.c.

References unlikely.

                                                                   {
  struct doping_region_1d *dr;
  if(unlikely((dr = malloc(sizeof(struct doping_region_1d))) == NULL)) return NULL;
  return dr;
}
struct nanostructure* nanostructure_new ( enum nanostructure_type  type) [read]

Definition at line 95 of file nanostructures.c.

References nanostructure_1d_new(), nanostructure_free(), NS_D1, nanostructure::storage, nanostructure::type, and unlikely.

Referenced by get_nanostructure().

                                                                      {
  struct nanostructure *s;
  if(unlikely((s = malloc(sizeof(struct nanostructure))) == NULL)) return NULL;
  switch(type) {
  case NS_D1:
    s->type = type;
    s->storage = nanostructure_1d_new();
    break;
  default:
    s->storage = NULL;
  }
  /*Catch allocation errors and de-allocate if we errored*/
  if(unlikely((s->storage) == NULL)) {
    nanostructure_free(s);
  }
  return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct region_1d* region_1d_new ( ) [read]

Definition at line 82 of file nanostructures.c.

References unlikely.

                                  {
  struct region_1d *r;
  if(unlikely((r = malloc(sizeof(struct region_1d))) == NULL)) return NULL;
  return r;
}
void structure_free ( struct nanostructure s)
 All Classes Files Functions Variables Enumerations Enumerator Defines