repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
any1/wlvncc | src/main.c | /*
* Copyright (c) 2020 <NAME>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS AL... |
any1/wlvncc | include/vnc.h | /*
* Copyright (c) 2020 <NAME>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS AL... |
jbrandwood/EditWith | source/su3shellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/ep3shellx/config.h | <gh_stars>1-10
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software Licens... |
jbrandwood/EditWith | source/pspshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/kshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/seshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/uesshellx/config.h | <reponame>jbrandwood/EditWith<filename>source/uesshellx/config.h<gh_stars>1-10
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright... |
jbrandwood/EditWith | source/emeshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/scishellx/config.h | <reponame>jbrandwood/EditWith<filename>source/scishellx/config.h
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
... |
jbrandwood/EditWith | source/tpshellx/ResourceFuncs.h | // ****************************************************************************
// ****************************************************************************
//
// ResourceFuncs.h : Various utility funcs for accessing resource data.
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Ve... |
jbrandwood/EditWith | source/EditWithMyApp.h | // ****************************************************************************
// ****************************************************************************
//
// EditWithMyApp.h : Declaration of CEditWithMyApp shell extension object
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, ... |
jbrandwood/EditWith | source/stdafx.h | <filename>source/stdafx.h
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__951D8D82_8CE4_4847_93F6_36A0D9A05866__INCLUDED_)
#define AFX_STDAFX_H__951D8D82_8CE4_4847_93F6_36A0D9A05866__... |
jbrandwood/EditWith | source/tpshellx/config.h | <reponame>jbrandwood/EditWith
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost ... |
jbrandwood/EditWith | source/vimshellx/config.h | <reponame>jbrandwood/EditWith<gh_stars>1-10
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed un... |
jbrandwood/EditWith | source/pn2shellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/bshellx/config.h | <reponame>jbrandwood/EditWith
// ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost ... |
jbrandwood/EditWith | source/vshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/eppshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
jbrandwood/EditWith | source/meshellx/config.h | // ****************************************************************************
// ****************************************************************************
//
// config.h : Customization for this specific shell extension
//
// Copyright <NAME> 2014.
//
// Distributed under the Boost Software License, Version 1.0.... |
ZhiangChen/ros_vision | terrain_following/include/terrain_following/perception_model_cpp.h | <filename>terrain_following/include/terrain_following/perception_model_cpp.h
/// Perception model for terrain following
/// <NAME>, 7/2019
/*The MIT License (MIT)
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (... |
ZhiangChen/ros_vision | terrain_following/include/terrain_following/mavros_commander.h | <reponame>ZhiangChen/ros_vision
/// mavros commander
/// <NAME>, 7/2019
/*The MIT License (MIT)
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, inclu... |
ZhiangChen/ros_vision | terrain_following/include/terrain_following/waypoints_vel_controller.h | <reponame>ZhiangChen/ros_vision
/// waypoints_vel_controller.h
/// <NAME>, Aug 2019
/// MIT License
#ifndef WAYPOINTS_VEL_CONTROLLER_H_
#define WAYPOINTS_VEL_CONTROLLER_H_
#include <iostream> // for C++
#include <fstream>
#include <string>
#include <math.h>
#include <ros/ros.h> // for ROS
#include <sensor_msgs/Poin... |
suuhui/code | apue/processControl/prexit.c | <filename>apue/processControl/prexit.c<gh_stars>0
#include "../apueerr.h"
#include <sys/wait.h>
void pr_exit(int status)
{
if(WIFEXITED(status))
printf("normal termination, exit status = %d\n", WEXITSTATUS(status));
else if(WIFSIGNALED(status))
printf("abnormal termination, signal number = %d%s\n", WTERMSIG(stat... |
suuhui/code | apue/env/geten.c | <reponame>suuhui/code<filename>apue/env/geten.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
const char *key = "PWD";
char *val;
int i = setenv("MY", "name", 1);
val = getenv("PATH");
printf("%s\n", val);
return 0;
}
|
suuhui/code | ComputerSystem/netp/hex2dd.c | <gh_stars>0
#include <csapp.h>
int main(int argc, char **argv)
{
struct in_addr inaddr;
unsigned int addr;
if(2 != argc) {
fprintf(stderr, "Usage %s <hex number>\n", argv[0]);
exit(0);
}
sscanf(argv[1], "%x", &addr);
inaddr.s_addr = htonl(addr);
printf("%d\n", htonl(addr));
printf("%s\n", inet_ntoa(inaddr... |
suuhui/code | apue/signal/pr_mask.c | <filename>apue/signal/pr_mask.c
#include "../apueerr.h"
void pr_mask(const char *str);
int main()
{
}
void pr_mask(const char *str)
{
sigset_t sigset;
int errno_save;
errno_save = errno;
if(sigprocmask(0, NULL, &sigset) < 0)
err_ret("sigprocmask error");
else {
printf("%s", str);
if(sigismember(&sigset... |
suuhui/code | ComputerSystem/netp/hostinfo.c | #include <csapp.h>
int main(int argc, char **argv)
{
struct in_addr addr;
struct hostent *hostp;
char **pp;
if(2 != argc) {
fprintf(stderr, "Usage: %s <domain name or dotted-decimal>\n", argv[1]);
exit(0);
}
if(inet_aton(argv[1], &addr) == 0)
hostp = gethostbyname(argv[1]);
else
hostp = gethostbyaddr((... |
suuhui/code | ComputerSystem/prom/test43.c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
char *getLine()
{
char buf[8];
char *result;
gets(buf);
result = malloc(strlen(buf));
strcpy(result, buf);
return result;
}
int main()
{
char *s;
s = getLine();
printf("%s\n", s);
}
|
suuhui/code | apue/env/jmp.c | <reponame>suuhui/code<gh_stars>0
#include "../apueerr.h"
#include <setjmp.h>
static void f1(int, int, int, int);
static void f2(void);
static jmp_buf jmpbuf;
static int globval;
int main(void)
{
int autoval;
register int regival;
volatile int volaval;
static int statval;
globval = 1;
autoval = 2;
regival = 3... |
suuhui/code | apue/apue.h | #ifndef _APUE_H
#define _APUE_H
#define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */
#include <sys/types.h> /* some systems still require this */
#include <sys/stat.h>
#include <sys/termios.h> /* for winsize */
#ifndef TIOCGWINSZ
#include <sys/ioctl.h>
#endif
#include <stdio.h> /* for... |
suuhui/code | apue/stdIO/ungetch.c | #include "../apueerr.h"
int main()
{
int sum = 0;
int num;
char ch;
while(scanf("%d", &num) == 1){
sum += num;
while((ch = getchar()) == ' ');
if(ch == '\n')
break;
ungetc(ch, stdin);
}
printf("sum is %d\n", sum);
printf("last char is %c\n", ch);
exit(0);
}
|
suuhui/code | apue/fileAndDir/chdir.c | #include "../apueerr.h"
int main()
{
char *path;
int size;
if(chdir("/tmp") < 0)
err_sys("chdir failed");
path = path_alloc(&size);
if(getcwd(path, size) == NULL)
err_sys("getcwd failed");
printf("cwd = %s\n", path);
exit(0);
}
|
suuhui/code | dsaa/list/test.c | #include <stdio.h>
typedef struct tnode *Treeptr;
typedef struct tnode {
char *word;
int count;
Treeptr *left;
} treenode;
int main()
{
int i = sizeof(treenode);
return 0;
}
|
suuhui/code | apue/fileAndDir/umask.c | <gh_stars>0
#include "../apueerr.h"
#include <fcntl.h>
#define RWRWRW S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
int main()
{
umask(0);
if(creat("foo", RWRWRW) < 0)
err_sys("creat foo error!\n");
umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if(creat("bar", RWRWRW) < 0)
err_sys("creat bar err... |
suuhui/code | ComputerSystem/conc/echoserver.c | <filename>ComputerSystem/conc/echoserver.c
#include <csapp.h>
void echo(int connfd);
void sigchld_handler(int flag)
{
while(waitpid(-1, 0, WNOHANG) > 0)
;
return;
}
int main(int argc, char **argv)
{
int listenfd, connfd, port;
socklen_t clientlen = sizeof(struct sockaddr_in);
struct sockaddr_in clientaddr;
s... |
suuhui/code | apue/thread/deadlock.c | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define NHASH 29
#define HASH(id) (((unsigned long)id) % NHASH)
struct foo *fh[NHASH];
pthread_mutex_t hashlock = PTHREAD_MUTEX_INITIALIZER;
struct foo {
int f_count;
pthread_mutex_t f_lock;
int f_id;
struct foo *f_next;
};
struct foo *foo_alloc(int i... |
suuhui/code | ComputerSystem/netp/test.c | <filename>ComputerSystem/netp/test.c
#include <csapp.h>
#define M 128
int main()
{
int fd;
char *buf;
int i = 0;
rio_t rio;
fd = open("hex2dd.c", O_RDONLY, 0);
printf("fd is %d\n", fd);
Rio_readinitb(&rio, fd);
//rio_readnb(&rio, buf, 10240);
i = rio_readlineb(&rio, buf, M);
while(strcmp(buf, "{\n")) {
pri... |
suuhui/code | apue/apueerr.h | <gh_stars>0
#include "apue.h"
#include <errno.h> /* for definition of errno */
#include <stdarg.h> /* ISO C variable aruments */
static void err_doit(int, int, const char *, va_list);
/*
* Nonfatal error related to a system call.
* Print a message and return.
*/
void
err_ret(const char *fmt, ...)
{
va_li... |
suuhui/code | apue/fileAndDir/ftw.c | <reponame>suuhui/code
#include "../apueerr.h"
#include <dirent.h>
#include <limits.h>
/* function type that is called for each filename */
typedef int Myfunc(const char *, const struct stat *, int);
static Myfunc myfunc;
static int ftw(char *, Myfunc *);
static int dopath(Myfunc *);
static long nreg, ndir, nblk, nchr... |
suuhui/code | dsaa/list/main.c | #include "./list.c"
int main()
{
lnode *head, node;
createList(head);
int i;
for(i=1; i<6; i++) {
node = createNode(i);
insert(node, head);
}
node = head->next;
while(node != NULL) {
print("%d\n", node->element);
node = node->next;
}
return 0;
}
|
suuhui/code | dsaa/list/list.h | #ifndef _LIST_H
#define _LIST_H
typedef int eType;
typedef struct node *Lnode;
typedef struct node
{
eType element;
Lnode *next;
}lnode;
typedef struct lnode *PtrToLnode;
typedef PtrToLnode list;
typedef PtrToLnode position;
lnode createNode(eType x);
lnode createList(lnode l);
list makeEmpty(list l);
int isEmpty(l... |
suuhui/code | pearls/sort/isort.c | #include <stdio.h>
void isort1(int *arr);
void isort2(int *arr);
int main()
{
int arr[] = {8,3,5,2,5,6,1};
int n = 7;
int i;
isort1(arr);
for(i=0; i<n; i++){
printf("%d ", arr[i]);
}
printf("\n");
}
void isort1(int *arr)
{
int i,j,t;
int n = 7;
int count = 0;
for(i=1; i<n; i++) {
printf("i is :%d and... |
suuhui/code | apue/thread/thread_clean.c | #include "../apueerr.h"
#include <pthread.h>
void cleanup(void *arg)
{
printf("clean up: %s\n", (char *)arg);
}
void *thr_fn1(void *arg)
{
printf("thread 1 start\n");
pthread_cleanup_push(cleanup, "thread 1 first handler");
pthread_cleanup_push(cleanup, "thread 1 second handler");
printf("thread 1 push complet... |
suuhui/code | pearls/sort/rand.c | <filename>pearls/sort/rand.c<gh_stars>0
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int randint(int l, int u);
int main(int argc, char *argv[])
{
if(argc != 3) {
printf("Usage: ./randint.exe [lower] [upper]\n");
return (1);
}
int t = randint(atoi(argv[1]), atoi(argv[2]));
printf("rand num is : %d... |
suuhui/code | pearls/sort/hsort.c | #include <stdio.h>
#include "../func.c"
#define M 21
#define MAX 1000
void swap(int *tree, int i, int j);
void hsort(int *tree, int n);
void siftup(int *tree, int n);
void siftdown(int *tree, int n);
int main()
{
int i, tree[M] = {12,23,23,76,3,686,2,43,1,78,89,60,30,70,68,489,40,9,11,12,34};
hsort(tree, M);
fo... |
suuhui/code | apue/processControl/fork.c | #include "../apueerr.h"
int globvar = 6;
char buf[] = "write to stdout\n";
int main()
{
int var;
pid_t pid;
var = 88;
if(write(STDOUT_FILENO, buf, sizeof(buf) - 1) != sizeof(buf) - 1)
err_sys("write error");
printf("before fork\n");
if((pid = fork()) < 0)
err_sys("fork error");
else if(pid == 0) {
glo... |
suuhui/code | pearls/func.c | <gh_stars>0
#define N 1000000
#define BITSPERWORD 32
#define SHIFT 5
#define MASK 0x1F
int bita[1 + N / BITSPERWORD];
int a[N];
int com(const void *a, const void *b)
{
return *(int *)a - *(int *)b;
}
int randInt(int min, int max)
{
srand((unsigned) time(NULL));
return min + rand() % (max - min + 1);
}
int swap_n... |
suuhui/code | ComputerSystem/netp/echoserver.c | <reponame>suuhui/code<filename>ComputerSystem/netp/echoserver.c<gh_stars>0
#include <csapp.h>
void echo(int connfd);
int main(int argc, char **argv)
{
int listenfd, connfd, port, clientlen;
struct sockaddr_in clientaddr;
struct hostent *hp;
char *haddrp;
if(2 != argc) {
fprintf(stderr, "Usage: %s <port>\n", a... |
suuhui/code | apue/fileIO/mydup2.c | <gh_stars>0
#include "../apueerr.h"
#include <fcntl.h>
#define MAX 4096
int mydup2(int filedes, int fileds2);
int main(int argc, char **argv)
{
int fd;
if(argc != 3) {
err_sys("Usage: ./mydup2 <file> <newfd>\n");
return -1;
}
char *name = argv[1];
fd = open((const char *)name, O_RDWR);
if(fd < 0) {
err_... |
suuhui/code | apue/fileAndDir/link.c | <filename>apue/fileAndDir/link.c
#include "../apueerr.h"
int main(int argc, char **argv)
{
int ret;
ret = link("./stat.c", "stat.link");
printf("%d\n", ret);
}
|
suuhui/code | apue/signal/alerm.c | #include "../apueerr.h"
static void sig_alrm(int);
int main()
{
int n;
if(signal(SIGALRM, sig_alrm) == SIG_ERR){
err_sys("signam(SIGALRM) error");
}
alarm(10);
for(n=0; n<10; n++)
;
sleep(3);
n = alarm(2);
printf("%d\n", n);
sleep(3);
n = alarm(1);
printf("%d\n", n);
}
static void sig_alrm(int signo)... |
suuhui/code | comm/intToHex.c | #include <stdio.h>
#include <stdlib.h>
char *inttohex(long a);
char *buf;
int main(int argc, char *argv)
{
long n;
printf("please enter a number: ");
scanf("%ld", &n);
inttohex(n);
printf("%s\n", buf);
}
char *inttohex(long a)
{
int mod = 0;
int i=0;
long n;
do {
mod = a % 16;
buf[i] = mod < 10 ? mo... |
suuhui/code | ComputerSystem/prom/fact_while.c | #include <stdio.h>
//int fact_while(int n);
/*
int main()
{
int r = fact_while(5);
printf("%d\n", r);
}
*/
int fact_while(int n)
{
int result = 1;
while(n > 1) {
result *= n;
n--;
}
return result;
}
|
suuhui/code | ComputerSystem/netp/dd2hex.c | #include <csapp.h>
int main(int argc, char **argv)
{
struct in_addr inaddr;
unsigned int hex;
if(2 != argc) {
fprintf(stderr, "Usage %s <dotted-decimal>\n", argv[0]);
exit(0);
}
if(inet_aton(argv[1], &inaddr) == 0) {
fprintf(stderr, "inet_aton error");
exit(0);
}
hex = ntohl(inaddr.s_addr);
printf("0x... |
suuhui/code | apue/fileAndDir/stat.c | <filename>apue/fileAndDir/stat.c
#include "../apueerr.h"
int main()
{
struct stat st;
stat("test.txt", &st);
if(S_ISREG(st.st_mode))
printf("regular file\n");
return 0;
}
|
suuhui/code | apue/fileAndDir/rename.c | <reponame>suuhui/code
#include "../apueerr.h"
int main(int argc, char **argv)
{
if(argc != 3)
err_quit("Usage: rename.exe <oldname> <newname>\n");
const char *oldname = argv[1];
const char *newname = argv[2];
int ret;
ret = rename(oldname, newname);
printf("ret is %d\n", ret);
exit(0);
}
|
suuhui/code | dsaa/list/list.c | <reponame>suuhui/code
#include "../comm.h"
#include "./list.h"
Lnode createNode(eType x)
{
Lnode l;
l = malloc(sizeof(lnode));
if(l == NULL) {
printf("malloc error");
exit(1);
}
l->element = x;
l->next = NULL;
return l;
}
lnode createList(lnode l)
{
l = createNode(0);
return l;
}
/* Return true if l is... |
suuhui/code | ComputerSystem/netp/tiny.c | #include <csapp.h>
void doit(int fd);
void read_requesthdrs(rio_t *rp);
void read_requestbody(rio_t *rp);
int parse_uri(char *uri, char *filename, char *cgiargs);
void get_filetype(char *filename, char *filetype);
void serve_static(int fd, char *filename, int filesize);
void serve_dynamic(int fd, char *filename, char ... |
suuhui/code | ComputerSystem/conc/echo.c | <reponame>suuhui/code
#include <csapp.h>
void echo(int connfd)
{
size_t n;
char buf[MAXLINE];
rio_t rio;
Rio_readinitb(&rio, connfd);
while((n = Rio_readlineb(&rio, buf, MAXLINE)) != 0) {
printf("server received %d bytes\n", n);
printf("server received %s\n", buf);
Rio_writen(connfd, buf, n);
}
}
|
suuhui/code | pearls/sort/qsort.c | <filename>pearls/sort/qsort.c<gh_stars>0
#include <stdio.h>
void qsort(int *arr, int l, int u);
void swap(int *arr, int i, int j);
int main()
{
int arr[] = {5,2,67,3,77,32,64,23,86};
int n = 9;
qsort(arr, 0, n);
int i;
for(i=0; i<n; i++)
printf("%d\n", arr[i]);
printf("\n");
}
void qsort(int *arr, int l, int... |
suuhui/code | dsaa/introduction/select.c | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define MAX 1000
int randint(int, int);
int main()
{
int arr[MAX];
int i;
int r = 0; //rand int;
int t = 0; //template number, for exchange;
int mid = MAX / 2; //
for(i=0; i<MAX; i++){
printf("%d\n", i);
arr[i] = i;
}
for(i=0; i<MAX; i++){
r = ... |
suuhui/code | apue/fileIO/readAndWrite.c | <gh_stars>0
#include "../apueerr.h"
#include <fcntl.h>
#define MAX 1024
int main()
{
char buf[MAX];
int fd1, fd2;
const char *s1 = "hello world!\r\n";
const char *s2 = "world hello!\r\n";
fd1 = open("./a.txt", O_RDWR | O_APPEND);
fd2 = open("./a.txt", O_RDWR | O_APPEND);
write(fd1, (const void *)s1, strlen(s1))... |
suuhui/code | tcpl/func.c | <filename>tcpl/func.c<gh_stars>0
#include <stdio.h>
#include <math.h>
int atoi(char *s);
int htoi(char *s);
int main(int argc, char *argv[])
{
char *s = "123";
int n = atoi(s);
printf("%d\n", n);
}
int atoi(char *s)
{
int n = 0;
int i = 0;
for(; s[i] >= '0' && s[i] <='9'; ++i) {
n = n * 10 + (s[i] - '0');
}... |
suuhui/code | ComputerSystem/conc/echoclient.c | <gh_stars>0
#include <csapp.h>
int main(int argc, char **argv)
{
int clientfd, port;
char *host, buf[MAXLINE];
rio_t rio;
if(3 != argc) {
fprintf(stderr, "Usage: %s <host> <port>\n", argv[0]);
exit(0);
}
host = argv[1];
port = atoi(argv[2]);
clientfd = Open_clientfd(host, port);
Rio_readinitb(&rio, cli... |
suuhui/code | apue/fileIO/fcntl.c | <reponame>suuhui/code
#include "../apueerr.h"
#include <fcntl.h>
int main(int argc, char **argv)
{
int val;
if(argc != 2)
err_quit("Usage: a.out <descriptor#>");
if((val = fcntl(atoi(argv[1]), F_GETFL, 0)) < 0)
err_sys("fcntl error for fd %d\n", atoi(argv[1]));
/* use mask word O_ACCMODE get access mode b... |
suuhui/code | apue/processControl/compet.c | #include "../apueerr.h"
static void charatatime(char *);
int main(void)
{
pid_t pid;
if((pid = fork()) < 0){
err_sys("fork error");
} else if(pid == 0) {
charatatime("output from child\n");
} else {
charatatime("output from parent\n");
}
}
static void charatatime(char *s)
{
char *ptr;
int c;
setbuf(... |
andyxwxu/tinyos | tos/chips/msp432/include/msp432p401r_classic.h | <filename>tos/chips/msp432/include/msp432p401r_classic.h
/******************************************************************************
*
* Copyright (C) 2012 - 2016 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted ... |
Emmie-He/fluid-simulation | code/src/temp/Particles.h | <reponame>Emmie-He/fluid-simulation<gh_stars>1-10
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Particles.h
* Author: swl
*
* Created on April 15, 2016, 12:16 PM
... |
Emmie-He/fluid-simulation | code/src/Particles.h | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Particles.h
* Author: swl
*
* Created on April 15, 2016, 12:16 PM
*/
#ifndef PARTICLES_H
#define PARTICLES_H
#incl... |
mastensg/backlightd | main.c | #define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <poll.h>
#include <sys/time.h>
#include <linux/input.h>
const int the_keyboard_steps[] = {0, 8, 16, 32, 64, 128, 192, 255};
size_t the_keyboard_numsteps =
sizeof(the_keyboard_steps) / sizeof(the_keyboard_steps[0]);
const i... |
dwjackson/rbdym | ext/dym/dym.c | <reponame>dwjackson/rbdym
#include "ruby.h"
#include <dym.h>
#include <stdlib.h>
static VALUE rbdym_dl_edist(VALUE self, VALUE s1, VALUE s2);
static char *rstr2cstr(VALUE str);
void Init_dym()
{
VALUE mod = rb_define_module("DYM");
rb_define_method(mod, "edist", rbdym_dl_edist, 2);
}
static VALUE rbdym_dl_edist(VA... |
n-fallahinia/UoU_Genral_Class | include/Constants.h | <gh_stars>0
// Constants file
#ifndef UTAH_CONSTANTS
#define UTAH_CONSTANTS
// Error definitions
enum Utah_Errors
{
UTAH_NO_ERROR = 0,
UTAH_BAD_FILE_NAME
};
////////////////////////////////////////////////////////////////////////////////
// Mathematical constants
#define PI 3.141592
////////////////////////... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_api_1.h | <filename>include/maglev/ml_api_1.h<gh_stars>0
#ifndef __ML_API_1_H__
#define __ML_API_1_H__
#include "ml_api.h"
int invoke_local_function(ml_device_handle_t dev_hdl, ml_function_id_t* func_id,
char* args_in, char* args_out);
#endif // __ML_API_1_H__
|
n-fallahinia/UoU_Genral_Class | include/maglev/ml_api.h | /*! \file ml_api.h
\brief This is a header file for ml_api.c, which contains the api declaration
for both client side and server side of the Magnetic Levitation Haptic Interface API.
\author <NAME>
\date Created: Jul 14, 2005 \n Last Revision: Jul 14, 2005
\author <NAME>
\date Updated: Jul 14, 2006
... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_communication.h | #ifndef _SOCKET_EXPERIMENT_H
#define _SOCKET_EXPERIMENT_H
#ifdef WIN32
#include <winsock.h>
#else
#include <sys/socket.h>
#endif
#include <sys/types.h>
#include "ml_types.h"
#ifdef __cplusplus
extern "C"{
#endif
#define MAX_COMM_BUFFER_SIZE 512 // max buffer size sent between server and client
// routine which inv... |
n-fallahinia/UoU_Genral_Class | include/UserInterface.h | <reponame>n-fallahinia/UoU_Genral_Class<gh_stars>0
// generated by Fast Light User Interface Designer (fluid) version 1.0302
#ifndef UserInterface_h
#define UserInterface_h
#include "main.h"
#include "TimePlot.h"
#include "BarPlot.h"
#include "WorkspacePlot.h"
#include "ForceSensor.h"
#include "MaglevControl.h"
#incl... |
n-fallahinia/UoU_Genral_Class | include/MaglevControl.h | <reponame>n-fallahinia/UoU_Genral_Class
// Header file for MLHD interaction functions
#ifndef MAGLEV_FUNCTIONS_H
#define MAGLEV_FUNCTIONS_H
// Included files
#include "ForceSensor.h"
#include "ml_api.h"
#include <string>
class MaglevControl
{
private:
/////////////////////////////////////////////////
... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_constants.h | /*! \file ml_constants.h
\brief This header file defines MLHI-specific constants used by
the ml_ API layer and ml_ communication layer code.
\author <NAME>
\date Created: June 15, 2007
<B>Location:</B> \n
Carnegie Mellon University, Robotics Institute: \n
Microdynamic Systems Laboratory \n
... |
n-fallahinia/UoU_Genral_Class | include/Images.h | #ifndef IMAGES_H
#define IMAGES_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
class Images
{
public:
int cols;
int rows;
int inc;
// int num;
// int max_num;
Images();
Images(int, int, int );
Images(int, int, int, unsigned char *);
Images(Images *);
~Images();
void readImage(unsigned c... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_api_callback.h | /*! \file ml_api_callback.h
\brief This is a header file for ml_api_callback.c, which implements the callback api for the Magnetic Levitation Haptic Interface API.
\author <NAME>
\date Created: Apr 19, 2007 \n Last Revision: Apr 25, 2007
<B>Supervisor:</B> \n
Dr. <NAME> ... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_api_common.h | <filename>include/maglev/ml_api_common.h
/*! \file ml_api_common.h
\brief This header file defines MLHI-specific common data types
which are used by both RPC/client software and server-side software.
\author <NAME>
\date Created: May 15, 2007
<B>Location:</B> \n
Carnegie Mellon University, Ro... |
n-fallahinia/UoU_Genral_Class | include/WorkspacePlot.h | // Class definition for WorkspacePlot class
//
// Written by <NAME>
// 24 June 2014
// University of Utah
// Biorobotics Lab
#ifndef WORKSPACEPLOT_H
#define WORKSPACEPLOT_H
#include <FL/Fl_Gl_Window.H>
#include <vector>
// Still need to add a bar on the side to better indicate the z-position
class WorkspacePlot :... |
n-fallahinia/UoU_Genral_Class | include/TimePlot.h | <reponame>n-fallahinia/UoU_Genral_Class
// Plot 2D data with OpenGL
// It allows subplots in one window
// It allows multiple curves in one plot
// For each plot, the input is x, y[n], data_num, data_dim, title, xlable, ylabel
// It has options to show connected lines, dots only, or dots and lines
#ifndef TIMEPLOT_H
#... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_types.h | <reponame>n-fallahinia/UoU_Genral_Class
/*! \file ml_types.h
\brief This header file contains the various non-standard types used by
the ml_ API layer and ml_ communication layer code.
\author <NAME>
\date Created: July 2, 2006
\author <NAME>
\date Created: Feb 1, 2007
\author <NAME>
\date Modi... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_serialization.h | #ifndef __ML_SERIALIZATION__
#define __ML_SERIALIZATION__
#include "ml_api.h"
// use int32_t as the standard int for communication
#ifdef WIN32
typedef int ml_int_t;
typedef unsigned int ml_uint_t;
#else
typedef int32_t ml_int_t;
typedef uint32_t ml_uint_t;
#endif
#ifdef __cplusplus
extern "C"{
#endif
static const... |
n-fallahinia/UoU_Genral_Class | include/TimeHandler.h | <gh_stars>0
// All the functions that handle the timer
#ifndef TIMEHANDLER_H
#define TIMEHANDLER_H
#include <time.h>
class TimeHandler
{
private:
/////////////////////////////////////////////////
// Variables
// Number of clicks in one second
long long int current_clicks;... |
n-fallahinia/UoU_Genral_Class | include/BarPlot.h | <reponame>n-fallahinia/UoU_Genral_Class<filename>include/BarPlot.h
//
// "$Id: BarPlot.h 5519 2006-10-11 03:12:15Z mike $"
//
// BarPlot class definitions
//
// Created by <NAME>
// 12 June 2014
// University of Utah
// Biorobotics Lab
//
// Based on CubeView for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2... |
n-fallahinia/UoU_Genral_Class | include/main.h | <reponame>n-fallahinia/UoU_Genral_Class<filename>include/main.h
#ifndef MAIN_H
#define MAIN_H
#include "UserInterface.h"
#include "Constants.h"
#include "ml_api.h"
// Function definitions
double get_desired_position(double current_time);
void read_trajectory();
void display_force_reading(void * v);
void display_pos... |
n-fallahinia/UoU_Genral_Class | include/maglev/ml_error.h | /*! \file ml_error.h
\brief This header file defines the error codes used by the MLHI.
\author <NAME>
\date Created: July 6, 2005 \n Last Revision: July 14, 2005
<B>Supervisor:</B> \n
Dr. <NAME> \n\n
<B>Loc... |
n-fallahinia/UoU_Genral_Class | include/ForceSensor.h | //This is a class to handle force sensor
//It start a force sensor, read it with a certain of frequency
//The reading is stored in a queue.
#ifndef FORCESENSOR_H
#define FORCESENSOR_H
#include <comedilib.h>
// Define a structure to hold a single force reading
struct Reading
{
double raw_force_signal[6];
doubl... |
turesnake/tprPixelGames | src/innTest/innTest.h | /*
* ======================== innTest.h ==========================
* -- tpr --
* CREATE -- 2020.01.01
* MODIFY --
* ----------------------------------------------------------
*/
#ifndef TPR_INN_TEST_H
#define T... |
turesnake/tprPixelGames | src/Engine/tools/IntVec.h | <gh_stars>100-1000
/*
* ========================= IntVec.h ==========================
* -- tpr --
* CREATE -- 2018.11.28
* MODIFY --
* ----------------------------------------------------------
* 以像素为单位的 vec... |
turesnake/tprPixelGames | src/Engine/gameObj/GoAltiRange.h | /*
* ========================= GoAltiRange.h ==========================
* -- tpr --
* CREATE -- 2019.01.05
* MODIFY --
* ----------------------------------------------------------
* go 高度区间, 不是 地图海拔,要和 Altit... |
turesnake/tprPixelGames | src/Engine/multiThread/chunkCreate/Job_Field.h | /*
* ========================== Job_Field.h =======================
* -- tpr --
* CREATE -- 2019.10.08
* MODIFY --
* ----------------------------------------------------------
*/
#ifndef TPR_JOB_FIELD_H
#define... |
turesnake/tprPixelGames | src/Engine/input/DirAxes.h | <reponame>turesnake/tprPixelGames
/*
* ========================= DirAxes.h ==========================
* -- tpr --
* CREATE -- 2019.05.12
* MODIFY --
* ----------------------------------------------------------
... |
turesnake/tprPixelGames | src/Script/uiGos/allUIGoes.h | <filename>src/Script/uiGos/allUIGoes.h
/*
* ======================= allUIGoes.h ==========================
* -- tpr --
* CREATE -- 2019.08.25
* MODIFY --
* -------------------------------------------------------... |
turesnake/tprPixelGames | src/Script/gameObjs/bioSoup/BioSoupColorTable.h | /*
* ==================== BioSoupColorTable.h ==========================
* -- tpr --
* CREATE -- 2020.03.06
* MODIFY --
* ----------------------------------------------------------
*/
#ifndef TPR_GO_BIO_SOUP_CO... |
turesnake/tprPixelGames | src/Engine/json/json_oth.h | /*
* ======================= json_oth.h ==========================
* -- tpr --
* 创建 -- 2019.07.06
* 修改 --
* ----------------------------------------------------------
*/
#ifndef TPR_JSON_OTH_H
#define TPR_JSON_... |
turesnake/tprPixelGames | src/Engine/tprDebug/slicePic.h | <filename>src/Engine/tprDebug/slicePic.h
/*
* ========================= slicePic.h ==========================
* -- tpr --
* CREATE -- 2019.01.05
* MODIFY --
* ----------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.